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

Unified Diff: src/debug/debug.cc

Issue 2606093002: [promises] Refactor debug code (Closed)
Patch Set: fix stuff Created 3 years, 12 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 4a33f3625a178ecad0cc5d49f12543e0558d595a..39f21f55980a0d4efb5933d5a7481518c6205bf3 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1656,9 +1656,8 @@ MaybeHandle<Object> Debug::MakeCompileEvent(Handle<Script> script,
return CallFunction("MakeCompileEvent", arraysize(argv), argv);
}
-MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<String> type,
- Handle<Object> id,
- Handle<String> name) {
+MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<Smi> type, Handle<Smi> id,
+ Handle<Smi> name) {
DCHECK(id->IsNumber());
// Create the async task event object.
Handle<Object> argv[] = {type, id, name};
@@ -1779,9 +1778,8 @@ void Debug::OnAfterCompile(Handle<Script> script) {
ProcessCompileEvent(v8::AfterCompile, script);
}
-void Debug::OnAsyncTaskEvent(Handle<String> type, Handle<Object> id,
- Handle<String> name) {
- DCHECK(id->IsNumber());
+void Debug::OnAsyncTaskEvent(PromiseDebugActionType type, int id,
+ PromiseDebugActionName name) {
if (in_debug_scope() || ignore_events()) return;
HandleScope scope(isolate_);
@@ -1791,7 +1789,11 @@ void Debug::OnAsyncTaskEvent(Handle<String> type, Handle<Object> id,
// Create the script collected state object.
Handle<Object> event_data;
// Bail out and don't call debugger if exception.
- if (!MakeAsyncTaskEvent(type, id, name).ToHandle(&event_data)) return;
+ if (!MakeAsyncTaskEvent(handle(Smi::FromInt(type), isolate_),
+ handle(Smi::FromInt(id), isolate_),
+ handle(Smi::FromInt(name), isolate_))
+ .ToHandle(&event_data))
+ return;
// Process debug event.
ProcessDebugEvent(v8::AsyncTaskEvent, Handle<JSObject>::cast(event_data),
« 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