2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h
|
2018-06-19 00:08:20 +02:00
|
|
|
index 1607d2617d3e..476a5147ab84 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/public/platform/platform.h
|
|
|
|
+++ third_party/blink/public/platform/platform.h
|
2018-06-19 00:08:20 +02:00
|
|
|
@@ -374,6 +374,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
2018-04-19 17:44:42 +02:00
|
|
|
// 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*) {}
|
|
|
|
|
2018-06-19 00:08:20 +02:00
|
|
|
@@ -718,6 +719,11 @@ class BLINK_PLATFORM_EXPORT Platform {
|
2018-04-19 17:44:42 +02:00
|
|
|
// 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
|
2018-06-19 00:08:20 +02:00
|
|
|
index a2fbf84747aa..8ab120155ccd 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/core/dom/dom_implementation.cc
|
|
|
|
+++ third_party/blink/renderer/core/dom/dom_implementation.cc
|
2018-02-15 01:12:09 +01:00
|
|
|
@@ -243,10 +243,11 @@ Document* DOMImplementation::createDocument(const String& type,
|
2017-04-20 21:28:17 +02:00
|
|
|
if (init.GetFrame()->IsMainFrame()) {
|
2018-02-15 01:12:09 +01:00
|
|
|
scoped_refptr<const SecurityOrigin> origin =
|
|
|
|
SecurityOrigin::Create(init.Url());
|
2017-10-20 19:45:20 +02:00
|
|
|
- plugin_data = init.GetFrame()->GetPage()->GetPluginData(origin.get());
|
2017-04-20 21:28:17 +02:00
|
|
|
+ plugin_data = init.GetFrame()->GetPage()->GetPluginData(true,
|
2017-10-20 19:45:20 +02:00
|
|
|
+ origin.get());
|
2017-04-20 21:28:17 +02:00
|
|
|
} else {
|
|
|
|
plugin_data =
|
|
|
|
- init.GetFrame()->GetPage()->GetPluginData(init.GetFrame()
|
|
|
|
+ init.GetFrame()->GetPage()->GetPluginData(false, init.GetFrame()
|
|
|
|
->Tree()
|
|
|
|
.Top()
|
2017-05-31 17:33:30 +02:00
|
|
|
.GetSecurityContext()
|
2018-04-19 17:44:42 +02:00
|
|
|
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
|
2018-06-19 00:08:20 +02:00
|
|
|
index c3d5777b9fab..a1388f5afe0d 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc
|
|
|
|
+++ third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc
|
2018-05-21 14:54:08 +02:00
|
|
|
@@ -325,6 +325,8 @@ WebDevToolsAgentImpl::Session::Session(
|
2018-02-15 01:12:09 +01:00
|
|
|
&WebDevToolsAgentImpl::Session::Detach, WrapWeakPersistent(this)));
|
2018-03-20 21:15:08 +01:00
|
|
|
|
|
|
|
InitializeInspectorSession(reattach_state);
|
|
|
|
+
|
2018-02-15 01:12:09 +01:00
|
|
|
+ Platform::Current()->DevToolsAgentAttached();
|
|
|
|
}
|
|
|
|
|
2018-03-20 21:15:08 +01:00
|
|
|
WebDevToolsAgentImpl::Session::~Session() {
|
2018-05-21 14:54:08 +02:00
|
|
|
@@ -350,6 +352,7 @@ void WebDevToolsAgentImpl::Session::Detach() {
|
2018-02-15 01:12:09 +01:00
|
|
|
io_session_->DeleteSoon();
|
|
|
|
io_session_ = nullptr;
|
|
|
|
inspector_session_->Dispose();
|
|
|
|
+ Platform::Current()->DevToolsAgentDetached();
|
|
|
|
}
|
|
|
|
|
2018-03-20 21:15:08 +01:00
|
|
|
void WebDevToolsAgentImpl::Session::SendProtocolResponse(int session_id,
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc
|
2018-06-19 00:08:20 +02:00
|
|
|
index ccc77a631977..74923148f3e2 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/core/frame/local_frame.cc
|
|
|
|
+++ third_party/blink/renderer/core/frame/local_frame.cc
|
2018-06-19 00:08:20 +02:00
|
|
|
@@ -1242,7 +1242,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
|
2017-04-20 21:28:17 +02:00
|
|
|
PluginData* LocalFrame::GetPluginData() const {
|
|
|
|
if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
|
|
|
|
return nullptr;
|
|
|
|
- return GetPage()->GetPluginData(
|
|
|
|
+ return GetPage()->GetPluginData(IsMainFrame(),
|
2017-05-31 17:33:30 +02:00
|
|
|
Tree().Top().GetSecurityContext()->GetSecurityOrigin());
|
2017-04-20 21:28:17 +02:00
|
|
|
}
|
|
|
|
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc
|
2018-06-19 00:08:20 +02:00
|
|
|
index a7a90df7f73a..f890d1a61626 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/core/page/page.cc
|
|
|
|
+++ third_party/blink/renderer/core/page/page.cc
|
2018-06-19 00:08:20 +02:00
|
|
|
@@ -158,7 +158,8 @@ Page::Page(PageClients& page_clients)
|
2017-07-27 01:19:27 +02:00
|
|
|
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 &&
|
2017-12-07 22:44:24 +01:00
|
|
|
page_clients.chrome_client->IsSVGImageChromeClient()
|
2018-02-15 01:12:09 +01:00
|
|
|
? UseCounter::kSVGImageContext
|
2018-06-08 18:53:10 +02:00
|
|
|
@@ -323,21 +324,40 @@ void Page::InitialStyleChanged() {
|
|
|
|
}
|
2017-04-20 21:28:17 +02:00
|
|
|
}
|
|
|
|
|
2018-02-15 01:12:09 +01:00
|
|
|
-PluginData* Page::GetPluginData(const SecurityOrigin* main_frame_origin) {
|
2017-07-27 01:19:27 +02:00
|
|
|
- if (!plugin_data_)
|
|
|
|
- plugin_data_ = PluginData::Create();
|
2017-04-20 21:28:17 +02:00
|
|
|
+PluginData* Page::GetPluginData(bool is_main_frame,
|
2018-02-15 01:12:09 +01:00
|
|
|
+ const SecurityOrigin* main_frame_origin) {
|
2017-04-20 21:28:17 +02:00
|
|
|
+ if (is_main_frame) {
|
2017-07-27 01:19:27 +02:00
|
|
|
+ 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() ||
|
2017-04-20 21:28:17 +02:00
|
|
|
+ !main_frame_origin->IsSameSchemeHostPort(
|
2018-02-15 01:12:09 +01:00
|
|
|
+ plugin_data_main_frame_->Origin())) {
|
2017-07-27 01:19:27 +02:00
|
|
|
+ plugin_data_main_frame_->UpdatePluginList(true, main_frame_origin);
|
2018-02-15 01:12:09 +01:00
|
|
|
+ }
|
|
|
|
+
|
2017-04-20 21:28:17 +02:00
|
|
|
+ return plugin_data_main_frame_.Get();
|
|
|
|
+ } else {
|
2017-07-27 01:19:27 +02:00
|
|
|
+ if (!plugin_data_sub_frame_)
|
|
|
|
+ plugin_data_sub_frame_ = PluginData::Create();
|
2018-02-15 01:12:09 +01:00
|
|
|
|
|
|
|
- return plugin_data_.Get();
|
2017-07-27 01:19:27 +02:00
|
|
|
+ if (!plugin_data_sub_frame_->Origin() ||
|
2017-04-20 21:28:17 +02:00
|
|
|
+ !main_frame_origin->IsSameSchemeHostPort(
|
2018-02-15 01:12:09 +01:00
|
|
|
+ plugin_data_sub_frame_->Origin())) {
|
2017-07-27 01:19:27 +02:00
|
|
|
+ plugin_data_sub_frame_->UpdatePluginList(false, main_frame_origin);
|
2018-02-15 01:12:09 +01:00
|
|
|
+ }
|
2017-07-27 01:19:27 +02:00
|
|
|
+
|
2017-04-20 21:28:17 +02:00
|
|
|
+ return plugin_data_sub_frame_.Get();
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
2017-07-27 01:19:27 +02:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
2018-06-19 00:08:20 +02:00
|
|
|
@@ -711,7 +731,8 @@ void Page::Trace(blink::Visitor* visitor) {
|
2017-07-27 01:19:27 +02:00
|
|
|
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_);
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h
|
2018-06-19 00:08:20 +02:00
|
|
|
index 68ea2ac5efd4..8661fa0ebe1c 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/core/page/page.h
|
|
|
|
+++ third_party/blink/renderer/core/page/page.h
|
2018-06-08 18:53:10 +02:00
|
|
|
@@ -138,7 +138,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
|
2017-04-20 21:28:17 +02:00
|
|
|
ViewportDescription GetViewportDescription() const;
|
|
|
|
|
2017-07-27 01:19:27 +02:00
|
|
|
// Returns the plugin data associated with |main_frame_origin|.
|
2018-02-15 01:12:09 +01:00
|
|
|
- PluginData* GetPluginData(const SecurityOrigin* main_frame_origin);
|
2017-04-20 21:28:17 +02:00
|
|
|
+ PluginData* GetPluginData(bool is_main_frame,
|
2018-02-15 01:12:09 +01:00
|
|
|
+ const SecurityOrigin* main_frame_origin);
|
2017-04-20 21:28:17 +02:00
|
|
|
|
2018-06-08 18:53:10 +02:00
|
|
|
// Resets the plugin data for all pages in the renderer process and notifies
|
|
|
|
// PluginsChangedObservers.
|
2018-06-19 00:08:20 +02:00
|
|
|
@@ -366,7 +367,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
|
2017-04-20 21:28:17 +02:00
|
|
|
// longer needed.
|
|
|
|
Member<Frame> main_frame_;
|
|
|
|
|
2017-07-27 01:19:27 +02:00
|
|
|
- Member<PluginData> plugin_data_;
|
|
|
|
+ Member<PluginData> plugin_data_main_frame_;
|
|
|
|
+ Member<PluginData> plugin_data_sub_frame_;
|
2017-04-20 21:28:17 +02:00
|
|
|
|
2018-02-15 01:12:09 +01:00
|
|
|
Member<ValidationMessageClient> validation_message_client_;
|
|
|
|
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/renderer/platform/plugins/plugin_data.cc third_party/blink/renderer/platform/plugins/plugin_data.cc
|
2018-06-08 18:53:10 +02:00
|
|
|
index a06a41fda418..b786f8cafe2c 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/platform/plugins/plugin_data.cc
|
|
|
|
+++ third_party/blink/renderer/platform/plugins/plugin_data.cc
|
2018-06-08 18:53:10 +02:00
|
|
|
@@ -84,15 +84,16 @@ void PluginData::Trace(blink::Visitor* visitor) {
|
2017-04-20 21:28:17 +02:00
|
|
|
void PluginData::RefreshBrowserSidePluginCache() {
|
2017-07-27 01:19:27 +02:00
|
|
|
PluginListBuilder builder(nullptr);
|
2018-06-08 18:53:10 +02:00
|
|
|
Platform::Current()->GetPluginList(
|
|
|
|
- true, WebSecurityOrigin::CreateUniqueOpaque(), &builder);
|
|
|
|
+ true, true, WebSecurityOrigin::CreateUniqueOpaque(), &builder);
|
2017-04-20 21:28:17 +02:00
|
|
|
}
|
|
|
|
|
2018-02-15 01:12:09 +01:00
|
|
|
-void PluginData::UpdatePluginList(const SecurityOrigin* main_frame_origin) {
|
2017-07-27 01:19:27 +02:00
|
|
|
+void PluginData::UpdatePluginList(bool is_main_frame,
|
2018-02-15 01:12:09 +01:00
|
|
|
+ const SecurityOrigin* main_frame_origin) {
|
2017-07-27 01:19:27 +02:00
|
|
|
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_)
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git third_party/blink/renderer/platform/plugins/plugin_data.h third_party/blink/renderer/platform/plugins/plugin_data.h
|
2018-05-17 10:58:21 +02:00
|
|
|
index f1a78d3e0d5f..f6403f5ac018 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- third_party/blink/renderer/platform/plugins/plugin_data.h
|
|
|
|
+++ third_party/blink/renderer/platform/plugins/plugin_data.h
|
2018-05-17 10:58:21 +02:00
|
|
|
@@ -101,7 +101,8 @@ class PLATFORM_EXPORT PluginData final
|
2017-07-27 01:19:27 +02:00
|
|
|
const HeapVector<Member<PluginInfo>>& Plugins() const { return plugins_; }
|
|
|
|
const HeapVector<Member<MimeClassInfo>>& Mimes() const { return mimes_; }
|
2017-10-20 19:45:20 +02:00
|
|
|
const SecurityOrigin* Origin() const { return main_frame_origin_.get(); }
|
2018-02-15 01:12:09 +01:00
|
|
|
- void UpdatePluginList(const SecurityOrigin* main_frame_origin);
|
|
|
|
+ void UpdatePluginList(bool is_main_frame,
|
|
|
|
+ const SecurityOrigin* main_frame_origin);
|
2017-07-27 01:19:27 +02:00
|
|
|
void ResetPluginData();
|
|
|
|
|
|
|
|
bool SupportsMimeType(const String& mime_type) const;
|