1#include "runtime_agent.h" 2 3#include "env-inl.h" 4#include "inspector_agent.h" 5 6namespace node { 7namespace inspector { 8namespace protocol { 9 10RuntimeAgent::RuntimeAgent() 11 : notify_when_waiting_for_disconnect_(false) {} 12 13void RuntimeAgent::Wire(UberDispatcher* dispatcher) { 14 frontend_ = std::make_unique<NodeRuntime::Frontend>(dispatcher->channel()); 15 NodeRuntime::Dispatcher::wire(dispatcher, this); 16} 17 18DispatchResponse RuntimeAgent::notifyWhenWaitingForDisconnect(bool enabled) { 19 notify_when_waiting_for_disconnect_ = enabled; 20 return DispatchResponse::OK(); 21} 22 23bool RuntimeAgent::notifyWaitingForDisconnect() { 24 if (notify_when_waiting_for_disconnect_) { 25 frontend_->waitingForDisconnect(); 26 return true; 27 } 28 return false; 29} 30} // namespace protocol 31} // namespace inspector 32} // namespace node 33