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

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

Issue 2682593003: [debugger] implement legacy debug event listeners via debug delegate. (Closed)
Patch Set: addressed comments Created 3 years, 10 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-debugger.cc ('k') | src/runtime/runtime-promise.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index a1ca5580718f0c979b974483a9ffafed07f725d6..8dfec1dfa3c2a0682f5ead255e12e29bd19d5f9c 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -79,8 +79,13 @@ RUNTIME_FUNCTION(Runtime_SetDebugEventListener) {
CHECK(args[0]->IsJSFunction() || args[0]->IsNullOrUndefined(isolate));
CONVERT_ARG_HANDLE_CHECKED(Object, callback, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, data, 1);
- isolate->debug()->SetEventListener(callback, data);
-
+ if (callback->IsJSFunction()) {
+ JavaScriptDebugDelegate* delegate = new JavaScriptDebugDelegate(
+ isolate, Handle<JSFunction>::cast(callback), data);
+ isolate->debug()->SetDebugDelegate(delegate, true);
+ } else {
+ isolate->debug()->SetDebugDelegate(nullptr, false);
+ }
return isolate->heap()->undefined_value();
}
@@ -1853,7 +1858,7 @@ RUNTIME_FUNCTION(Runtime_DebugAsyncFunctionPromiseCreated) {
JSObject::SetProperty(promise, async_stack_id_symbol,
handle(Smi::FromInt(id), isolate), STRICT)
.Assert();
- isolate->debug()->OnAsyncTaskEvent(debug::kDebugEnqueueAsyncFunction, id);
+ isolate->debug()->OnAsyncTaskEvent(debug::kDebugEnqueueAsyncFunction, id, 0);
return isolate->heap()->undefined_value();
}
@@ -1876,7 +1881,7 @@ RUNTIME_FUNCTION(Runtime_DebugAsyncEventEnqueueRecurring) {
isolate->debug()->OnAsyncTaskEvent(
status == v8::Promise::kFulfilled ? debug::kDebugEnqueuePromiseResolve
: debug::kDebugEnqueuePromiseReject,
- isolate->debug()->NextAsyncTaskId(promise));
+ isolate->debug()->NextAsyncTaskId(promise), 0);
}
return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/inspector/v8-debugger.cc ('k') | src/runtime/runtime-promise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698