Chromium Code Reviews| 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..4a11df24372cfb0431454cdbe366690c54c703c9 100644 |
| --- a/third_party/WebKit/Source/core/dom/DOMImplementation.cpp |
| +++ b/third_party/WebKit/Source/core/dom/DOMImplementation.cpp |
| @@ -225,9 +225,11 @@ 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)) { |
| + SecurityContext* mainFrameSecurityContext = init.frame()->page()->mainFrame()->securityContext(); |
| + pluginData = init.frame()->page()->pluginData(mainFrameSecurityContext ? mainFrameSecurityContext->getSecurityOrigin() : SecurityOrigin::create(init.url()).get()); |
|
dcheng
2016/08/23 05:51:55
Hm, so when we create the document for the main fr
tommycli
2016/08/23 17:31:03
For the purposes of retrieving the plugin data, we
trizzofo
2016/08/23 22:46:20
I changed it to use Frame's IsMainFrame() method.
|
| + } |
| // 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. |