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

Unified Diff: src/api.cc

Issue 2682593003: [debugger] implement legacy debug event listeners via debug delegate. (Closed)
Patch Set: addressed comments Created 3 years, 10 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 | « no previous file | src/debug/debug.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 6accad7747ac917a0d39419ca60c3492b41ae73e..b6a8a52591ecfb150fbec3ed1e376cf5e8ed146d 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -8912,11 +8912,15 @@ bool Debug::SetDebugEventListener(Isolate* isolate, EventCallback that,
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
ENTER_V8(i_isolate);
i::HandleScope scope(i_isolate);
- i::Handle<i::Object> foreign = i_isolate->factory()->undefined_value();
- if (that != NULL) {
- foreign = i_isolate->factory()->NewForeign(FUNCTION_ADDR(that));
+ if (that == nullptr) {
+ i_isolate->debug()->SetDebugDelegate(nullptr, false);
+ } else {
+ i::Handle<i::Object> i_data = i_isolate->factory()->undefined_value();
+ if (!data.IsEmpty()) i_data = Utils::OpenHandle(*data);
+ i::NativeDebugDelegate* delegate =
+ new i::NativeDebugDelegate(i_isolate, that, i_data);
+ i_isolate->debug()->SetDebugDelegate(delegate, true);
}
- i_isolate->debug()->SetEventListener(foreign, Utils::OpenHandle(*data, true));
return true;
}
@@ -9369,7 +9373,7 @@ void debug::SetDebugDelegate(Isolate* v8_isolate,
debug::DebugDelegate* delegate) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8(isolate);
- isolate->debug()->SetDebugDelegate(delegate);
+ isolate->debug()->SetDebugDelegate(delegate, false);
}
void debug::ResetBlackboxedStateCache(Isolate* v8_isolate,
« no previous file with comments | « no previous file | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698