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

Unified Diff: src/debug/debug.cc

Issue 2626283002: [inspector] introduced debug::SetCompileEventListener (Closed)
Patch Set: rebased Created 3 years, 11 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-interface.h » ('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 6969c06a17d752797851f4d95dd68e49b1bfb9fc..6264f3d1fc6a561276973f08666929f96bad2732 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1866,6 +1866,13 @@ void Debug::SetAsyncTaskListener(debug::AsyncTaskListener listener,
UpdateState();
}
+void Debug::SetCompileEventListener(debug::CompileEventListener listener,
+ void* data) {
+ compile_event_listener_ = listener;
+ compile_event_listener_data_ = data;
+ UpdateState();
+}
+
void Debug::OnAsyncTaskEvent(debug::PromiseDebugActionType type, int id) {
if (in_debug_scope() || ignore_events()) return;
@@ -1967,6 +1974,16 @@ void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) {
script->type() != i::Script::TYPE_WASM) {
return;
}
+ if (compile_event_listener_) {
+ compile_event_listener_(ToApiHandle<debug::Script>(script),
+ event != v8::AfterCompile,
+ compile_event_listener_data_);
+ bool non_inspector_listener_exists =
+ message_handler_ != nullptr ||
jgruber 2017/01/16 19:26:32 Nit: Maybe it'd make sense to extract this to a me
kozy 2017/01/16 22:22:39 Done.
+ (event_listener_.is_null() && !event_listener_->IsForeign());
+ if (!non_inspector_listener_exists) return;
+ }
+
SuppressDebug while_processing(this);
bool in_nested_debug_scope = in_debug_scope();
@@ -2167,7 +2184,8 @@ void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) {
void Debug::UpdateState() {
bool is_active = message_handler_ != nullptr || !event_listener_.is_null() ||
- async_task_listener_ != nullptr;
+ async_task_listener_ != nullptr ||
+ compile_event_listener_ != nullptr;
if (is_active || in_debug_scope()) {
// Note that the debug context could have already been loaded to
// bootstrap test cases.
« no previous file with comments | « src/debug/debug.h ('k') | src/debug/debug-interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698