cef/patch/patches/webkit_plugin_info_2015.patch
Marshall Greenblatt cd27cbc802 Update to Chromium version 68.0.3425.0 ()
Known issues:
- Surface synchronization is now enabled for OSR, see issue .
- Jumbo build is broken, fixed in https://crrev.com/868717ce.
2018-05-21 13:54:23 +03:00

215 lines
9.7 KiB
Diff

diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h
index 3ab92de1a98b..89f115e689c6 100644
--- third_party/blink/public/platform/platform.h
+++ third_party/blink/public/platform/platform.h
@@ -368,6 +368,7 @@ class BLINK_PLATFORM_EXPORT Platform {
// satisfy this call. mainFrameOrigin is used by the browser process to
// filter plugins from the plugin list based on content settings.
virtual void GetPluginList(bool refresh,
+ bool is_main_frame,
const WebSecurityOrigin& main_frame_origin,
WebPluginListBuilder*) {}
@@ -727,6 +728,11 @@ class BLINK_PLATFORM_EXPORT Platform {
// runs during Chromium's build step).
virtual bool IsTakingV8ContextSnapshot() { return false; }
+ // DevTools ------------------------------------------------------------
+
+ virtual void DevToolsAgentAttached() {}
+ virtual void DevToolsAgentDetached() {}
+
protected:
Platform();
virtual ~Platform();
diff --git third_party/blink/renderer/core/dom/dom_implementation.cc third_party/blink/renderer/core/dom/dom_implementation.cc
index 8c40eef254a8..b9ac9f2a3472 100644
--- third_party/blink/renderer/core/dom/dom_implementation.cc
+++ third_party/blink/renderer/core/dom/dom_implementation.cc
@@ -243,10 +243,11 @@ Document* DOMImplementation::createDocument(const String& type,
if (init.GetFrame()->IsMainFrame()) {
scoped_refptr<const SecurityOrigin> origin =
SecurityOrigin::Create(init.Url());
- plugin_data = init.GetFrame()->GetPage()->GetPluginData(origin.get());
+ plugin_data = init.GetFrame()->GetPage()->GetPluginData(true,
+ origin.get());
} else {
plugin_data =
- init.GetFrame()->GetPage()->GetPluginData(init.GetFrame()
+ init.GetFrame()->GetPage()->GetPluginData(false, init.GetFrame()
->Tree()
.Top()
.GetSecurityContext()
diff --git third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc
index 114b6830844a..7d64147fc62e 100644
--- third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc
+++ third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc
@@ -323,6 +323,8 @@ WebDevToolsAgentImpl::Session::Session(
&WebDevToolsAgentImpl::Session::Detach, WrapWeakPersistent(this)));
InitializeInspectorSession(reattach_state);
+
+ Platform::Current()->DevToolsAgentAttached();
}
WebDevToolsAgentImpl::Session::~Session() {
@@ -348,6 +350,7 @@ void WebDevToolsAgentImpl::Session::Detach() {
io_session_->DeleteSoon();
io_session_ = nullptr;
inspector_session_->Dispose();
+ Platform::Current()->DevToolsAgentDetached();
}
void WebDevToolsAgentImpl::Session::SendProtocolResponse(int session_id,
diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc
index 60caa00ec723..5d37ee2552a1 100644
--- third_party/blink/renderer/core/frame/local_frame.cc
+++ third_party/blink/renderer/core/frame/local_frame.cc
@@ -1224,7 +1224,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
PluginData* LocalFrame::GetPluginData() const {
if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
return nullptr;
- return GetPage()->GetPluginData(
+ return GetPage()->GetPluginData(IsMainFrame(),
Tree().Top().GetSecurityContext()->GetSecurityOrigin());
}
diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc
index dc89b93741bd..399a33e9d4d7 100644
--- third_party/blink/renderer/core/page/page.cc
+++ third_party/blink/renderer/core/page/page.cc
@@ -153,7 +153,8 @@ Page::Page(PageClients& page_clients)
overscroll_controller_(
OverscrollController::Create(GetVisualViewport(), GetChromeClient())),
main_frame_(nullptr),
- plugin_data_(nullptr),
+ plugin_data_main_frame_(nullptr),
+ plugin_data_sub_frame_(nullptr),
use_counter_(page_clients.chrome_client &&
page_clients.chrome_client->IsSVGImageChromeClient()
? UseCounter::kSVGImageContext
@@ -331,21 +332,40 @@ void Page::RefreshPlugins() {
PluginData::RefreshBrowserSidePluginCache();
}
-PluginData* Page::GetPluginData(const SecurityOrigin* main_frame_origin) {
- if (!plugin_data_)
- plugin_data_ = PluginData::Create();
+PluginData* Page::GetPluginData(bool is_main_frame,
+ const SecurityOrigin* main_frame_origin) {
+ if (is_main_frame) {
+ if (!plugin_data_main_frame_)
+ plugin_data_main_frame_ = PluginData::Create();
- if (!plugin_data_->Origin() ||
- !main_frame_origin->IsSameSchemeHostPort(plugin_data_->Origin()))
- plugin_data_->UpdatePluginList(main_frame_origin);
+ if (!plugin_data_main_frame_->Origin() ||
+ !main_frame_origin->IsSameSchemeHostPort(
+ plugin_data_main_frame_->Origin())) {
+ plugin_data_main_frame_->UpdatePluginList(true, main_frame_origin);
+ }
+
+ return plugin_data_main_frame_.Get();
+ } else {
+ if (!plugin_data_sub_frame_)
+ plugin_data_sub_frame_ = PluginData::Create();
- return plugin_data_.Get();
+ if (!plugin_data_sub_frame_->Origin() ||
+ !main_frame_origin->IsSameSchemeHostPort(
+ plugin_data_sub_frame_->Origin())) {
+ plugin_data_sub_frame_->UpdatePluginList(false, main_frame_origin);
+ }
+
+ return plugin_data_sub_frame_.Get();
+ }
}
void Page::ResetPluginData() {
for (Page* page : AllPages()) {
- if (page->plugin_data_) {
- page->plugin_data_->ResetPluginData();
+ if (page->plugin_data_main_frame_ || page->plugin_data_sub_frame_) {
+ if (page->plugin_data_main_frame_)
+ page->plugin_data_main_frame_->ResetPluginData();
+ if (page->plugin_data_sub_frame_)
+ page->plugin_data_sub_frame_->ResetPluginData();
page->NotifyPluginsChanged();
}
}
@@ -718,7 +738,8 @@ void Page::Trace(blink::Visitor* visitor) {
visitor->Trace(visual_viewport_);
visitor->Trace(overscroll_controller_);
visitor->Trace(main_frame_);
- visitor->Trace(plugin_data_);
+ visitor->Trace(plugin_data_main_frame_);
+ visitor->Trace(plugin_data_sub_frame_);
visitor->Trace(validation_message_client_);
visitor->Trace(use_counter_);
visitor->Trace(plugins_changed_observers_);
diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h
index 0f51ac4d6e62..ccaae2f1c38f 100644
--- third_party/blink/renderer/core/page/page.h
+++ third_party/blink/renderer/core/page/page.h
@@ -138,7 +138,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
ViewportDescription GetViewportDescription() const;
// Returns the plugin data associated with |main_frame_origin|.
- PluginData* GetPluginData(const SecurityOrigin* main_frame_origin);
+ PluginData* GetPluginData(bool is_main_frame,
+ const SecurityOrigin* main_frame_origin);
// Refreshes the browser-side plugin cache.
static void RefreshPlugins();
@@ -374,7 +375,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
// longer needed.
Member<Frame> main_frame_;
- Member<PluginData> plugin_data_;
+ Member<PluginData> plugin_data_main_frame_;
+ Member<PluginData> plugin_data_sub_frame_;
Member<ValidationMessageClient> validation_message_client_;
diff --git third_party/blink/renderer/platform/plugins/plugin_data.cc third_party/blink/renderer/platform/plugins/plugin_data.cc
index 73d10a188b27..8af05af0dc76 100644
--- third_party/blink/renderer/platform/plugins/plugin_data.cc
+++ third_party/blink/renderer/platform/plugins/plugin_data.cc
@@ -83,16 +83,18 @@ void PluginData::Trace(blink::Visitor* visitor) {
// static
void PluginData::RefreshBrowserSidePluginCache() {
PluginListBuilder builder(nullptr);
- Platform::Current()->GetPluginList(true, WebSecurityOrigin::CreateUnique(),
+ Platform::Current()->GetPluginList(true, true,
+ WebSecurityOrigin::CreateUnique(),
&builder);
}
-void PluginData::UpdatePluginList(const SecurityOrigin* main_frame_origin) {
+void PluginData::UpdatePluginList(bool is_main_frame,
+ const SecurityOrigin* main_frame_origin) {
ResetPluginData();
main_frame_origin_ = main_frame_origin;
PluginListBuilder builder(&plugins_);
Platform::Current()->GetPluginList(
- false, WebSecurityOrigin(main_frame_origin_), &builder);
+ false, is_main_frame, WebSecurityOrigin(main_frame_origin_), &builder);
for (PluginInfo* plugin_info : plugins_) {
for (MimeClassInfo* mime_class_info : plugin_info->mimes_)
diff --git third_party/blink/renderer/platform/plugins/plugin_data.h third_party/blink/renderer/platform/plugins/plugin_data.h
index f1a78d3e0d5f..f6403f5ac018 100644
--- third_party/blink/renderer/platform/plugins/plugin_data.h
+++ third_party/blink/renderer/platform/plugins/plugin_data.h
@@ -101,7 +101,8 @@ class PLATFORM_EXPORT PluginData final
const HeapVector<Member<PluginInfo>>& Plugins() const { return plugins_; }
const HeapVector<Member<MimeClassInfo>>& Mimes() const { return mimes_; }
const SecurityOrigin* Origin() const { return main_frame_origin_.get(); }
- void UpdatePluginList(const SecurityOrigin* main_frame_origin);
+ void UpdatePluginList(bool is_main_frame,
+ const SecurityOrigin* main_frame_origin);
void ResetPluginData();
bool SupportsMimeType(const String& mime_type) const;