Commit e2526e40 authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Don't route plugin background color through DocumentInit

Change-Id: I7abee88a5214a4e7a0a0680e4e46f80ece3f9182
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2298174
Auto-Submit: Nate Chapin <japhet@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789281}
parent 95d79560
...@@ -220,11 +220,6 @@ DocumentInit& DocumentInit::WithTypeFrom(const String& mime_type) { ...@@ -220,11 +220,6 @@ DocumentInit& DocumentInit::WithTypeFrom(const String& mime_type) {
mime_type_ = mime_type; mime_type_ = mime_type;
type_ = ComputeDocumentType(GetFrame(), Url(), mime_type_, type_ = ComputeDocumentType(GetFrame(), Url(), mime_type_,
&is_for_external_handler_); &is_for_external_handler_);
if (type_ == Type::kPlugin) {
plugin_background_color_ =
GetPluginData(GetFrame(), Url())
->PluginBackgroundColorForMimeType(mime_type_);
}
return *this; return *this;
} }
......
...@@ -122,7 +122,6 @@ class CORE_EXPORT DocumentInit final { ...@@ -122,7 +122,6 @@ class CORE_EXPORT DocumentInit final {
Type GetType() const { return type_; } Type GetType() const { return type_; }
const String& GetMimeType() const { return mime_type_; } const String& GetMimeType() const { return mime_type_; }
bool IsForExternalHandler() const { return is_for_external_handler_; } bool IsForExternalHandler() const { return is_for_external_handler_; }
Color GetPluginBackgroundColor() const { return plugin_background_color_; }
// Used when creating Documents not attached to a window. // Used when creating Documents not attached to a window.
DocumentInit& WithExecutionContext(ExecutionContext*); DocumentInit& WithExecutionContext(ExecutionContext*);
...@@ -189,7 +188,6 @@ class CORE_EXPORT DocumentInit final { ...@@ -189,7 +188,6 @@ class CORE_EXPORT DocumentInit final {
KURL web_bundle_claimed_url_; KURL web_bundle_claimed_url_;
bool is_for_external_handler_ = false; bool is_for_external_handler_ = false;
Color plugin_background_color_;
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
bool for_test_ = false; bool for_test_ = false;
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "third_party/blink/renderer/core/layout/layout_embedded_object.h" #include "third_party/blink/renderer/core/layout/layout_embedded_object.h"
#include "third_party/blink/renderer/core/loader/document_loader.h" #include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/loader/frame_loader.h" #include "third_party/blink/renderer/core/loader/frame_loader.h"
#include "third_party/blink/renderer/core/page/plugin_data.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/heap.h" #include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
...@@ -182,14 +183,14 @@ WebPluginContainerImpl* PluginDocumentParser::GetPluginView() const { ...@@ -182,14 +183,14 @@ WebPluginContainerImpl* PluginDocumentParser::GetPluginView() const {
PluginDocument::PluginDocument(const DocumentInit& initializer) PluginDocument::PluginDocument(const DocumentInit& initializer)
: HTMLDocument(initializer, kPluginDocumentClass), : HTMLDocument(initializer, kPluginDocumentClass),
background_color_(initializer.GetPluginBackgroundColor()) { background_color_(
GetFrame()->GetPluginData()->PluginBackgroundColorForMimeType(
initializer.GetMimeType())) {
SetCompatibilityMode(kQuirksMode); SetCompatibilityMode(kQuirksMode);
LockCompatibilityMode(); LockCompatibilityMode();
if (GetExecutionContext()) {
GetExecutionContext()->GetScheduler()->RegisterStickyFeature( GetExecutionContext()->GetScheduler()->RegisterStickyFeature(
SchedulingPolicy::Feature::kContainsPlugins, SchedulingPolicy::Feature::kContainsPlugins,
{SchedulingPolicy::RecordMetricsForBackForwardCache()}); {SchedulingPolicy::RecordMetricsForBackForwardCache()});
}
} }
DocumentParser* PluginDocument::CreateParser() { DocumentParser* PluginDocument::CreateParser() {
......
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