OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_RENDERER_DEVTOOLS_AGENT_H_ | 5 #ifndef CHROME_RENDERER_DEVTOOLS_AGENT_H_ |
6 #define CHROME_RENDERER_DEVTOOLS_AGENT_H_ | 6 #define CHROME_RENDERER_DEVTOOLS_AGENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "chrome/common/devtools_messages.h" | 13 #include "chrome/common/devtools_messages.h" |
| 14 #include "ipc/ipc_channel.h" |
14 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgentClient.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgentClient.h" |
15 | 16 |
16 namespace IPC { | |
17 class Message; | |
18 } | |
19 | |
20 namespace WebKit { | 17 namespace WebKit { |
21 class WebDevToolsAgent; | 18 class WebDevToolsAgent; |
22 } | 19 } |
23 | 20 |
24 class RenderView; | 21 class RenderView; |
25 struct DevToolsMessageData; | 22 struct DevToolsMessageData; |
26 | 23 |
27 // DevToolsAgent belongs to the inspectable RenderView and provides Glue's | 24 // DevToolsAgent belongs to the inspectable RenderView and provides Glue's |
28 // agents with the communication capabilities. All messages from/to Glue's | 25 // agents with the communication capabilities. All messages from/to Glue's |
29 // agents infrastructure are flowing through this comminucation agent. | 26 // agents infrastructure are flowing through this comminucation agent. |
30 // There is a corresponding DevToolsClient object on the client side. | 27 // There is a corresponding DevToolsClient object on the client side. |
31 class DevToolsAgent : public WebKit::WebDevToolsAgentClient { | 28 class DevToolsAgent : public WebKit::WebDevToolsAgentClient, |
| 29 public IPC::Channel::Listener { |
32 public: | 30 public: |
33 DevToolsAgent(int routing_id, RenderView* view); | 31 DevToolsAgent(int routing_id, RenderView* view); |
34 virtual ~DevToolsAgent(); | 32 virtual ~DevToolsAgent(); |
35 | 33 |
36 void OnNavigate(); | 34 void OnNavigate(); |
37 | 35 |
38 // IPC message interceptor. Called on the Render thread. | 36 // IPC::Channel::Listener implementation. |
39 virtual bool OnMessageReceived(const IPC::Message& message); | 37 virtual bool OnMessageReceived(const IPC::Message& message); |
40 | 38 |
41 // WebDevToolsAgentClient implementation | 39 // WebDevToolsAgentClient implementation |
42 virtual void sendMessageToInspectorFrontend(const WebKit::WebString& data); | 40 virtual void sendMessageToInspectorFrontend(const WebKit::WebString& data); |
43 virtual void sendDebuggerOutput(const WebKit::WebString& data); | 41 virtual void sendDebuggerOutput(const WebKit::WebString& data); |
44 virtual void sendDispatchToAPU(const WebKit::WebString& data); | 42 virtual void sendDispatchToAPU(const WebKit::WebString& data); |
45 | 43 |
46 virtual int hostIdentifier(); | 44 virtual int hostIdentifier(); |
47 virtual void runtimeFeatureStateChanged(const WebKit::WebString& feature, | 45 virtual void runtimeFeatureStateChanged(const WebKit::WebString& feature, |
48 bool enabled); | 46 bool enabled); |
(...skipping 24 matching lines...) Expand all Loading... |
73 static std::map<int, DevToolsAgent*> agent_for_routing_id_; | 71 static std::map<int, DevToolsAgent*> agent_for_routing_id_; |
74 | 72 |
75 int routing_id_; // View routing id that we can access from IO thread. | 73 int routing_id_; // View routing id that we can access from IO thread. |
76 RenderView* render_view_; | 74 RenderView* render_view_; |
77 bool expose_v8_debugger_protocol_; | 75 bool expose_v8_debugger_protocol_; |
78 | 76 |
79 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 77 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
80 }; | 78 }; |
81 | 79 |
82 #endif // CHROME_RENDERER_DEVTOOLS_AGENT_H_ | 80 #endif // CHROME_RENDERER_DEVTOOLS_AGENT_H_ |
OLD | NEW |