Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: third_party/WebKit/Source/core/dom/DOMImplementation.cpp

Issue 2156803002: [HBD] Remove PluginCache and reload plugin list when origin changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/DOMImplementation.cpp
diff --git a/third_party/WebKit/Source/core/dom/DOMImplementation.cpp b/third_party/WebKit/Source/core/dom/DOMImplementation.cpp
index 5c7975e2c94c5fb777ecb1d96de93c7e7abc6cf0..8b4ac92c0d8b5ad40c65a9c9470da4eb5881ae26 100644
--- a/third_party/WebKit/Source/core/dom/DOMImplementation.cpp
+++ b/third_party/WebKit/Source/core/dom/DOMImplementation.cpp
@@ -225,9 +225,17 @@ Document* DOMImplementation::createDocument(const String& type, const DocumentIn
if (type == "application/xhtml+xml")
return XMLDocument::createXHTML(init);
- PluginData* pluginData = 0;
- if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlugins(NotAboutToInstantiatePlugin))
- pluginData = init.frame()->pluginData();
+ PluginData* pluginData = nullptr;
+ if (init.frame() && init.frame()->page() && init.frame()->loader().allowPlugins(NotAboutToInstantiatePlugin)) {
+ // If the document is being created for the main frame, init.frame()->tree().top()->securityContext() returns nullptr.
+ // For that reason, the origin must be retrieved directly from init.url().
+ if (init.frame()->isMainFrame()) {
+ RefPtr<SecurityOrigin> origin = SecurityOrigin::create(init.url());
+ pluginData = init.frame()->page()->pluginData(origin.get());
+ } else {
+ pluginData = init.frame()->page()->pluginData(init.frame()->tree().top()->securityContext()->getSecurityOrigin());
+ }
+ }
// PDF is one image type for which a plugin can override built-in support.
// We do not want QuickTime to take over all image types, obviously.
« no previous file with comments | « content/test/test_blink_web_unit_test_support.cc ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698