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

Unified Diff: src/inspector/v8-runtime-agent-impl.cc

Issue 2748503002: [inspector] changed a way of preserving stepping between tasks (Closed)
Patch Set: rebased on tunned stepping at return Created 3 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
« no previous file with comments | « src/inspector/v8-inspector-impl.cc ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-runtime-agent-impl.cc
diff --git a/src/inspector/v8-runtime-agent-impl.cc b/src/inspector/v8-runtime-agent-impl.cc
index 7d8c246e7f50be06bd34ec1e6ee9c90bfacf33b9..9b4944aa575ceacb14f4b0367540662b4c127d75 100644
--- a/src/inspector/v8-runtime-agent-impl.cc
+++ b/src/inspector/v8-runtime-agent-impl.cc
@@ -297,7 +297,9 @@ void V8RuntimeAgentImpl::evaluate(
v8::Local<v8::Script> script;
if (m_inspector->compileScript(scope.context(), expression, String16())
.ToLocal(&script)) {
- maybeResultValue = m_inspector->runCompiledScript(scope.context(), script);
+ v8::MicrotasksScope microtasksScope(m_inspector->isolate(),
+ v8::MicrotasksScope::kRunMicrotasks);
+ maybeResultValue = script->Run(scope.context());
}
if (evalIsDisabled) scope.context()->AllowCodeGenerationFromStrings(false);
@@ -385,8 +387,9 @@ void V8RuntimeAgentImpl::callFunctionOn(
if (m_inspector
->compileScript(scope.context(), "(" + expression + ")", String16())
.ToLocal(&functionScript)) {
- maybeFunctionValue =
- m_inspector->runCompiledScript(scope.context(), functionScript);
+ v8::MicrotasksScope microtasksScope(m_inspector->isolate(),
+ v8::MicrotasksScope::kRunMicrotasks);
+ maybeFunctionValue = functionScript->Run(scope.context());
}
// Re-initialize after running client's code, as it could have destroyed
// context or session.
@@ -411,9 +414,13 @@ void V8RuntimeAgentImpl::callFunctionOn(
return;
}
- v8::MaybeLocal<v8::Value> maybeResultValue = m_inspector->callFunction(
- functionValue.As<v8::Function>(), scope.context(), scope.object(), argc,
- argv.get());
+ v8::MaybeLocal<v8::Value> maybeResultValue;
+ {
+ v8::MicrotasksScope microtasksScope(m_inspector->isolate(),
+ v8::MicrotasksScope::kRunMicrotasks);
+ maybeResultValue = functionValue.As<v8::Function>()->Call(
+ scope.context(), scope.object(), argc, argv.get());
+ }
// Re-initialize after running client's code, as it could have destroyed
// context or session.
response = scope.initialize();
@@ -620,8 +627,12 @@ void V8RuntimeAgentImpl::runScript(
if (includeCommandLineAPI.fromMaybe(false)) scope.installCommandLineAPI();
- v8::MaybeLocal<v8::Value> maybeResultValue =
- m_inspector->runCompiledScript(scope.context(), script);
+ v8::MaybeLocal<v8::Value> maybeResultValue;
+ {
+ v8::MicrotasksScope microtasksScope(m_inspector->isolate(),
+ v8::MicrotasksScope::kRunMicrotasks);
+ maybeResultValue = script->Run(scope.context());
+ }
// Re-initialize after running client's code, as it could have destroyed
// context or session.
« no previous file with comments | « src/inspector/v8-inspector-impl.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698