• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 // Developer tools consist of the following parts:
6 //
7 // DevToolsAgent lives in the renderer of an inspected page and provides access
8 // to the pages resources, DOM, v8 etc. by means of IPC messages.
9 //
10 // DevToolsClient is a thin delegate that lives in the tools front-end
11 // renderer and converts IPC messages to frontend method calls and allows the
12 // frontend to send messages to the DevToolsAgent.
13 //
14 // All the messages are routed through browser process. There is a
15 // DevToolsManager living in the browser process that is responsible for
16 // routing logistics. It is also capable of sending direct messages to the
17 // agent rather than forwarding messages between agents and clients only.
18 //
19 // Chain of communication between the components may be described by the
20 // following diagram:
21 //  ----------------------------
22 // | (tools frontend            |
23 // | renderer process)          |
24 // |                            |            --------------------
25 // |tools    <--> DevToolsClient+<-- IPC -->+ (browser process)  |
26 // |frontend                    |           |                    |
27 //  ----------------------------             ---------+----------
28 //                                                    ^
29 //                                                    |
30 //                                                   IPC
31 //                                                    |
32 //                                                    v
33 //                          --------------------------+--------
34 //                         | inspected page <--> DevToolsAgent |
35 //                         |                                   |
36 //                         | (inspected page renderer process) |
37 //                          -----------------------------------
38 //
39 // This file describes developer tools message types.
40 
41 // Multiply-included message file, no standard include guard.
42 #include <map>
43 #include <string>
44 
45 #include "ipc/ipc_message_macros.h"
46 
47 // Singly-included section.
48 #ifndef CHROME_COMMON_DEVTOOLS_MESSAGES_H_
49 #define CHROME_COMMON_DEVTOOLS_MESSAGES_H_
50 
51 typedef std::map<std::string, std::string> DevToolsRuntimeProperties;
52 
53 #endif  // CHROME_COMMON_DEVTOOLS_MESSAGES_H_
54 
55 #define IPC_MESSAGE_START DevToolsMsgStart
56 
57 // These are messages sent from DevToolsAgent to DevToolsClient through the
58 // browser.
59 // WebKit-level transport.
60 IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchOnInspectorFrontend,
61                      std::string /* message */)
62 
63 // Legacy debugger output message.
64 IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DebuggerOutput,
65                      std::string /* message */)
66 
67 
68 //-----------------------------------------------------------------------------
69 // These are messages sent from DevToolsClient to DevToolsAgent through the
70 // browser.
71 // Tells agent that there is a client host connected to it.
72 IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_Attach,
73                      DevToolsRuntimeProperties /* properties */)
74 
75 // Tells agent that there is no longer a client host connected to it.
76 IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_Detach)
77 
78 // Tells agent that the front-end has been loaded
79 IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_FrontendLoaded)
80 
81 // WebKit-level transport.
82 IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DispatchOnInspectorBackend,
83                      std::string /* message */)
84 
85 // Send debugger command to the debugger agent. Debugger commands should
86 // be handled on IO thread(while all other devtools messages are handled in
87 // the render thread) to allow executing the commands when v8 is on a
88 // breakpoint.
89 IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DebuggerCommand,
90                      std::string  /* command */)
91 
92 // Inspect element with the given coordinates.
93 IPC_MESSAGE_CONTROL2(DevToolsAgentMsg_InspectElement,
94                      int /* x */,
95                      int /* y */)
96 
97 
98 //-----------------------------------------------------------------------------
99 // These are messages sent from the browser to the renderer.
100 
101 // RenderViewHostDelegate::RenderViewCreated method sends this message to a
102 // new renderer to notify it that it will host developer tools UI and should
103 // set up all neccessary bindings and create DevToolsClient instance that
104 // will handle communication with inspected page DevToolsAgent.
105 IPC_MESSAGE_ROUTED0(DevToolsMsg_SetupDevToolsClient)
106 
107 
108 //-----------------------------------------------------------------------------
109 // These are messages sent from the renderer to the browser.
110 
111 // Wraps an IPC message that's destined to the DevToolsClient on
112 // DevToolsAgent->browser hop.
113 IPC_MESSAGE_ROUTED1(DevToolsHostMsg_ForwardToClient,
114                     IPC::Message /* one of DevToolsClientMsg_XXX types */)
115 
116 // Wraps an IPC message that's destined to the DevToolsAgent on
117 // DevToolsClient->browser hop.
118 IPC_MESSAGE_ROUTED1(DevToolsHostMsg_ForwardToAgent,
119                     IPC::Message /* one of DevToolsAgentMsg_XXX types */)
120 
121 // Activates (brings to the front) corresponding dev tools window.
122 IPC_MESSAGE_ROUTED0(DevToolsHostMsg_ActivateWindow)
123 
124 // Closes dev tools window that is inspecting current render_view_host.
125 IPC_MESSAGE_ROUTED0(DevToolsHostMsg_CloseWindow)
126 
127 // Attaches dev tools window that is inspecting current render_view_host.
128 IPC_MESSAGE_ROUTED0(DevToolsHostMsg_RequestDockWindow)
129 
130 // Detaches dev tools window that is inspecting current render_view_host.
131 IPC_MESSAGE_ROUTED0(DevToolsHostMsg_RequestUndockWindow)
132 
133 // Updates runtime features store in devtools manager in order to support
134 // cross-navigation instrumentation.
135 IPC_MESSAGE_ROUTED2(DevToolsHostMsg_RuntimePropertyChanged,
136                     std::string /* name */,
137                     std::string /* value */)
138