Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Side by Side Diff: content/renderer/devtools_agent_filter.h

Issue 10071038: RefCounted types should not have public destructors, content/browser part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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"
12 12
13 class MessageLoop; 13 class MessageLoop;
14 struct DevToolsMessageData; 14 struct DevToolsMessageData;
15 15
16 // DevToolsAgentFilter is registered as an IPC filter in order to be able to 16 // DevToolsAgentFilter is registered as an IPC filter in order to be able to
17 // dispatch messages while on the IO thread. The reason for that is that while 17 // dispatch messages while on the IO thread. The reason for that is that while
18 // debugging, Render thread is being held by the v8 and hence no messages 18 // debugging, Render thread is being held by the v8 and hence no messages
19 // are being dispatched there. While holding the thread in a tight loop, 19 // are being dispatched there. While holding the thread in a tight loop,
20 // v8 provides thread-safe Api for controlling debugger. In our case v8's Api 20 // v8 provides thread-safe Api for controlling debugger. In our case v8's Api
21 // is being used from this communication agent on the IO thread. 21 // is being used from this communication agent on the IO thread.
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();
27 26
28 static void SendRpcMessage(const DevToolsMessageData& data); 27 static void SendRpcMessage(const DevToolsMessageData& data);
29 28
30 private: 29 private:
30 virtual ~DevToolsAgentFilter();
31
31 // IPC::ChannelProxy::MessageFilter override. Called on IO thread. 32 // IPC::ChannelProxy::MessageFilter override. Called on IO thread.
32 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
33 34
34 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; 35 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
35 36
36 void OnDispatchOnInspectorBackend(const std::string& message); 37 void OnDispatchOnInspectorBackend(const std::string& message);
37 38
38 bool message_handled_; 39 bool message_handled_;
39 MessageLoop* render_thread_loop_; 40 MessageLoop* render_thread_loop_;
40 41
41 // Made static to allow DevToolsAgent to use it for replying directly 42 // Made static to allow DevToolsAgent to use it for replying directly
42 // from IO thread. 43 // from IO thread.
43 static int current_routing_id_; 44 static int current_routing_id_;
44 static IPC::Channel* channel_; 45 static IPC::Channel* channel_;
45 46
46 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); 47 DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter);
47 }; 48 };
48 49
49 #endif // CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_ 50 #endif // CONTENT_RENDERER_DEVTOOLS_AGENT_FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698