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

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

Issue 2331363002: DevTools: Do not include RunMicrotasks event into FunctionCall. (Closed)
Patch Set: Created 4 years, 3 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-misc/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 311192bcbc5e4fe07b5f9b02731b0d5c10884601..234401f19715e6bc77bd50e2461724acd65a5480 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -472,16 +472,11 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callAsConstructor(v8::Isolate* isolate
if (!depth)
TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", InspectorFunctionCallEvent::data(context, function));
- 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 = constructor->CallAsConstructor(isolate->GetCurrentContext(), argc, argv);
- crashIfIsolateIsDead(isolate);
- ThreadDebugger::didExecuteScript(isolate);
- }
+ v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+ ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
+ v8::MaybeLocal<v8::Value> result = constructor->CallAsConstructor(isolate->GetCurrentContext(), argc, argv);
+ crashIfIsolateIsDead(isolate);
+ ThreadDebugger::didExecuteScript(isolate);
if (!depth)
TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
return result;
@@ -506,18 +501,13 @@ 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::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);
- InspectorInstrumentation::willExecuteScript(context);
- ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
- result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
- crashIfIsolateIsDead(isolate);
- ThreadDebugger::didExecuteScript(isolate);
- InspectorInstrumentation::didExecuteScript(context);
- }
+ v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+ InspectorInstrumentation::willExecuteScript(context);
+ ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
+ v8::MaybeLocal<v8::Value> result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
+ crashIfIsolateIsDead(isolate);
+ ThreadDebugger::didExecuteScript(isolate);
+ InspectorInstrumentation::didExecuteScript(context);
if (!depth)
TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
return result;
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/tracing/timeline-misc/timeline-receive-response-event-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698