| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DEVTOOLS_AGENT_FILTER_H_ | 5 #ifndef CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_ |
| 6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_ | 6 #define CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // v8 provides thread-safe Api for controlling debugger. In our case v8's Api | 26 // v8 provides thread-safe Api for controlling debugger. In our case v8's Api |
| 27 // is being used from this communication agent on the IO thread. | 27 // is being used from this communication agent on the IO thread. |
| 28 class DevToolsAgentFilter : public IPC::MessageFilter { | 28 class DevToolsAgentFilter : public IPC::MessageFilter { |
| 29 public: | 29 public: |
| 30 // There is a single instance of this class instantiated by the RenderThread. | 30 // There is a single instance of this class instantiated by the RenderThread. |
| 31 DevToolsAgentFilter(); | 31 DevToolsAgentFilter(); |
| 32 | 32 |
| 33 static void SendRpcMessage(const DevToolsMessageData& data); | 33 static void SendRpcMessage(const DevToolsMessageData& data); |
| 34 | 34 |
| 35 // IPC::MessageFilter override. Called on IO thread. | 35 // IPC::MessageFilter override. Called on IO thread. |
| 36 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 36 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 37 | 37 |
| 38 // Called on the main thread. | 38 // Called on the main thread. |
| 39 void AddEmbeddedWorkerRouteOnMainThread(int32 routing_id); | 39 void AddEmbeddedWorkerRouteOnMainThread(int32 routing_id); |
| 40 void RemoveEmbeddedWorkerRouteOnMainThread(int32 routing_id); | 40 void RemoveEmbeddedWorkerRouteOnMainThread(int32 routing_id); |
| 41 | 41 |
| 42 protected: | 42 protected: |
| 43 virtual ~DevToolsAgentFilter(); | 43 virtual ~DevToolsAgentFilter(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 void OnDispatchOnInspectorBackend(const std::string& message); | 46 void OnDispatchOnInspectorBackend(const std::string& message); |
| 47 | 47 |
| 48 // Called on IO thread | 48 // Called on IO thread |
| 49 void AddEmbeddedWorkerRoute(int32 routing_id); | 49 void AddEmbeddedWorkerRoute(int32 routing_id); |
| 50 void RemoveEmbeddedWorkerRoute(int32 routing_id); | 50 void RemoveEmbeddedWorkerRoute(int32 routing_id); |
| 51 | 51 |
| 52 bool message_handled_; | 52 bool message_handled_; |
| 53 base::MessageLoop* render_thread_loop_; | 53 base::MessageLoop* render_thread_loop_; |
| 54 // Proxy to the IO message loop. | 54 // Proxy to the IO message loop. |
| 55 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; | 55 scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; |
| 56 int current_routing_id_; | 56 int current_routing_id_; |
| 57 | 57 |
| 58 std::set<int32> embedded_worker_routes_; | 58 std::set<int32> embedded_worker_routes_; |
| 59 | 59 |
| 60 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); | 60 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 } // namespace content | 63 } // namespace content |
| 64 | 64 |
| 65 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_ | 65 #endif // CONTENT_RENDERER_DEVTOOLS_DEVTOOLS_AGENT_FILTER_H_ |
| OLD | NEW |