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

Unified Diff: src/debug/debug.cc

Issue 2415023002: [promises] Move async debug event creation to c++ (Closed)
Patch Set: rebase Created 4 years, 2 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/debug/debug.h ('k') | src/debug/debug.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 93fdd58273198aeec30cc8b0d42a35ae40e4b787..cedfbab85d5406553092c5160d452adaed7ef524 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1658,10 +1658,12 @@ MaybeHandle<Object> Debug::MakeCompileEvent(Handle<Script> script,
return CallFunction("MakeCompileEvent", arraysize(argv), argv);
}
-
-MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<JSObject> task_event) {
+MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<String> type,
+ Handle<Object> id,
+ Handle<String> name) {
+ DCHECK(id->IsNumber());
// Create the async task event object.
- Handle<Object> argv[] = { task_event };
+ Handle<Object> argv[] = {type, id, name};
return CallFunction("MakeAsyncTaskEvent", arraysize(argv), argv);
}
@@ -1781,8 +1783,9 @@ void Debug::OnAfterCompile(Handle<Script> script) {
ProcessCompileEvent(v8::AfterCompile, script);
}
-
-void Debug::OnAsyncTaskEvent(Handle<JSObject> data) {
+void Debug::OnAsyncTaskEvent(Handle<String> type, Handle<Object> id,
+ Handle<String> name) {
+ DCHECK(id->IsNumber());
if (in_debug_scope() || ignore_events()) return;
HandleScope scope(isolate_);
@@ -1792,7 +1795,7 @@ void Debug::OnAsyncTaskEvent(Handle<JSObject> data) {
// Create the script collected state object.
Handle<Object> event_data;
// Bail out and don't call debugger if exception.
- if (!MakeAsyncTaskEvent(data).ToHandle(&event_data)) return;
+ if (!MakeAsyncTaskEvent(type, id, name).ToHandle(&event_data)) return;
// Process debug event.
ProcessDebugEvent(v8::AsyncTaskEvent,
« no previous file with comments | « src/debug/debug.h ('k') | src/debug/debug.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698