@@ -237,7 +237,7 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
237
237
worker_agent_.reset (); // Dispose before the dispatchers
238
238
}
239
239
240
- std::string dispatchProtocolMessage (const StringView& message) {
240
+ void dispatchProtocolMessage (const StringView& message) {
241
241
std::string raw_message = protocol::StringUtil::StringViewToUtf8 (message);
242
242
std::unique_ptr<protocol::DictionaryValue> value =
243
243
protocol::DictionaryValue::cast (protocol::StringUtil::parseMessage (
@@ -252,7 +252,6 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
252
252
node_dispatcher_->dispatch (call_id, method, std::move (value),
253
253
raw_message);
254
254
}
255
- return method;
256
255
}
257
256
258
257
void schedulePauseOnNextStatement (const std::string& reason) {
@@ -494,9 +493,12 @@ class NodeInspectorClient : public V8InspectorClient {
494
493
waiting_for_resume_ = false ;
495
494
}
496
495
496
+ void runIfWaitingForDebugger (int context_group_id) override {
497
+ waiting_for_frontend_ = false ;
498
+ }
499
+
497
500
int connectFrontend (std::unique_ptr<InspectorSessionDelegate> delegate,
498
501
bool prevent_shutdown) {
499
- events_dispatched_ = true ;
500
502
int session_id = next_session_id_++;
501
503
channels_[session_id] = std::make_unique<ChannelImpl>(env_,
502
504
client_,
@@ -508,16 +510,11 @@ class NodeInspectorClient : public V8InspectorClient {
508
510
}
509
511
510
512
void disconnectFrontend (int session_id) {
511
- events_dispatched_ = true ;
512
513
channels_.erase (session_id);
513
514
}
514
515
515
516
void dispatchMessageFromFrontend (int session_id, const StringView& message) {
516
- events_dispatched_ = true ;
517
- std::string method =
518
- channels_[session_id]->dispatchProtocolMessage (message);
519
- if (waiting_for_frontend_)
520
- waiting_for_frontend_ = method != " Runtime.runIfWaitingForDebugger" ;
517
+ channels_[session_id]->dispatchProtocolMessage (message);
521
518
}
522
519
523
520
Local<Context> ensureDefaultContextInGroup (int contextGroupId) override {
@@ -678,7 +675,6 @@ class NodeInspectorClient : public V8InspectorClient {
678
675
std::unordered_map<int , std::unique_ptr<ChannelImpl>> channels_;
679
676
std::unordered_map<void *, InspectorTimerHandle> timers_;
680
677
int next_session_id_ = 1 ;
681
- bool events_dispatched_ = false ;
682
678
bool waiting_for_resume_ = false ;
683
679
bool waiting_for_frontend_ = false ;
684
680
bool waiting_for_io_shutdown_ = false ;
0 commit comments