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

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

Issue 1804043002: Revert of Remove V8RecrusionScope, cleanup call sites. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/V8ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index de8a036d9f524a54370239529c3759fc281b69b9..51bc05d7fd9fc95f72e0411f9ed57381384dd7a5 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -29,6 +29,7 @@
#include "bindings/core/v8/ScriptStreamer.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8GCController.h"
+#include "bindings/core/v8/V8RecursionScope.h"
#include "bindings/core/v8/V8ThrowException.h"
#include "core/dom/ExecutionContext.h"
#include "core/fetch/CachedMetadata.h"
@@ -399,7 +400,7 @@
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
TRACE_EVENT1("v8", "v8.run", "fileName", TRACE_STR_COPY(*v8::String::Utf8Value(script->GetUnboundScript()->GetScriptName())));
- if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth)
+ if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth)
return throwStackOverflowExceptionIfNeeded(isolate);
RELEASE_ASSERT(!context->isIteratingOverObservers());
@@ -411,7 +412,7 @@
throwScriptForbiddenException(isolate);
return v8::MaybeLocal<v8::Value>();
}
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+ V8RecursionScope recursionScope(isolate);
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willExecuteScript(context, script->GetUnboundScript()->GetId());
result = script->Run(isolate->GetCurrentContext());
InspectorInstrumentation::didExecuteScript(cookie);
@@ -429,7 +430,7 @@
TRACE_EVENT0("v8", "v8.run");
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
+ V8RecursionScope::MicrotaskSuppression recursionScope(isolate);
v8::MaybeLocal<v8::Value> result = script->Run(isolate->GetCurrentContext());
crashIfIsolateIsDead(isolate);
return result;
@@ -439,7 +440,7 @@
{
TRACE_EVENT0("v8", "v8.run");
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
+ V8RecursionScope::MicrotaskSuppression recursionScope(isolate);
v8::MaybeLocal<v8::Value> result = script->Run(isolate->GetCurrentContext());
crashIfIsolateIsDead(isolate);
return result;
@@ -450,7 +451,7 @@
TRACE_EVENT1("devtools.timeline,v8", "FunctionCall", "data", devToolsTraceEventData(isolate, context, function));
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
- if (v8::MicrotasksScope::GetCurrentDepth(isolate) >= kMaxRecursionDepth)
+ if (V8RecursionScope::recursionLevel(isolate) >= kMaxRecursionDepth)
return v8::MaybeLocal<v8::Value>(throwStackOverflowExceptionIfNeeded(isolate));
RELEASE_ASSERT(!context->isIteratingOverObservers());
@@ -459,7 +460,7 @@
throwScriptForbiddenException(isolate);
return v8::MaybeLocal<v8::Value>();
}
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+ V8RecursionScope recursionScope(isolate);
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willExecuteScript(context, function->ScriptId());
v8::MaybeLocal<v8::Value> result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
crashIfIsolateIsDead(isolate);
@@ -471,7 +472,7 @@
{
TRACE_EVENT0("v8", "v8.callFunction");
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
+ V8RecursionScope::MicrotaskSuppression recursionScope(isolate);
v8::MaybeLocal<v8::Value> result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
crashIfIsolateIsDead(isolate);
return result;
@@ -482,7 +483,7 @@
TRACE_EVENT0("v8", "v8.newInstance");
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
+ V8RecursionScope::MicrotaskSuppression scope(isolate);
v8::MaybeLocal<v8::Object> result = objectTemplate->NewInstance(isolate->GetCurrentContext());
crashIfIsolateIsDead(isolate);
return result;
@@ -493,7 +494,7 @@
TRACE_EVENT0("v8", "v8.newInstance");
TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution");
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
+ V8RecursionScope::MicrotaskSuppression scope(isolate);
v8::MaybeLocal<v8::Object> result = function->NewInstance(isolate->GetCurrentContext(), argc, argv);
crashIfIsolateIsDead(isolate);
return result;
@@ -507,7 +508,7 @@
throwScriptForbiddenException(isolate);
return v8::MaybeLocal<v8::Object>();
}
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+ V8RecursionScope scope(isolate);
v8::MaybeLocal<v8::Object> result = function->NewInstance(isolate->GetCurrentContext(), argc, argv);
crashIfIsolateIsDead(isolate);
return result;
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8RecursionScope.cpp ('k') | third_party/WebKit/Source/bindings/core/v8/v8.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698