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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h

Issue 2516553002: Never resolve promises inside ScriptForbiddenScopes. (Closed)
Patch Set: Created 4 years, 1 month 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/ScriptPromiseResolver.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h
index a07e16d4494ed318ad780380a74845134ad4caf6..079fd6ddd1fb936cc823f6b1e5540b9b0d36af2c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h
@@ -12,6 +12,7 @@
#include "core/CoreExport.h"
#include "core/dom/ActiveDOMObject.h"
#include "core/dom/ExecutionContext.h"
+#include "platform/ScriptForbiddenScope.h"
#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "platform/heap/SelfKeepAlive.h"
@@ -135,6 +136,16 @@ class CORE_EXPORT ScriptPromiseResolver
keepAliveWhilePending();
return;
}
+ // TODO(esprehn): This is a hack, instead we should RELEASE_ASSERT that
+ // script is allowed, and v8 should be running the entry hooks below and
+ // crashing if script is forbidden. We should then audit all users of
+ // ScriptPromiseResolver and the related specs and switch to an async
+ // resolve.
+ // See: http://crbug.com/663476
+ if (ScriptForbiddenScope::isScriptForbidden()) {
+ m_timer.startOneShot(0, BLINK_FROM_HERE);
+ return;
+ }
resolveOrRejectImmediately();
}
« 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