OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef WEBKIT_GLUE_DEVTOOLS_NET_AGENT_H_ | |
6 #define WEBKIT_GLUE_DEVTOOLS_NET_AGENT_H_ | |
7 | |
8 #include "webkit/glue/devtools/devtools_rpc.h" | |
9 | |
10 // NetAgent is a utility object that covers network-related functionality of the | |
11 // WebDevToolsAgent. It is capable of sniffing network calls and passing the | |
12 // HTTPRequest-related data to the client. | |
13 // NetAgent's environment is represented with the NetAgentDelegate interface. | |
14 #define NET_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4) \ | |
15 /* Requests that the agent sends content of the resource with given id to the | |
16 delegate. */ \ | |
17 METHOD3(GetResourceContent, int /* call_id */, int /* identifier */, \ | |
18 String /* url */) | |
19 | |
20 DEFINE_RPC_CLASS(NetAgent, NET_AGENT_STRUCT) | |
21 | |
22 #define NET_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, \ | |
23 METHOD4) \ | |
24 /* Notifies the delegate that a request is about to be sent out. */ \ | |
25 METHOD2(WillSendRequest, int, Value) \ | |
26 \ | |
27 /* Notifies the delegate that response has been received. */ \ | |
28 METHOD2(DidReceiveResponse, int /* identifier */, Value /* request */) \ | |
29 \ | |
30 /* Notifies the delegate that resource loading has been finished with no | |
31 errors */ \ | |
32 METHOD2(DidFinishLoading, int /* identifier */, Value /* response */) \ | |
33 \ | |
34 /* Response to the async call. */ \ | |
35 METHOD2(GetResourceContentResult, int /* call_id */, std::string /* content */
) | |
36 | |
37 DEFINE_RPC_CLASS(NetAgentDelegate, NET_AGENT_DELEGATE_STRUCT) | |
38 | |
39 #endif // WEBKIT_GLUE_DEVTOOLS_NET_AGENT_H_ | |
OLD | NEW |