OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_ |
6 #define COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_ | 6 #define COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 ~DevToolsAgentImpl() override; | 31 ~DevToolsAgentImpl() override; |
32 | 32 |
33 void BindToRequest(mojo::InterfaceRequest<DevToolsAgent> request); | 33 void BindToRequest(mojo::InterfaceRequest<DevToolsAgent> request); |
34 | 34 |
35 private: | 35 private: |
36 // devtools_service::DevToolsAgent implementation. | 36 // devtools_service::DevToolsAgent implementation. |
37 void SetClient(devtools_service::DevToolsAgentClientPtr client) override; | 37 void SetClient(devtools_service::DevToolsAgentClientPtr client) override; |
38 void DispatchProtocolMessage(const mojo::String& message) override; | 38 void DispatchProtocolMessage(const mojo::String& message) override; |
39 | 39 |
40 // blink::WebDevToolsAgentClient implementation. | 40 // blink::WebDevToolsAgentClient implementation. |
41 void sendProtocolMessage(int call_id, | 41 void sendProtocolMessage(int session_id, |
| 42 int call_id, |
42 const blink::WebString& response, | 43 const blink::WebString& response, |
43 const blink::WebString& state); | 44 const blink::WebString& state); |
44 | 45 |
45 void OnConnectionError(); | 46 void OnConnectionError(); |
46 | 47 |
47 blink::WebLocalFrame* const frame_; | 48 blink::WebLocalFrame* const frame_; |
48 const std::string id_; | 49 const std::string id_; |
49 | 50 |
50 mojo::Binding<DevToolsAgent> binding_; | 51 mojo::Binding<DevToolsAgent> binding_; |
51 devtools_service::DevToolsAgentClientPtr client_; | 52 devtools_service::DevToolsAgentClientPtr client_; |
52 | 53 |
53 // If we restore the agent's internal state using serialized state data from a | 54 // If we restore the agent's internal state using serialized state data from a |
54 // previous agent, the agent may generate messages before |client_| is set. | 55 // previous agent, the agent may generate messages before |client_| is set. |
55 // In that case, we need to cache messages for the client. | 56 // In that case, we need to cache messages for the client. |
56 bool cache_until_client_ready_; | 57 bool cache_until_client_ready_; |
57 | 58 |
58 struct CachedClientMessage { | 59 struct CachedClientMessage { |
59 int call_id; | 60 int call_id; |
60 mojo::String response; | 61 mojo::String response; |
61 mojo::String state; | 62 mojo::String state; |
62 }; | 63 }; |
63 std::vector<CachedClientMessage> cached_client_messages_; | 64 std::vector<CachedClientMessage> cached_client_messages_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentImpl); | 66 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentImpl); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace html_viewer | 69 } // namespace html_viewer |
69 | 70 |
70 #endif // COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_ | 71 #endif // COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_ |
OLD | NEW |