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

Unified Diff: test/cctest/wasm/test-wasm-breakpoints.cc

Issue 2727393003: [debugger,api] deprecate everything in v8-debug.h (Closed)
Patch Set: remove TODO Created 3 years, 9 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 | « test/cctest/test-debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-wasm-breakpoints.cc
diff --git a/test/cctest/wasm/test-wasm-breakpoints.cc b/test/cctest/wasm/test-wasm-breakpoints.cc
index 1dc83b1c4b00eecbf20f36f31c51d306e126cd38..357f20f944222a3bee92860b50f780c6dccdba0b 100644
--- a/test/cctest/wasm/test-wasm-breakpoints.cc
+++ b/test/cctest/wasm/test-wasm-breakpoints.cc
@@ -54,7 +54,7 @@ void CheckLocationsFail(WasmCompiledModule *compiled_module,
CHECK(!success);
}
-class BreakHandler {
+class BreakHandler : public debug::DebugDelegate {
public:
enum Action {
Continue = StepAction::LastStepAction + 1,
@@ -72,18 +72,13 @@ class BreakHandler {
explicit BreakHandler(Isolate* isolate,
std::initializer_list<BreakPoint> expected_breaks)
: isolate_(isolate), expected_breaks_(expected_breaks) {
- current_handler = this;
- v8::Debug::SetDebugEventListener(reinterpret_cast<v8::Isolate*>(isolate),
- DebugEventListener);
+ v8::debug::SetDebugDelegate(reinterpret_cast<v8::Isolate*>(isolate_), this);
}
~BreakHandler() {
// Check that all expected breakpoints have been hit.
CHECK_EQ(count_, expected_breaks_.size());
- // BreakHandlers must be correctly stacked.
- CHECK_EQ(this, current_handler);
- current_handler = nullptr;
- v8::Debug::SetDebugEventListener(reinterpret_cast<v8::Isolate*>(isolate_),
- nullptr);
+ v8::debug::SetDebugDelegate(reinterpret_cast<v8::Isolate*>(isolate_),
+ nullptr);
}
int count() const { return count_; }
@@ -93,9 +88,9 @@ class BreakHandler {
int count_ = 0;
std::vector<BreakPoint> expected_breaks_;
- static BreakHandler* current_handler;
-
- void HandleBreak() {
+ void BreakProgramRequested(v8::Local<v8::Context> paused_context,
+ v8::Local<v8::Object> exec_state,
+ v8::Local<v8::Value> break_points_hit) override {
printf("Break #%d\n", count_);
CHECK_GT(expected_breaks_.size(), count_);
@@ -118,18 +113,8 @@ class BreakHandler {
}
++count_;
}
-
- static void DebugEventListener(const v8::Debug::EventDetails& event_details) {
- if (event_details.GetEvent() != v8::DebugEvent::Break) return;
-
- CHECK_NOT_NULL(current_handler);
- current_handler->HandleBreak();
- }
};
-// static
-BreakHandler* BreakHandler::current_handler = nullptr;
-
Handle<JSObject> MakeFakeBreakpoint(Isolate* isolate, int position) {
Handle<JSObject> obj =
isolate->factory()->NewJSObject(isolate->object_function());
« no previous file with comments | « test/cctest/test-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698