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

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

Issue 2642253005: [debugger api] remove legacy JSON debug protocol. (Closed)
Patch Set: fix cctest 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/wasm/wasm-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 d287606a50d87b2b503f99e78836aaa65d2545d1..68b85363fb551aea64e3728569effca1b8ff88e7 100644
--- a/test/cctest/wasm/test-wasm-breakpoints.cc
+++ b/test/cctest/wasm/test-wasm-breakpoints.cc
@@ -55,12 +55,14 @@ class BreakHandler {
public:
explicit BreakHandler(Isolate* isolate) : isolate_(isolate) {
current_handler = this;
- isolate->debug()->SetMessageHandler(&HandleMessage);
+ v8::Debug::SetDebugEventListener(reinterpret_cast<v8::Isolate*>(isolate),
+ DebugEventListener);
}
~BreakHandler() {
CHECK_EQ(this, current_handler);
current_handler = nullptr;
- isolate_->debug()->SetMessageHandler(nullptr);
+ v8::Debug::SetDebugEventListener(reinterpret_cast<v8::Isolate*>(isolate_),
+ nullptr);
}
int count() const { return count_; }
@@ -71,25 +73,14 @@ class BreakHandler {
static BreakHandler* current_handler;
- static void HandleMessage(const v8::Debug::Message& message) {
- // Ignore responses.
- if (!message.IsEvent()) return;
- // Ignore everything except break events.
- if (message.GetEvent() != v8::DebugEvent::Break) return;
+ static void DebugEventListener(const v8::Debug::EventDetails& event_details) {
+ if (event_details.GetEvent() != v8::DebugEvent::Break) return;
printf("break!\n");
CHECK_NOT_NULL(current_handler);
current_handler->count_ += 1;
// Don't run into an endless loop.
CHECK_GT(100, current_handler->count_);
-
- const char command[] = "{\"type\":\"request\", \"command\":\"continue\"}";
- uint16_t command_u16[arraysize(command) - 1];
- for (unsigned i = 0; i < arraysize(command) - 1; ++i) {
- command_u16[i] = command[i];
- }
- current_handler->isolate_->debug()->EnqueueCommandMessage(
- ArrayVector(command_u16), message.GetClientData());
}
};
« no previous file with comments | « src/wasm/wasm-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698