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