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

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

Issue 1978103002: DevTools: Make timeline show the JS stacks for microtasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update the test. Created 4 years, 7 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 | « third_party/WebKit/LayoutTests/inspector/tracing/timeline-receive-response-event-expected.txt ('k') | 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/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 ccd7a6f1f3efd7f276404ceecb5153aba848bd6e..6117ad46d8f0acfdf01748eeb04666b91d31ad83 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -458,11 +458,16 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callFunction(v8::Local<v8::Function> f
}
if (!depth)
TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", InspectorFunctionCallEvent::data(context, function));
- v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
- ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
- v8::MaybeLocal<v8::Value> result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
- crashIfIsolateIsDead(isolate);
- ThreadDebugger::didExecuteScript(isolate);
+ v8::MaybeLocal<v8::Value> result;
+ {
+ // Create an extra block so FunctionCall trace event end phase is recorded after
+ // v8::MicrotasksScope destructor, as the latter is running microtasks.
+ v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+ ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
+ result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
+ crashIfIsolateIsDead(isolate);
+ ThreadDebugger::didExecuteScript(isolate);
+ }
if (!depth)
TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
return result;
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/tracing/timeline-receive-response-event-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698