-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
/
Copy pathnetwork_agent.h
52 lines (36 loc) · 1.59 KB
/
network_agent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef SRC_INSPECTOR_NETWORK_AGENT_H_
#define SRC_INSPECTOR_NETWORK_AGENT_H_
#include "node/inspector/protocol/Network.h"
#include <unordered_map>
namespace node {
namespace inspector {
class NetworkInspector;
class NetworkAgent : public protocol::Network::Backend {
public:
explicit NetworkAgent(NetworkInspector* inspector,
v8_inspector::V8Inspector* v8_inspector);
void Wire(protocol::UberDispatcher* dispatcher);
protocol::DispatchResponse enable() override;
protocol::DispatchResponse disable() override;
void emitNotification(v8::Local<v8::Context> context,
const protocol::String& event,
v8::Local<v8::Object> params);
void requestWillBeSent(v8::Local<v8::Context> context,
v8::Local<v8::Object> params);
void responseReceived(v8::Local<v8::Context> context,
v8::Local<v8::Object> params);
void loadingFailed(v8::Local<v8::Context> context,
v8::Local<v8::Object> params);
void loadingFinished(v8::Local<v8::Context> context,
v8::Local<v8::Object> params);
private:
NetworkInspector* inspector_;
v8_inspector::V8Inspector* v8_inspector_;
std::shared_ptr<protocol::Network::Frontend> frontend_;
using EventNotifier = void (NetworkAgent::*)(v8::Local<v8::Context> context,
v8::Local<v8::Object>);
std::unordered_map<protocol::String, EventNotifier> event_notifier_map_;
};
} // namespace inspector
} // namespace node
#endif // SRC_INSPECTOR_NETWORK_AGENT_H_