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

Unified Diff: src/debug.cc

Issue 362783002: Introduce debug events for Microtask queue. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: addressed Created 6 years, 6 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.h ('k') | src/debug-debugger.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index 8eec14ae06adf988f59f8b3e8b8de37c6783ce8c..ca32957e50d349df93668243296d533eed85c612 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -2554,6 +2554,13 @@ MaybeHandle<Object> Debug::MakePromiseEvent(Handle<JSObject> event_data) {
}
+MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<JSObject> task_event) {
+ // Create the async task event object.
+ Handle<Object> argv[] = { task_event };
+ return MakeJSObject("MakeAsyncTaskEvent", ARRAY_SIZE(argv), argv);
+}
+
+
void Debug::OnException(Handle<Object> exception, bool uncaught) {
if (in_debug_scope() || ignore_events()) return;
@@ -2718,6 +2725,25 @@ void Debug::OnPromiseEvent(Handle<JSObject> data) {
}
+void Debug::OnAsyncTaskEvent(Handle<JSObject> data) {
+ if (in_debug_scope() || ignore_events()) return;
+
+ HandleScope scope(isolate_);
+ DebugScope debug_scope(this);
+ if (debug_scope.failed()) return;
+
+ // 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;
+
+ // Process debug event.
+ ProcessDebugEvent(v8::AsyncTaskEvent,
+ Handle<JSObject>::cast(event_data),
+ true);
+}
+
+
void Debug::ProcessDebugEvent(v8::DebugEvent event,
Handle<JSObject> event_data,
bool auto_continue) {
« no previous file with comments | « src/debug.h ('k') | src/debug-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698