mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-30 19:14:56 +01:00
5c79944b31
- CefLifeSpanHandler::OnBeforePopup is now called on the UI thread. - Remove CefBrowserSettings.javascript_open_windows which is no longer supported.
171 lines
7.8 KiB
Diff
171 lines
7.8 KiB
Diff
diff --git third_party/WebKit/Source/core/dom/DOMImplementation.cpp third_party/WebKit/Source/core/dom/DOMImplementation.cpp
|
|
index 372b21d..78107f3 100644
|
|
--- third_party/WebKit/Source/core/dom/DOMImplementation.cpp
|
|
+++ third_party/WebKit/Source/core/dom/DOMImplementation.cpp
|
|
@@ -242,10 +242,11 @@ Document* DOMImplementation::createDocument(const String& type,
|
|
// For that reason, the origin must be retrieved directly from init.url().
|
|
if (init.GetFrame()->IsMainFrame()) {
|
|
RefPtr<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/WebKit/Source/core/frame/LocalFrame.cpp third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
|
index 9c6d497..6296f53 100644
|
|
--- third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
|
+++ third_party/WebKit/Source/core/frame/LocalFrame.cpp
|
|
@@ -930,7 +930,7 @@ ContentSettingsClient* LocalFrame::GetContentSettingsClient() {
|
|
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/WebKit/Source/core/page/Page.cpp third_party/WebKit/Source/core/page/Page.cpp
|
|
index 6dc4b21..41d56b5 100644
|
|
--- third_party/WebKit/Source/core/page/Page.cpp
|
|
+++ third_party/WebKit/Source/core/page/Page.cpp
|
|
@@ -289,16 +289,30 @@ void Page::RefreshPlugins() {
|
|
|
|
for (const Page* page : AllPages()) {
|
|
// Clear out the page's plugin data.
|
|
- if (page->plugin_data_)
|
|
- page->plugin_data_ = nullptr;
|
|
+ if (page->plugin_data_main_frame_)
|
|
+ page->plugin_data_main_frame_ = nullptr;
|
|
+ if (page->plugin_data_sub_frame_)
|
|
+ page->plugin_data_sub_frame_ = nullptr;
|
|
}
|
|
}
|
|
|
|
-PluginData* Page::GetPluginData(SecurityOrigin* main_frame_origin) const {
|
|
- if (!plugin_data_ ||
|
|
- !main_frame_origin->IsSameSchemeHostPort(plugin_data_->Origin()))
|
|
- plugin_data_ = PluginData::Create(main_frame_origin);
|
|
- return plugin_data_.Get();
|
|
+PluginData* Page::GetPluginData(bool is_main_frame,
|
|
+ SecurityOrigin* main_frame_origin) const {
|
|
+ if (is_main_frame) {
|
|
+ if (!plugin_data_main_frame_ ||
|
|
+ !main_frame_origin->IsSameSchemeHostPort(
|
|
+ plugin_data_main_frame_->Origin())) {
|
|
+ plugin_data_main_frame_ = PluginData::Create(true, main_frame_origin);
|
|
+ }
|
|
+ return plugin_data_main_frame_.Get();
|
|
+ } else {
|
|
+ if (!plugin_data_sub_frame_ ||
|
|
+ !main_frame_origin->IsSameSchemeHostPort(
|
|
+ plugin_data_sub_frame_->Origin())) {
|
|
+ plugin_data_sub_frame_ = PluginData::Create(false, main_frame_origin);
|
|
+ }
|
|
+ return plugin_data_sub_frame_.Get();
|
|
+ }
|
|
}
|
|
|
|
void Page::SetValidationMessageClient(ValidationMessageClient* client) {
|
|
diff --git third_party/WebKit/Source/core/page/Page.h third_party/WebKit/Source/core/page/Page.h
|
|
index e644faa..2fe0d37 100644
|
|
--- third_party/WebKit/Source/core/page/Page.h
|
|
+++ third_party/WebKit/Source/core/page/Page.h
|
|
@@ -132,7 +132,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
|
|
ViewportDescription GetViewportDescription() const;
|
|
|
|
static void RefreshPlugins();
|
|
- PluginData* GetPluginData(SecurityOrigin* main_frame_origin) const;
|
|
+ PluginData* GetPluginData(bool is_main_frame,
|
|
+ SecurityOrigin* main_frame_origin) const;
|
|
|
|
EditorClient& GetEditorClient() const { return *editor_client_; }
|
|
SpellCheckerClient& GetSpellCheckerClient() const {
|
|
@@ -324,7 +325,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
|
|
// longer needed.
|
|
Member<Frame> main_frame_;
|
|
|
|
- mutable RefPtr<PluginData> plugin_data_;
|
|
+ mutable RefPtr<PluginData> plugin_data_main_frame_;
|
|
+ mutable RefPtr<PluginData> plugin_data_sub_frame_;
|
|
|
|
EditorClient* const editor_client_;
|
|
SpellCheckerClient* const spell_checker_client_;
|
|
diff --git third_party/WebKit/Source/platform/plugins/PluginData.cpp third_party/WebKit/Source/platform/plugins/PluginData.cpp
|
|
index 03618f6..5ac59e8 100644
|
|
--- third_party/WebKit/Source/platform/plugins/PluginData.cpp
|
|
+++ third_party/WebKit/Source/platform/plugins/PluginData.cpp
|
|
@@ -30,11 +30,12 @@
|
|
|
|
namespace blink {
|
|
|
|
-PluginData::PluginData(SecurityOrigin* main_frame_origin)
|
|
- : main_frame_origin_(main_frame_origin) {
|
|
+PluginData::PluginData(bool is_main_frame, SecurityOrigin* main_frame_origin)
|
|
+ : is_main_frame_(is_main_frame),
|
|
+ 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 (unsigned i = 0; i < plugins_.size(); ++i) {
|
|
const PluginInfo& plugin = plugins_[i];
|
|
@@ -73,7 +74,8 @@ String PluginData::PluginNameForMimeType(const String& mime_type) const {
|
|
void PluginData::RefreshBrowserSidePluginCache() {
|
|
Vector<PluginInfo> plugins;
|
|
PluginListBuilder builder(&plugins);
|
|
- Platform::Current()->GetPluginList(true, WebSecurityOrigin::CreateUnique(),
|
|
+ Platform::Current()->GetPluginList(true, true,
|
|
+ WebSecurityOrigin::CreateUnique(),
|
|
&builder);
|
|
}
|
|
|
|
diff --git third_party/WebKit/Source/platform/plugins/PluginData.h third_party/WebKit/Source/platform/plugins/PluginData.h
|
|
index cdf3381..671f17c 100644
|
|
--- third_party/WebKit/Source/platform/plugins/PluginData.h
|
|
+++ third_party/WebKit/Source/platform/plugins/PluginData.h
|
|
@@ -52,8 +52,9 @@ class PLATFORM_EXPORT PluginData : public RefCounted<PluginData> {
|
|
WTF_MAKE_NONCOPYABLE(PluginData);
|
|
|
|
public:
|
|
- static PassRefPtr<PluginData> Create(SecurityOrigin* main_frame_origin) {
|
|
- return AdoptRef(new PluginData(main_frame_origin));
|
|
+ static PassRefPtr<PluginData> Create(bool is_main_frame,
|
|
+ SecurityOrigin* main_frame_origin) {
|
|
+ return AdoptRef(new PluginData(is_main_frame, main_frame_origin));
|
|
}
|
|
|
|
const Vector<PluginInfo>& Plugins() const { return plugins_; }
|
|
@@ -71,12 +72,13 @@ class PLATFORM_EXPORT PluginData : public RefCounted<PluginData> {
|
|
static void RefreshBrowserSidePluginCache();
|
|
|
|
private:
|
|
- explicit PluginData(SecurityOrigin* main_frame_origin);
|
|
+ explicit PluginData(bool is_main_frame, SecurityOrigin* main_frame_origin);
|
|
const PluginInfo* PluginInfoForMimeType(const String& mime_type) const;
|
|
|
|
Vector<PluginInfo> plugins_;
|
|
Vector<MimeClassInfo> mimes_;
|
|
Vector<size_t> mime_plugin_indices_;
|
|
+ bool is_main_frame_;
|
|
RefPtr<SecurityOrigin> main_frame_origin_;
|
|
};
|
|
|
|
diff --git third_party/WebKit/public/platform/Platform.h third_party/WebKit/public/platform/Platform.h
|
|
index f7360bf6..f7599cc 100644
|
|
--- third_party/WebKit/public/platform/Platform.h
|
|
+++ third_party/WebKit/public/platform/Platform.h
|
|
@@ -363,6 +363,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*) {}
|
|
|