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

Unified Diff: src/debug/debug.cc

Issue 2655253004: [inspector] introduced stepIntoAsync for chained callbacks (Closed)
Patch Set: added is_breakable into PromiseCreatedEvent Created 3 years, 11 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: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index bed6b12e864cabf740bf9447d45c0a309765cc83..944842adc1b1303e9603333be29d9dec0852276c 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -403,6 +403,7 @@ void Debug::ThreadInit() {
thread_local_.target_fp_ = 0;
thread_local_.return_value_ = Smi::kZero;
thread_local_.async_task_count_ = 0;
+ thread_local_.non_breakable_async_events_ = false;
clear_suspended_generator();
thread_local_.restart_fp_ = nullptr;
base::NoBarrier_Store(&thread_local_.current_debug_scope_,
@@ -1927,9 +1928,6 @@ void ResetPromiseHandle(const v8::WeakCallbackInfo<void>& info) {
// different stacks from direct Promise use, but we save and restore a
// stack once for all reactions.
//
-// If this isn't a case of async function, we return false, otherwise
-// we set the correct id and return true.
-//
// TODO(littledan): Improve this case.
int GetReferenceAsyncTaskId(Isolate* isolate, Handle<JSPromise> promise) {
Handle<Symbol> handled_by_symbol =
@@ -1958,11 +1956,12 @@ void Debug::RunPromiseHook(PromiseHookType type, Handle<JSPromise> promise,
int id = GetReferenceAsyncTaskId(isolate_, promise);
switch (type) {
case PromiseHookType::kInit:
- debug_delegate_->PromiseEventOccurred(
- debug::kDebugPromiseCreated, id,
+ debug_delegate_->PromiseCreatedEvent(
+ id,
parent->IsJSPromise() ? GetReferenceAsyncTaskId(
isolate_, Handle<JSPromise>::cast(parent))
- : 0);
+ : 0,
+ !thread_local_.non_breakable_async_events_);
return;
case PromiseHookType::kResolve:
// We can't use this hook because it's called before promise object will
@@ -2043,7 +2042,7 @@ void Debug::OnAsyncTaskEvent(debug::PromiseDebugActionType type, int id) {
if (in_debug_scope() || ignore_events()) return;
if (debug_delegate_) {
- debug_delegate_->PromiseEventOccurred(type, id, 0);
+ debug_delegate_->PromiseEventOccurred(type, id);
if (!non_inspector_listener_exists()) return;
}

Powered by Google App Engine
This is Rietveld 408576698