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

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

Issue 1690823003: Move ScriptForbiddenScope assert to isolate's BeforeCallEnteredCallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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 | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8RecursionScope.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
index faf17438cdf1345178461da631fb606fec60bd4a..7baff2fe98124552efbb5b6bb6ed8c9a2e6a1af7 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
@@ -34,6 +34,7 @@
#include "bindings/core/v8/V8ScriptRunner.h"
#include "core/frame/Deprecation.h"
#include "core/inspector/MainThreadDebugger.h"
+#include "platform/ScriptForbiddenScope.h"
#include "public/platform/Platform.h"
#include "wtf/LeakAnnotations.h"
#include "wtf/MainThread.h"
@@ -42,10 +43,15 @@ namespace blink {
static V8PerIsolateData* mainThreadPerIsolateData = 0;
+static void beforeCallEnteredCallback(v8::Isolate* isolate)
+{
+ RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden());
+}
+
#if ENABLE(ASSERT)
-static void assertV8RecursionScope()
+static void assertV8RecursionScope(v8::Isolate* isolate)
{
- ASSERT(V8RecursionScope::properlyUsed(v8::Isolate::GetCurrent()));
+ ASSERT(V8RecursionScope::properlyUsed(isolate));
}
static bool runningUnitTest()
@@ -151,6 +157,7 @@ V8PerIsolateData::V8PerIsolateData()
if (!runningUnitTest())
isolate()->AddCallCompletedCallback(&assertV8RecursionScope);
#endif
+ isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback);
if (isMainThread())
mainThreadPerIsolateData = this;
isolate()->SetUseCounterCallback(&useCounterCallback);
@@ -210,6 +217,7 @@ void V8PerIsolateData::destroy(v8::Isolate* isolate)
if (!runningUnitTest())
isolate->RemoveCallCompletedCallback(&assertV8RecursionScope);
#endif
+ isolate->RemoveBeforeCallEnteredCallback(&beforeCallEnteredCallback);
V8PerIsolateData* data = from(isolate);
// Clear everything before exiting the Isolate.
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8RecursionScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698