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_DEVTOOLS_AGENT_FILTER_H_ | 5 #ifndef CHROME_RENDERER_DEVTOOLS_AGENT_FILTER_H_ |
6 #define CHROME_RENDERER_DEVTOOLS_AGENT_FILTER_H_ | 6 #define CHROME_RENDERER_DEVTOOLS_AGENT_FILTER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/common/ipc_channel_proxy.h" | 11 #include "ipc/ipc_channel_proxy.h" |
12 | 12 |
13 class WebDevToolsAgent; | 13 class WebDevToolsAgent; |
14 | 14 |
15 // DevToolsAgentFilter is registered as an IPC filter in order to be able to | 15 // DevToolsAgentFilter is registered as an IPC filter in order to be able to |
16 // dispatch messages while on the IO thread. The reason for that is that while | 16 // dispatch messages while on the IO thread. The reason for that is that while |
17 // debugging, Render thread is being held by the v8 and hence no messages | 17 // debugging, Render thread is being held by the v8 and hence no messages |
18 // are being dispatched there. While holding the thread in a tight loop, | 18 // are being dispatched there. While holding the thread in a tight loop, |
19 // v8 provides thread-safe Api for controlling debugger. In our case v8's Api | 19 // v8 provides thread-safe Api for controlling debugger. In our case v8's Api |
20 // is being used from this communication agent on the IO thread. | 20 // is being used from this communication agent on the IO thread. |
21 class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter { | 21 class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter { |
(...skipping 11 matching lines...) Expand all Loading... |
33 // OnDebuggerCommand will be executed in the IO thread so that we can | 33 // OnDebuggerCommand will be executed in the IO thread so that we can |
34 // handle debug messages even when v8 is stopped. | 34 // handle debug messages even when v8 is stopped. |
35 void OnDebuggerCommand(const std::string& command); | 35 void OnDebuggerCommand(const std::string& command); |
36 | 36 |
37 int current_routing_id_; | 37 int current_routing_id_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); | 39 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); |
40 }; | 40 }; |
41 | 41 |
42 #endif // CHROME_RENDERER_DEVTOOLS_AGENT_FILTER_H_ | 42 #endif // CHROME_RENDERER_DEVTOOLS_AGENT_FILTER_H_ |
OLD | NEW |