OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_CHILD_SHARED_WORKER_DEVTOOLS_AGENT_H_ | 5 #ifndef CONTENT_CHILD_SHARED_WORKER_DEVTOOLS_AGENT_H_ |
6 #define CONTENT_CHILD_SHARED_WORKER_DEVTOOLS_AGENT_H_ | 6 #define CONTENT_CHILD_SHARED_WORKER_DEVTOOLS_AGENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 | 11 |
12 namespace IPC { | 12 namespace IPC { |
13 class Message; | 13 class Message; |
14 } | 14 } |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 class WebSharedWorker; | 17 class WebSharedWorker; |
18 class WebString; | 18 class WebString; |
19 } | 19 } |
20 | 20 |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 class SharedWorkerDevToolsAgent { | 23 class SharedWorkerDevToolsAgent { |
24 public: | 24 public: |
25 SharedWorkerDevToolsAgent(int route_id, blink::WebSharedWorker*); | 25 SharedWorkerDevToolsAgent(int route_id, blink::WebSharedWorker*); |
26 ~SharedWorkerDevToolsAgent(); | 26 ~SharedWorkerDevToolsAgent(); |
27 | 27 |
28 // Called on the Worker thread. | 28 // Called on the Worker thread. |
29 bool OnMessageReceived(const IPC::Message& message); | 29 bool OnMessageReceived(const IPC::Message& message); |
30 void SendDevToolsMessage(int session_id, | 30 void SendDevToolsMessage(int call_id, |
31 int call_id, | |
32 const blink::WebString& message, | 31 const blink::WebString& message, |
33 const blink::WebString& post_state); | 32 const blink::WebString& post_state); |
34 | 33 |
35 private: | 34 private: |
36 void OnAttach(const std::string& host_id, int session_id); | 35 void OnAttach(const std::string& host_id); |
37 void OnReattach(const std::string& host_id, | 36 void OnReattach(const std::string& host_id, const std::string& state); |
38 int session_id, | |
39 const std::string& state); | |
40 void OnDetach(); | 37 void OnDetach(); |
41 void OnDispatchOnInspectorBackend(int session_id, const std::string& message); | 38 void OnDispatchOnInspectorBackend(const std::string& message); |
42 | 39 |
43 bool Send(IPC::Message* message); | 40 bool Send(IPC::Message* message); |
44 const int route_id_; | 41 const int route_id_; |
45 blink::WebSharedWorker* webworker_; | 42 blink::WebSharedWorker* webworker_; |
46 | 43 |
47 DISALLOW_COPY_AND_ASSIGN(SharedWorkerDevToolsAgent); | 44 DISALLOW_COPY_AND_ASSIGN(SharedWorkerDevToolsAgent); |
48 }; | 45 }; |
49 | 46 |
50 } // namespace content | 47 } // namespace content |
51 | 48 |
52 #endif // CONTENT_CHILD_SHARED_WORKER_DEVTOOLS_AGENT_H_ | 49 #endif // CONTENT_CHILD_SHARED_WORKER_DEVTOOLS_AGENT_H_ |
OLD | NEW |