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

Side by Side Diff: chrome/renderer/dev_tools_agent.h

Issue 21543: Add developer tools message handling to renderer (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
« no previous file with comments | « chrome/chrome.xcodeproj/project.pbxproj ('k') | chrome/renderer/dev_tools_agent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_RENDERER_DEV_TOOLS_AGENT_H_
6 #define CHROME_RENDERER_DEV_TOOLS_AGENT_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/ref_counted.h"
12 #include "base/scoped_ptr.h"
13 #include "chrome/common/ipc_channel_proxy.h"
14 #include "webkit/glue/debugger_bridge.h"
15
16 class MessageLoop;
17 class RenderView;
18
19 // Inspected page end of communication channel between the render process of
20 // the page being inspected and tools UI renderer process. All messages will
21 // go through browser process. On the renderer side of the tools UI there's
22 // a corresponding ToolsClient object.
23 class DevToolsAgent : public IPC::ChannelProxy::MessageFilter,
24 public DebuggerBridge::Delegate {
25 public:
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.
28 explicit DevToolsAgent(RenderView* view, MessageLoop* view_loop);
29 virtual ~DevToolsAgent();
30
31 private:
32 // Sends message to DevToolsClient. May be called on any thread.
33 void Send(const IPC::Message& tools_client_message);
34
35 // Sends message to DevToolsClient. Must be called on IO thread. Takes
36 // ownership of the message.
37 void SendFromIOThread(IPC::Message* message);
38
39 // IPC::ChannelProxy::MessageFilter overrides. Called on IO thread.
40 virtual void OnFilterAdded(IPC::Channel* channel);
41 virtual bool OnMessageReceived(const IPC::Message& message);
42 virtual void OnFilterRemoved();
43
44 // Debugger::Delegate callback method to handle debugger output.
45 void DebuggerOutput(const std::wstring& out);
46
47 // Evaluate javascript URL in the renderer
48 void EvaluateScript(const std::wstring& script);
49
50 // All these OnXXX methods will be executed in IO thread so that we can
51 // handle debug messages even when v8 is stopped.
52 void OnDebugAttach();
53 void OnDebugDetach();
54 void OnDebugBreak(bool force);
55 void OnDebugCommand(const std::wstring& cmd);
56
57 scoped_refptr<DebuggerBridge> debugger_;
58
59 RenderView* view_;
60 MessageLoop* view_loop_;
61
62 IPC::Channel* channel_;
63 MessageLoop* io_loop_;
64
65 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent);
66 };
67
68 #endif // CHROME_RENDERER_DEV_TOOLS_AGENT_H_
69
OLDNEW
« no previous file with comments | « chrome/chrome.xcodeproj/project.pbxproj ('k') | chrome/renderer/dev_tools_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698