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

Unified Diff: Source/core/html/HTMLPlugInElement.cpp

Issue 76303002: CSP: Check <param> element values against the document's CSP before loading. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Async. Created 6 years, 11 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
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLPlugInElement.cpp
diff --git a/Source/core/html/HTMLPlugInElement.cpp b/Source/core/html/HTMLPlugInElement.cpp
index f2aaf0418bfc21ba56688e9ef998e4426212792f..0b2df23c31693eb216d32f4f308cd4248aba55c8 100644
--- a/Source/core/html/HTMLPlugInElement.cpp
+++ b/Source/core/html/HTMLPlugInElement.cpp
@@ -28,6 +28,7 @@
#include "bindings/v8/ScriptController.h"
#include "bindings/v8/npruntime_impl.h"
#include "core/dom/Document.h"
+#include "core/dom/Node.h"
#include "core/dom/PostAttachCallbacks.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
@@ -410,6 +411,8 @@ bool HTMLPlugInElement::requestObject(const String& url, const String& mimeType,
return false;
KURL completedURL = document().completeURL(url);
+ if (!pluginIsLoadable(completedURL, mimeType))
+ return false;
bool useFallback;
if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback))
@@ -429,9 +432,6 @@ bool HTMLPlugInElement::loadPlugin(const KURL& url, const String& mimeType, cons
if (!frame->loader().allowPlugins(AboutToInstantiatePlugin))
return false;
- if (!pluginIsLoadable(url, mimeType))
- return false;
-
RenderEmbeddedObject* renderer = renderEmbeddedObject();
// FIXME: This code should not depend on renderer!
if (!renderer || useFallback)
@@ -477,6 +477,14 @@ bool HTMLPlugInElement::shouldUsePlugin(const KURL& url, const String& mimeType,
}
+void HTMLPlugInElement::dispatchErrorEvent()
+{
+ if (document().isPluginDocument() && document().ownerElement())
+ document().ownerElement()->dispatchEvent(Event::create(EventTypeNames::error));
+ else
+ dispatchEvent(Event::create(EventTypeNames::error));
+}
+
bool HTMLPlugInElement::pluginIsLoadable(const KURL& url, const String& mimeType)
{
Frame* frame = document().frame();
« no previous file with comments | « Source/core/html/HTMLPlugInElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698