Chromium Code Reviews

Unified Diff: src/runtime/runtime-promise.cc

Issue 2648873002: [inspector] added creation frame for async call chains for promises (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/runtime/runtime-promise.cc
diff --git a/src/runtime/runtime-promise.cc b/src/runtime/runtime-promise.cc
index 3335045d98fad839d4c0d794972bdf725612da0d..27870ab336749eaf81535a35b52c74295376edaa 100644
--- a/src/runtime/runtime-promise.cc
+++ b/src/runtime/runtime-promise.cc
@@ -204,6 +204,10 @@ RUNTIME_FUNCTION(Runtime_PromiseHookInit) {
CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, parent, 1);
isolate->RunPromiseHook(PromiseHookType::kInit, promise, parent);
+ if (isolate->debug()->is_active()) {
+ int id = isolate->debug()->NextAsyncTaskId(promise);
+ isolate->debug()->OnAsyncTaskEvent(debug::kDebugPromiseCreated, id);
+ }
return isolate->heap()->undefined_value();
}

Powered by Google App Engine