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

Unified Diff: src/debug/debug.cc

Issue 2415023002: [promises] Move async debug event creation to c++ (Closed)
Patch Set: use consts 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
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 93fdd58273198aeec30cc8b0d42a35ae40e4b787..af0431ad18a416308f081494230354f1eb2113b4 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1658,10 +1658,11 @@ 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<Object> type,
+ Handle<Object> id,
+ Handle<Object> name) {
// 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 +1782,8 @@ void Debug::OnAfterCompile(Handle<Script> script) {
ProcessCompileEvent(v8::AfterCompile, script);
}
-
-void Debug::OnAsyncTaskEvent(Handle<JSObject> data) {
+void Debug::OnAsyncTaskEvent(Handle<Object> type, Handle<Object> id,
+ Handle<Object> name) {
adamk 2016/10/13 15:59:10 And then you can add a DCHECK(id->IsNumber()) here
gsathya 2016/10/13 21:27:30 Done.
if (in_debug_scope() || ignore_events()) return;
HandleScope scope(isolate_);
@@ -1792,7 +1793,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,

Powered by Google App Engine
This is Rietveld 408576698