forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetwork_agent.h
50 lines (33 loc) · 1.35 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
#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;
namespace protocol {
class NetworkAgent : public Network::Backend {
public:
explicit NetworkAgent(NetworkInspector* inspector,
v8_inspector::V8Inspector* v8_inspector);
void Wire(UberDispatcher* dispatcher);
DispatchResponse enable() override;
DispatchResponse disable() override;
void emitNotification(const String& event,
std::unique_ptr<protocol::DictionaryValue> params);
void requestWillBeSent(std::unique_ptr<protocol::DictionaryValue> params);
void responseReceived(std::unique_ptr<protocol::DictionaryValue> params);
void loadingFailed(std::unique_ptr<protocol::DictionaryValue> params);
void loadingFinished(std::unique_ptr<protocol::DictionaryValue> params);
private:
NetworkInspector* inspector_;
v8_inspector::V8Inspector* v8_inspector_;
std::shared_ptr<Network::Frontend> frontend_;
using EventNotifier =
void (NetworkAgent::*)(std::unique_ptr<protocol::DictionaryValue>);
std::unordered_map<String, EventNotifier> event_notifier_map_;
};
} // namespace protocol
} // namespace inspector
} // namespace node
#endif // SRC_INSPECTOR_NETWORK_AGENT_H_