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

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

Issue 2423623002: Don't run handleEvent getter in V8EventListener::getListenerFunction if script is forbidden. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp
index fa788f05a87ee8719f83a883275ee539675bb84e..9acda710530f48c82a190e91d02430a41fcd750f 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp
@@ -62,6 +62,12 @@ v8::Local<v8::Function> V8EventListener::getListenerFunction(
if (isAttribute())
return v8::Local<v8::Function>();
+ // Getting the handleEvent property can runs script in the getter.
+ if (ScriptForbiddenScope::isScriptForbidden()) {
+ V8ThrowException::throwError(isolate(), "Script execution is forbidden.");
+ return v8::Local<v8::Function>();
+ }
+
if (listener->IsObject()) {
// Check that no exceptions were thrown when getting the
// handleEvent property and that the value is a function.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698