Commit 5742ed9a authored by Mike West's avatar Mike West Committed by Commit Bot

Measure usage of `<embed>` and `<object>` for non-plugin content.

The conversation in https://github.com/whatwg/fetch/pull/948 makes me
curious about how locked-in we are to the existing behavior around both
`<embed>` and `<object>` when used for non-plugin content. They're
basically strange `<iframe>`s, and it might be reasonable to push them
closer towards _being_ `<iframe>` elements, or to push them further
away, depending on how usage numbers look.

Change-Id: I843ae37ae74033fdb3ea9b920ce3932004a067b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847291
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: default avatarDaniel Vogelheim <vogelheim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703722}
parent 16667fac
...@@ -2427,6 +2427,10 @@ enum WebFeature { ...@@ -2427,6 +2427,10 @@ enum WebFeature {
kInvalidFragmentDirective = 3043, kInvalidFragmentDirective = 3043,
kContactsManagerGetProperties = 3044, kContactsManagerGetProperties = 3044,
kEvaluateScriptMovedBetweenElementDocuments = 3045, kEvaluateScriptMovedBetweenElementDocuments = 3045,
kPluginElementLoadedDocument = 3046,
kPluginElementLoadedImage = 3047,
kPluginElementLoadedExternal = 3048,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h" #include "third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h"
#include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h" #include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h" #include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_request.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_request.h"
#include "third_party/blink/renderer/platform/network/mime/mime_type_from_url.h" #include "third_party/blink/renderer/platform/network/mime/mime_type_from_url.h"
#include "third_party/blink/renderer/platform/network/mime/mime_type_registry.h" #include "third_party/blink/renderer/platform/network/mime/mime_type_registry.h"
...@@ -581,6 +582,16 @@ bool HTMLPlugInElement::RequestObject(const PluginParameters& plugin_params) { ...@@ -581,6 +582,16 @@ bool HTMLPlugInElement::RequestObject(const PluginParameters& plugin_params) {
ResetInstance(); ResetInstance();
if (object_type == ObjectContentType::kFrame || if (object_type == ObjectContentType::kFrame ||
object_type == ObjectContentType::kImage || handled_externally) { object_type == ObjectContentType::kImage || handled_externally) {
if (object_type == ObjectContentType::kFrame) {
UseCounter::Count(GetDocument(),
WebFeature::kPluginElementLoadedDocument);
} else if (object_type == ObjectContentType::kImage) {
UseCounter::Count(GetDocument(), WebFeature::kPluginElementLoadedImage);
} else {
UseCounter::Count(GetDocument(),
WebFeature::kPluginElementLoadedExternal);
}
if (ContentFrame() && ContentFrame()->IsRemoteFrame()) { if (ContentFrame() && ContentFrame()->IsRemoteFrame()) {
// During lazy reattaching, the plugin element loses EmbeddedContentView. // During lazy reattaching, the plugin element loses EmbeddedContentView.
// Since the ContentFrame() is not torn down the options here are to // Since the ContentFrame() is not torn down the options here are to
......
...@@ -24867,6 +24867,9 @@ Called by update_net_error_codes.py.--> ...@@ -24867,6 +24867,9 @@ Called by update_net_error_codes.py.-->
<int value="3043" label="InvalidFragmentDirective"/> <int value="3043" label="InvalidFragmentDirective"/>
<int value="3044" label="ContactsManagerGetProperties"/> <int value="3044" label="ContactsManagerGetProperties"/>
<int value="3045" label="EvaluateScriptMovedBetweenElementDocuments"/> <int value="3045" label="EvaluateScriptMovedBetweenElementDocuments"/>
<int value="3046" label="PluginElementLoadedDocument"/>
<int value="3047" label="PluginElementLoadedImage"/>
<int value="3048" label="PluginElementLoadedExternal"/>
</enum> </enum>
<enum name="FeaturePolicyAllowlistType"> <enum name="FeaturePolicyAllowlistType">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment