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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2421473004: CSP: Fire 'SecurityPolicyViolation' on the offending element. (Closed)
Patch Set: Test. Created 4 years, 2 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/bindings/core/v8/ScriptController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
index 3f4d6b33e573d7ba9b44cedc90a9d22e4a78f319..c32e0ed4a57cc677b02865580e13470ff555c45d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
@@ -331,7 +331,8 @@ bool ScriptController::canExecuteScripts(
return allowed;
}
-bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) {
+bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url,
+ Element* element) {
if (!protocolIsJavaScript(url))
return false;
@@ -340,8 +341,10 @@ bool ScriptController::executeScriptIfJavaScriptURL(const KURL& url) {
if (!frame()->page() ||
(!shouldBypassMainWorldContentSecurityPolicy &&
!frame()->document()->contentSecurityPolicy()->allowJavaScriptURLs(
- frame()->document()->url(), eventHandlerPosition().m_line)))
+ element, frame()->document()->url(),
+ eventHandlerPosition().m_line))) {
return true;
+ }
bool progressNotificationsNeeded =
frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() &&
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptController.h ('k') | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698