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

Unified Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 2436003002: CSP: Add 'script-sample' to violation reports. (Closed)
Patch Set: Rebase. Created 3 years, 10 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/web/WebPluginContainerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
index 13137450a7607b6a13a482ad6800cc33154b1ff5..bb37d8da8f989ead6de4a7adeec3d402b8a5e91c 100644
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
@@ -467,17 +467,17 @@ WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url,
if (!frame)
return WebString();
- if (!m_element->document().contentSecurityPolicy()->allowJavaScriptURLs(
- m_element, m_element->document().url(), OrdinalNumber())) {
- return WebString();
- }
-
const KURL& kurl = url;
DCHECK(kurl.protocolIs("javascript"));
String script = decodeURLEscapeSequences(
kurl.getString().substring(strlen("javascript:")));
+ if (!m_element->document().contentSecurityPolicy()->allowJavaScriptURLs(
+ m_element, script, m_element->document().url(), OrdinalNumber())) {
+ return WebString();
+ }
+
UserGestureIndicator gestureIndicator(
popupsAllowed ? DocumentUserGestureToken::create(
frame->document(), UserGestureToken::NewGesture)

Powered by Google App Engine
This is Rietveld 408576698