OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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_DEV_TOOLS_AGENT_H_ | 5 #ifndef CHROME_RENDERER_DEV_TOOLS_AGENT_H_ |
6 #define CHROME_RENDERER_DEV_TOOLS_AGENT_H_ | 6 #define CHROME_RENDERER_DEV_TOOLS_AGENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 // go through browser process. On the renderer side of the tools UI there's | 21 // go through browser process. On the renderer side of the tools UI there's |
22 // a corresponding ToolsClient object. | 22 // a corresponding ToolsClient object. |
23 class DevToolsAgent : public IPC::ChannelProxy::MessageFilter, | 23 class DevToolsAgent : public IPC::ChannelProxy::MessageFilter, |
24 public DebuggerBridge::Delegate { | 24 public DebuggerBridge::Delegate { |
25 public: | 25 public: |
26 // DevToolsAgent is a field of the RenderView. The view is supposed to remove | 26 // DevToolsAgent is a field of the RenderView. The view is supposed to remove |
27 // this agent from message filter list on IO thread before dying. | 27 // this agent from message filter list on IO thread before dying. |
28 explicit DevToolsAgent(RenderView* view, MessageLoop* view_loop); | 28 explicit DevToolsAgent(RenderView* view, MessageLoop* view_loop); |
29 virtual ~DevToolsAgent(); | 29 virtual ~DevToolsAgent(); |
30 | 30 |
31 // DevToolsAgent is created by RenderView which is supposed to call this | |
32 // method from its destructor. | |
33 void RenderViewDestroyed(); | |
34 | |
31 private: | 35 private: |
32 // Sends message to DevToolsClient. May be called on any thread. | 36 // Sends message to DevToolsClient. May be called on any thread. |
33 void Send(const IPC::Message& tools_client_message); | 37 void Send(const IPC::Message& tools_client_message); |
34 | 38 |
35 // Sends message to DevToolsClient. Must be called on IO thread. Takes | 39 // Sends message to DevToolsClient. Must be called on IO thread. Takes |
36 // ownership of the message. | 40 // ownership of the message. |
37 void SendFromIOThread(IPC::Message* message); | 41 void SendFromIOThread(IPC::Message* message); |
38 | 42 |
39 // IPC::ChannelProxy::MessageFilter overrides. Called on IO thread. | 43 // IPC::ChannelProxy::MessageFilter overrides. Called on IO thread. |
40 virtual void OnFilterAdded(IPC::Channel* channel); | 44 virtual void OnFilterAdded(IPC::Channel* channel); |
41 virtual bool OnMessageReceived(const IPC::Message& message); | 45 virtual bool OnMessageReceived(const IPC::Message& message); |
42 virtual void OnFilterRemoved(); | 46 virtual void OnFilterRemoved(); |
43 | 47 |
44 // Debugger::Delegate callback method to handle debugger output. | 48 // Debugger::Delegate callback method to handle debugger output. |
45 void DebuggerOutput(const std::wstring& out); | 49 void DebuggerOutput(const std::wstring& out); |
46 | 50 |
47 // Evaluate javascript URL in the renderer | 51 // Evaluate javascript URL in the renderer |
48 void EvaluateScript(const std::wstring& script); | 52 void EvaluateScript(const std::wstring& script); |
49 | 53 |
50 // All these OnXXX methods will be executed in IO thread so that we can | 54 // All these OnXXX methods will be executed in IO thread so that we can |
51 // handle debug messages even when v8 is stopped. | 55 // handle debug messages even when v8 is stopped. |
52 void OnDebugAttach(); | 56 void OnDebugAttach(); |
53 void OnDebugDetach(); | 57 void OnDebugDetach(); |
54 void OnDebugBreak(bool force); | 58 void OnDebugBreak(bool force); |
55 void OnDebugCommand(const std::wstring& cmd); | 59 void OnDebugCommand(const std::wstring& cmd); |
56 | 60 |
57 scoped_refptr<DebuggerBridge> debugger_; | 61 scoped_refptr<DebuggerBridge> debugger_; |
58 | 62 |
63 int routing_id_; // View routing id that we can access from IO thread. | |
Dean McNamee
2009/03/05 11:43:29
This is a style violation, two spaces before //
| |
59 RenderView* view_; | 64 RenderView* view_; |
60 MessageLoop* view_loop_; | 65 MessageLoop* view_loop_; |
61 | 66 |
62 IPC::Channel* channel_; | 67 IPC::Channel* channel_; |
63 MessageLoop* io_loop_; | 68 MessageLoop* io_loop_; |
64 | 69 |
65 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 70 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
66 }; | 71 }; |
67 | 72 |
68 #endif // CHROME_RENDERER_DEV_TOOLS_AGENT_H_ | 73 #endif // CHROME_RENDERER_DEV_TOOLS_AGENT_H_ |
69 | 74 |
OLD | NEW |