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

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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cc943a8fd88d95152bec7a04673322a6b0fb05b3..dfce5182a8173185557ecc8d4d5e719928dacb2c 100644
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
@@ -468,17 +468,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)
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698