| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_DEVTOOLS_AGENT_FILTER_H_ | 5 #ifndef CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_ |
| 6 #define CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_ | 6 #define CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "ipc/ipc_channel_proxy.h" | 11 #include "ipc/ipc_channel_proxy.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 22 class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter { | 22 class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter { |
| 23 public: | 23 public: |
| 24 // There is a single instance of this class instantiated by the RenderThread. | 24 // There is a single instance of this class instantiated by the RenderThread. |
| 25 DevToolsAgentFilter(); | 25 DevToolsAgentFilter(); |
| 26 virtual ~DevToolsAgentFilter(); | 26 virtual ~DevToolsAgentFilter(); |
| 27 | 27 |
| 28 static void SendRpcMessage(const DevToolsMessageData& data); | 28 static void SendRpcMessage(const DevToolsMessageData& data); |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 // IPC::ChannelProxy::MessageFilter override. Called on IO thread. | 31 // IPC::ChannelProxy::MessageFilter override. Called on IO thread. |
| 32 virtual bool OnMessageReceived(const IPC::Message& message); | 32 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 33 | 33 |
| 34 virtual void OnFilterAdded(IPC::Channel* channel); | 34 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; |
| 35 | 35 |
| 36 static void DispatchMessageLoop(); | 36 static void DispatchMessageLoop(); |
| 37 | 37 |
| 38 // OnDebuggerCommand will be executed in the IO thread so that we can | 38 // OnDebuggerCommand will be executed in the IO thread so that we can |
| 39 // handle debug messages even when v8 is stopped. | 39 // handle debug messages even when v8 is stopped. |
| 40 void OnDebuggerCommand(const std::string& command); | 40 void OnDebuggerCommand(const std::string& command); |
| 41 void OnDispatchOnInspectorBackend(const std::string& message); | 41 void OnDispatchOnInspectorBackend(const std::string& message); |
| 42 | 42 |
| 43 bool message_handled_; | 43 bool message_handled_; |
| 44 MessageLoop* render_thread_loop_; | 44 MessageLoop* render_thread_loop_; |
| 45 | 45 |
| 46 // Made static to allow DevToolsAgent to use it for replying directly | 46 // Made static to allow DevToolsAgent to use it for replying directly |
| 47 // from IO thread. | 47 // from IO thread. |
| 48 static int current_routing_id_; | 48 static int current_routing_id_; |
| 49 static IPC::Channel* channel_; | 49 static IPC::Channel* channel_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); | 51 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 #endif // CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_ | 54 #endif // CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_ |
| OLD | NEW |