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

Side by Side Diff: chrome/common/plugin_messages_internal.h

Issue 5526008: Simplify the magic required to create IPC message headers a bit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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/common/plugin_messages.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 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 #include "base/shared_memory.h" 5 #include "base/shared_memory.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "gfx/native_widget_types.h" 7 #include "gfx/native_widget_types.h"
8 #include "ipc/ipc_message_macros.h" 8 #include "ipc/ipc_message_macros.h"
9 #include "webkit/glue/webcursor.h" 9 #include "webkit/glue/webcursor.h"
10 10
11 #if defined(OS_POSIX) 11 #if defined(OS_POSIX)
12 #include "base/file_descriptor_posix.h" 12 #include "base/file_descriptor_posix.h"
13 #endif 13 #endif
14 14
15 #define IPC_MESSAGE_START PluginMsgStart
16
15 //----------------------------------------------------------------------------- 17 //-----------------------------------------------------------------------------
16 // PluginProcess messages 18 // PluginProcess messages
17 // These are messages sent from the browser to the plugin process. 19 // These are messages sent from the browser to the plugin process.
18 IPC_BEGIN_MESSAGES(PluginProcess) 20 // Tells the plugin process to create a new channel for communication with a
19 // Tells the plugin process to create a new channel for communication with a 21 // given renderer. The channel name is returned in a
20 // given renderer. The channel name is returned in a 22 // PluginProcessHostMsg_ChannelCreated message. The renderer ID is passed so
21 // PluginProcessHostMsg_ChannelCreated message. The renderer ID is passed so 23 // that the plugin process reuses an existing channel to that process if it
22 // that the plugin process reuses an existing channel to that process if it 24 // exists. This ID is a unique opaque identifier generated by the browser
23 // exists. This ID is a unique opaque identifier generated by the browser 25 // process.
24 // process. 26 IPC_MESSAGE_CONTROL2(PluginProcessMsg_CreateChannel,
25 IPC_MESSAGE_CONTROL2(PluginProcessMsg_CreateChannel, 27 int /* renderer_id */,
26 int /* renderer_id */, 28 bool /* off_the_record */)
27 bool /* off_the_record */) 29
28 30 // Allows a chrome plugin loaded in the browser process to send arbitrary
29 // Allows a chrome plugin loaded in the browser process to send arbitrary 31 // data to an instance of the same plugin loaded in a plugin process.
30 // data to an instance of the same plugin loaded in a plugin process. 32 IPC_MESSAGE_CONTROL1(PluginProcessMsg_PluginMessage,
31 IPC_MESSAGE_CONTROL1(PluginProcessMsg_PluginMessage, 33 std::vector<uint8> /* opaque data */)
32 std::vector<uint8> /* opaque data */) 34
33 35 // Tells the plugin process to notify every connected renderer of the pending
34 // Tells the plugin process to notify every connected renderer of the pending 36 // shutdown, so we don't mistake it for a crash.
35 // shutdown, so we don't mistake it for a crash. 37 IPC_MESSAGE_CONTROL0(PluginProcessMsg_NotifyRenderersOfPendingShutdown)
36 IPC_MESSAGE_CONTROL0(PluginProcessMsg_NotifyRenderersOfPendingShutdown) 38
37 39 // The following messages are used by all child processes, even though they
38 // The following messages are used by all child processes, even though they 40 // are listed under PluginProcess. It seems overkill to define ChildProcess.
39 // are listed under PluginProcess. It seems overkill to define ChildProcess. 41 // Tells the child process it should stop.
40 // Tells the child process it should stop. 42 IPC_MESSAGE_CONTROL0(PluginProcessMsg_AskBeforeShutdown)
41 IPC_MESSAGE_CONTROL0(PluginProcessMsg_AskBeforeShutdown) 43
42 44 // Sent in response to PluginProcessHostMsg_ShutdownRequest to tell the child
43 // Sent in response to PluginProcessHostMsg_ShutdownRequest to tell the child 45 // process that it's safe to shutdown.
44 // process that it's safe to shutdown. 46 IPC_MESSAGE_CONTROL0(PluginProcessMsg_Shutdown)
45 IPC_MESSAGE_CONTROL0(PluginProcessMsg_Shutdown)
46 47
47 #if defined(IPC_MESSAGE_LOG_ENABLED) 48 #if defined(IPC_MESSAGE_LOG_ENABLED)
48 // Tell the child process to begin or end IPC message logging. 49 // Tell the child process to begin or end IPC message logging.
49 // Like above, this is used by all ChildProcesses. 50 // Like above, this is used by all ChildProcesses.
50 IPC_MESSAGE_CONTROL1(PluginProcessMsg_SetIPCLoggingEnabled, 51 IPC_MESSAGE_CONTROL1(PluginProcessMsg_SetIPCLoggingEnabled,
51 bool /* on or off */) 52 bool /* on or off */)
52 #endif 53 #endif
53
54 IPC_END_MESSAGES(PluginProcess)
55 54
56 55
57 //----------------------------------------------------------------------------- 56 //-----------------------------------------------------------------------------
58 // PluginProcessHost messages 57 // PluginProcessHost messages
59 // These are messages sent from the plugin process to the browser process. 58 // These are messages sent from the plugin process to the browser process.
60 IPC_BEGIN_MESSAGES(PluginProcessHost) 59 // Response to a PluginProcessMsg_CreateChannel message.
61 // Response to a PluginProcessMsg_CreateChannel message. 60 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated,
62 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, 61 IPC::ChannelHandle /* channel_handle */)
63 IPC::ChannelHandle /* channel_handle */) 62
64 63 IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl,
65 IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, 64 std::string /* plugin finder URL */)
66 std::string /* plugin finder URL */) 65
67 66 IPC_MESSAGE_CONTROL0(PluginProcessHostMsg_ShutdownRequest)
68 IPC_MESSAGE_CONTROL0(PluginProcessHostMsg_ShutdownRequest) 67
69 68 // Allows a chrome plugin loaded in a plugin process to send arbitrary
70 // Allows a chrome plugin loaded in a plugin process to send arbitrary 69 // data to an instance of the same plugin loaded in the browser process.
71 // data to an instance of the same plugin loaded in the browser process. 70 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginMessage,
72 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginMessage, 71 std::vector<uint8> /* opaque data */)
73 std::vector<uint8> /* opaque data */) 72
74 73 // Allows a chrome plugin loaded in a plugin process to send arbitrary
75 // Allows a chrome plugin loaded in a plugin process to send arbitrary 74 // data to an instance of the same plugin loaded in the browser process.
76 // data to an instance of the same plugin loaded in the browser process. 75 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_PluginSyncMessage,
77 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_PluginSyncMessage, 76 std::vector<uint8> /* opaque data */,
78 std::vector<uint8> /* opaque data */, 77 std::vector<uint8> /* opaque data response */)
79 std::vector<uint8> /* opaque data response */) 78
80 79 // Used to get cookies for the given URL. The request_context is a
81 // Used to get cookies for the given URL. The request_context is a 80 // CPBrowsingContext, but is passed as int32 to avoid compilation errors.
82 // CPBrowsingContext, but is passed as int32 to avoid compilation errors. 81 IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_GetCookies,
83 IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_GetCookies, 82 int32 /* request_context */,
84 int32 /* request_context */, 83 GURL /* url */,
85 GURL /* url */, 84 std::string /* cookies */)
86 std::string /* cookies */) 85
87 86 // Used by the plugin process to verify that its renderer |renderer_id| has
88 // Used by the plugin process to verify that its renderer |renderer_id| has 87 // permission to access the given |files|.
89 // permission to access the given |files|. 88 IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_AccessFiles,
90 IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_AccessFiles, 89 int /* renderer_id */,
91 int /* renderer_id */, 90 std::vector<std::string> /* files */,
92 std::vector<std::string> /* files */, 91 bool /* allowed */)
93 bool /* allowed */) 92
94 93 // Get the list of proxies to use for |url|, as a semicolon delimited list
95 // Get the list of proxies to use for |url|, as a semicolon delimited list 94 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy
96 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy 95 // which does the same thing.
97 // which does the same thing. 96 IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy,
98 IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy, 97 GURL /* url */,
99 GURL /* url */, 98 int /* network error */,
100 int /* network error */, 99 std::string /* proxy list */)
101 std::string /* proxy list */)
102 100
103 #if defined(OS_WIN) 101 #if defined(OS_WIN)
104 // Creates a child window of the given parent window on the UI thread. 102 // Creates a child window of the given parent window on the UI thread.
105 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_CreateWindow, 103 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_CreateWindow,
106 HWND /* parent */, 104 HWND /* parent */,
107 HWND /* child */) 105 HWND /* child */)
108 106
109 // Destroys the given window's parent on the UI thread. 107 // Destroys the given window's parent on the UI thread.
110 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed, 108 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed,
111 HWND /* window */, 109 HWND /* window */,
112 HWND /* parent */) 110 HWND /* parent */)
113 111
114 IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, 112 IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl,
115 std::string /* URL */, 113 std::string /* URL */,
116 int /* process id */, 114 int /* process id */,
117 HWND /* caller window */) 115 HWND /* caller window */)
118 #endif 116 #endif
119 117
120 #if defined(USE_X11) 118 #if defined(USE_X11)
121 // On X11, the mapping between NativeViewId and X window ids 119 // On X11, the mapping between NativeViewId and X window ids
122 // is known only to the browser. This message lets the plugin process 120 // is known only to the browser. This message lets the plugin process
123 // ask about a NativeViewId that was provided by the renderer. 121 // ask about a NativeViewId that was provided by the renderer.
124 // It will get 0 back if it's a bogus input. 122 // It will get 0 back if it's a bogus input.
125 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_MapNativeViewId, 123 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_MapNativeViewId,
126 gfx::NativeViewId /* input: native view id */, 124 gfx::NativeViewId /* input: native view id */,
127 gfx::PluginWindowHandle /* output: X window id */) 125 gfx::PluginWindowHandle /* output: X window id */)
128 #endif 126 #endif
129 127
130 #if defined(OS_MACOSX) 128 #if defined(OS_MACOSX)
131 // On Mac OS X, we need the browser to keep track of plugin windows so 129 // On Mac OS X, we need the browser to keep track of plugin windows so
132 // that it can add and remove them from stacking groups, hide and show the 130 // that it can add and remove them from stacking groups, hide and show the
133 // menu bar, etc. We pass the window rect for convenience so that the 131 // menu bar, etc. We pass the window rect for convenience so that the
134 // browser can easily tell if the window is fullscreen. 132 // browser can easily tell if the window is fullscreen.
135 133
136 // Notifies the browser that the plugin has selected a window (i.e., brought 134 // Notifies the browser that the plugin has selected a window (i.e., brought
137 // it to the front and wants it to have keyboard focus). 135 // it to the front and wants it to have keyboard focus).
138 IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginSelectWindow, 136 IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginSelectWindow,
139 uint32 /* window ID */, 137 uint32 /* window ID */,
140 gfx::Rect /* window rect */, 138 gfx::Rect /* window rect */,
141 bool /* modal */) 139 bool /* modal */)
142 140
143 // Notifies the browser that the plugin has shown a window. 141 // Notifies the browser that the plugin has shown a window.
144 IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginShowWindow, 142 IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginShowWindow,
145 uint32 /* window ID */, 143 uint32 /* window ID */,
146 gfx::Rect /* window rect */, 144 gfx::Rect /* window rect */,
147 bool /* modal */) 145 bool /* modal */)
148 146
149 // Notifies the browser that the plugin has hidden a window. 147 // Notifies the browser that the plugin has hidden a window.
150 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginHideWindow, 148 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginHideWindow,
151 uint32 /* window ID */, 149 uint32 /* window ID */,
152 gfx::Rect /* window rect */) 150 gfx::Rect /* window rect */)
153 151
154 // Notifies the browser that a plugin instance has requested a cursor 152 // Notifies the browser that a plugin instance has requested a cursor
155 // visibility change. 153 // visibility change.
156 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginSetCursorVisibility, 154 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginSetCursorVisibility,
157 bool /* cursor visibility */) 155 bool /* cursor visibility */)
158 #endif 156 #endif
159
160 IPC_END_MESSAGES(PluginProcessHost)
161 157
162 158
163 //----------------------------------------------------------------------------- 159 //-----------------------------------------------------------------------------
164 // Plugin messages 160 // Plugin messages
165 // These are messages sent from the renderer process to the plugin process. 161 // These are messages sent from the renderer process to the plugin process.
166 IPC_BEGIN_MESSAGES(Plugin) 162 // Tells the plugin process to create a new plugin instance with the given
167 // Tells the plugin process to create a new plugin instance with the given 163 // id. A corresponding WebPluginDelegateStub is created which hosts the
168 // id. A corresponding WebPluginDelegateStub is created which hosts the 164 // WebPluginDelegateImpl.
169 // WebPluginDelegateImpl. 165 IPC_SYNC_MESSAGE_CONTROL1_1(PluginMsg_CreateInstance,
170 IPC_SYNC_MESSAGE_CONTROL1_1(PluginMsg_CreateInstance, 166 std::string /* mime_type */,
171 std::string /* mime_type */, 167 int /* instance_id */)
172 int /* instance_id */) 168
173 169 // The WebPluginDelegateProxy sends this to the WebPluginDelegateStub in its
174 // The WebPluginDelegateProxy sends this to the WebPluginDelegateStub in its 170 // destructor, so that the stub deletes the actual WebPluginDelegateImpl
175 // destructor, so that the stub deletes the actual WebPluginDelegateImpl 171 // object that it's hosting.
176 // object that it's hosting. 172 IPC_SYNC_MESSAGE_CONTROL1_0(PluginMsg_DestroyInstance,
177 IPC_SYNC_MESSAGE_CONTROL1_0(PluginMsg_DestroyInstance, 173 int /* instance_id */)
178 int /* instance_id */) 174
179 175 IPC_SYNC_MESSAGE_CONTROL0_1(PluginMsg_GenerateRouteID,
180 IPC_SYNC_MESSAGE_CONTROL0_1(PluginMsg_GenerateRouteID, 176 int /* id */)
181 int /* id */) 177
182 178 // The messages below all map to WebPluginDelegate methods.
183 // The messages below all map to WebPluginDelegate methods. 179 IPC_SYNC_MESSAGE_ROUTED1_1(PluginMsg_Init,
184 IPC_SYNC_MESSAGE_ROUTED1_1(PluginMsg_Init, 180 PluginMsg_Init_Params,
185 PluginMsg_Init_Params, 181 bool /* result */)
186 bool /* result */) 182
187 183 // Used to synchronously request a paint for windowless plugins.
188 // Used to synchronously request a paint for windowless plugins. 184 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_Paint,
189 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_Paint, 185 gfx::Rect /* damaged_rect */)
190 gfx::Rect /* damaged_rect */) 186
191 187 // Sent by the renderer after it paints from its backing store so that the
192 // Sent by the renderer after it paints from its backing store so that the 188 // plugin knows it can send more invalidates.
193 // plugin knows it can send more invalidates. 189 IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint)
194 IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint) 190
195 191 IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_Print,
196 IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_Print, 192 base::SharedMemoryHandle /* shared_memory*/,
197 base::SharedMemoryHandle /* shared_memory*/, 193 uint32 /* size */)
198 uint32 /* size */) 194
199 195 IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_GetPluginScriptableObject,
200 IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_GetPluginScriptableObject, 196 int /* route_id */)
201 int /* route_id */) 197
202 198 IPC_MESSAGE_ROUTED3(PluginMsg_DidFinishLoadWithReason,
203 IPC_MESSAGE_ROUTED3(PluginMsg_DidFinishLoadWithReason, 199 GURL /* url */,
204 GURL /* url */, 200 int /* reason */,
205 int /* reason */, 201 int /* notify_id */)
206 int /* notify_id */) 202
207 203 // Updates the plugin location.
208 // Updates the plugin location. 204 IPC_MESSAGE_ROUTED1(PluginMsg_UpdateGeometry,
209 IPC_MESSAGE_ROUTED1(PluginMsg_UpdateGeometry, 205 PluginMsg_UpdateGeometry_Param)
210 PluginMsg_UpdateGeometry_Param) 206
211 207 // A synchronous version of above.
212 // A synchronous version of above. 208 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_UpdateGeometrySync,
213 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_UpdateGeometrySync, 209 PluginMsg_UpdateGeometry_Param)
214 PluginMsg_UpdateGeometry_Param) 210
215 211 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_SetFocus,
216 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_SetFocus, 212 bool /* focused */)
217 bool /* focused */) 213
218 214 IPC_SYNC_MESSAGE_ROUTED1_2(PluginMsg_HandleInputEvent,
219 IPC_SYNC_MESSAGE_ROUTED1_2(PluginMsg_HandleInputEvent, 215 IPC::WebInputEventPointer /* event */,
220 IPC::WebInputEventPointer /* event */, 216 bool /* handled */,
221 bool /* handled */, 217 WebCursor /* cursor type*/)
222 WebCursor /* cursor type*/) 218
223 219 IPC_MESSAGE_ROUTED1(PluginMsg_SetContentAreaFocus,
224 IPC_MESSAGE_ROUTED1(PluginMsg_SetContentAreaFocus, 220 bool /* has_focus */)
225 bool /* has_focus */)
226 221
227 #if defined(OS_MACOSX) 222 #if defined(OS_MACOSX)
228 IPC_MESSAGE_ROUTED1(PluginMsg_SetWindowFocus, 223 IPC_MESSAGE_ROUTED1(PluginMsg_SetWindowFocus,
229 bool /* has_focus */) 224 bool /* has_focus */)
230 225
231 IPC_MESSAGE_ROUTED0(PluginMsg_ContainerHidden) 226 IPC_MESSAGE_ROUTED0(PluginMsg_ContainerHidden)
232 227
233 IPC_MESSAGE_ROUTED3(PluginMsg_ContainerShown, 228 IPC_MESSAGE_ROUTED3(PluginMsg_ContainerShown,
234 gfx::Rect /* window_frame */, 229 gfx::Rect /* window_frame */,
235 gfx::Rect /* view_frame */, 230 gfx::Rect /* view_frame */,
236 bool /* has_focus */) 231 bool /* has_focus */)
237 232
238 IPC_MESSAGE_ROUTED2(PluginMsg_WindowFrameChanged, 233 IPC_MESSAGE_ROUTED2(PluginMsg_WindowFrameChanged,
239 gfx::Rect /* window_frame */, 234 gfx::Rect /* window_frame */,
240 gfx::Rect /* view_frame */) 235 gfx::Rect /* view_frame */)
241 236
242 IPC_MESSAGE_ROUTED1(PluginMsg_ImeCompositionConfirmed, 237 IPC_MESSAGE_ROUTED1(PluginMsg_ImeCompositionConfirmed,
243 string16 /* text */) 238 string16 /* text */)
244 #endif 239 #endif
245 240
246 IPC_SYNC_MESSAGE_ROUTED3_0(PluginMsg_WillSendRequest, 241 IPC_SYNC_MESSAGE_ROUTED3_0(PluginMsg_WillSendRequest,
247 unsigned long /* id */, 242 unsigned long /* id */,
248 GURL /* url */, 243 GURL /* url */,
249 int /* http_status_code */) 244 int /* http_status_code */)
250 245
251 IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveResponse, 246 IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveResponse,
252 PluginMsg_DidReceiveResponseParams) 247 PluginMsg_DidReceiveResponseParams)
253 248
254 IPC_MESSAGE_ROUTED3(PluginMsg_DidReceiveData, 249 IPC_MESSAGE_ROUTED3(PluginMsg_DidReceiveData,
255 unsigned long /* id */, 250 unsigned long /* id */,
256 std::vector<char> /* buffer */, 251 std::vector<char> /* buffer */,
257 int /* data_offset */) 252 int /* data_offset */)
258 253
259 IPC_MESSAGE_ROUTED1(PluginMsg_DidFinishLoading, 254 IPC_MESSAGE_ROUTED1(PluginMsg_DidFinishLoading,
260 unsigned long /* id */) 255 unsigned long /* id */)
261 256
262 IPC_MESSAGE_ROUTED1(PluginMsg_DidFail, 257 IPC_MESSAGE_ROUTED1(PluginMsg_DidFail,
263 unsigned long /* id */) 258 unsigned long /* id */)
264 259
265 IPC_MESSAGE_ROUTED4(PluginMsg_SendJavaScriptStream, 260 IPC_MESSAGE_ROUTED4(PluginMsg_SendJavaScriptStream,
266 GURL /* url */, 261 GURL /* url */,
267 std::string /* result */, 262 std::string /* result */,
268 bool /* success */, 263 bool /* success */,
269 int /* notify_id */) 264 int /* notify_id */)
270 265
271 IPC_MESSAGE_ROUTED2(PluginMsg_DidReceiveManualResponse, 266 IPC_MESSAGE_ROUTED2(PluginMsg_DidReceiveManualResponse,
272 GURL /* url */, 267 GURL /* url */,
273 PluginMsg_DidReceiveResponseParams) 268 PluginMsg_DidReceiveResponseParams)
274 269
275 IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveManualData, 270 IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveManualData,
276 std::vector<char> /* buffer */) 271 std::vector<char> /* buffer */)
277 272
278 IPC_MESSAGE_ROUTED0(PluginMsg_DidFinishManualLoading) 273 IPC_MESSAGE_ROUTED0(PluginMsg_DidFinishManualLoading)
279 274
280 IPC_MESSAGE_ROUTED0(PluginMsg_DidManualLoadFail) 275 IPC_MESSAGE_ROUTED0(PluginMsg_DidManualLoadFail)
281 276
282 IPC_MESSAGE_ROUTED0(PluginMsg_InstallMissingPlugin) 277 IPC_MESSAGE_ROUTED0(PluginMsg_InstallMissingPlugin)
283 278
284 IPC_MESSAGE_ROUTED3(PluginMsg_HandleURLRequestReply, 279 IPC_MESSAGE_ROUTED3(PluginMsg_HandleURLRequestReply,
285 unsigned long /* resource_id */, 280 unsigned long /* resource_id */,
286 GURL /* url */, 281 GURL /* url */,
287 int /* notify_id */) 282 int /* notify_id */)
288 283
289 IPC_MESSAGE_ROUTED2(PluginMsg_HTTPRangeRequestReply, 284 IPC_MESSAGE_ROUTED2(PluginMsg_HTTPRangeRequestReply,
290 unsigned long /* resource_id */, 285 unsigned long /* resource_id */,
291 int /* range_request_id */) 286 int /* range_request_id */)
292 287
293 IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_CreateCommandBuffer, 288 IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_CreateCommandBuffer,
294 int /* route_id */) 289 int /* route_id */)
295 290
296 IPC_MESSAGE_ROUTED0(PluginMsg_DestroyCommandBuffer) 291 IPC_MESSAGE_ROUTED0(PluginMsg_DestroyCommandBuffer)
297 292
298 IPC_MESSAGE_CONTROL1(PluginMsg_SignalModalDialogEvent, 293 IPC_MESSAGE_CONTROL1(PluginMsg_SignalModalDialogEvent,
299 gfx::NativeViewId /* containing_window */) 294 gfx::NativeViewId /* containing_window */)
300 295
301 IPC_MESSAGE_CONTROL1(PluginMsg_ResetModalDialogEvent, 296 IPC_MESSAGE_CONTROL1(PluginMsg_ResetModalDialogEvent,
302 gfx::NativeViewId /* containing_window */) 297 gfx::NativeViewId /* containing_window */)
303 298
304 #if defined(OS_MACOSX) 299 #if defined(OS_MACOSX)
305 // This message, used only on 10.6 and later, transmits the "fake" 300 // This message, used only on 10.6 and later, transmits the "fake"
306 // window handle allocated by the browser on behalf of the renderer 301 // window handle allocated by the browser on behalf of the renderer
307 // to the GPU plugin. 302 // to the GPU plugin.
308 IPC_MESSAGE_ROUTED1(PluginMsg_SetFakeAcceleratedSurfaceWindowHandle, 303 IPC_MESSAGE_ROUTED1(PluginMsg_SetFakeAcceleratedSurfaceWindowHandle,
309 gfx::PluginWindowHandle /* window */) 304 gfx::PluginWindowHandle /* window */)
310 #endif 305 #endif
311 306
312 IPC_MESSAGE_CONTROL3(PluginMsg_ClearSiteData, 307 IPC_MESSAGE_CONTROL3(PluginMsg_ClearSiteData,
313 uint64, /* flags */ 308 uint64, /* flags */
314 std::string, /* domain */ 309 std::string, /* domain */
315 base::Time /* begin_time */) 310 base::Time /* begin_time */)
316
317 IPC_END_MESSAGES(Plugin)
318 311
319 312
320 //----------------------------------------------------------------------------- 313 //-----------------------------------------------------------------------------
321 // PluginHost messages 314 // PluginHost messages
322 // These are messages sent from the plugin process to the renderer process. 315 // These are messages sent from the plugin process to the renderer process.
323 // They all map to the corresponding WebPlugin methods. 316 // They all map to the corresponding WebPlugin methods.
324 IPC_BEGIN_MESSAGES(PluginHost) 317 // Sends the plugin window information to the renderer.
325 // Sends the plugin window information to the renderer. 318 // The window parameter is a handle to the window if the plugin is a windowed
326 // The window parameter is a handle to the window if the plugin is a windowed 319 // plugin. It is NULL for windowless plugins.
327 // plugin. It is NULL for windowless plugins. 320 IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindow,
328 IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindow, 321 gfx::PluginWindowHandle /* window */)
329 gfx::PluginWindowHandle /* window */)
330 322
331 #if defined(OS_WIN) 323 #if defined(OS_WIN)
332 // The modal_loop_pump_messages_event parameter is an event handle which is 324 // The modal_loop_pump_messages_event parameter is an event handle which is
333 // passed in for windowless plugins and is used to indicate if messages 325 // passed in for windowless plugins and is used to indicate if messages
334 // are to be pumped in sync calls to the plugin process. Currently used 326 // are to be pumped in sync calls to the plugin process. Currently used
335 // in HandleEvent calls. 327 // in HandleEvent calls.
336 IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindowlessPumpEvent, 328 IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindowlessPumpEvent,
337 HANDLE /* modal_loop_pump_messages_event */) 329 HANDLE /* modal_loop_pump_messages_event */)
338 #endif 330 #endif
339 331
340 IPC_MESSAGE_ROUTED1(PluginHostMsg_URLRequest, 332 IPC_MESSAGE_ROUTED1(PluginHostMsg_URLRequest,
341 PluginHostMsg_URLRequest_Params) 333 PluginHostMsg_URLRequest_Params)
342 334
343 IPC_MESSAGE_ROUTED1(PluginHostMsg_CancelResource, 335 IPC_MESSAGE_ROUTED1(PluginHostMsg_CancelResource,
344 int /* id */) 336 int /* id */)
345 337
346 IPC_MESSAGE_ROUTED1(PluginHostMsg_InvalidateRect, 338 IPC_MESSAGE_ROUTED1(PluginHostMsg_InvalidateRect,
347 gfx::Rect /* rect */) 339 gfx::Rect /* rect */)
348 340
349 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetWindowScriptNPObject, 341 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetWindowScriptNPObject,
350 int /* route id */, 342 int /* route id */,
351 bool /* success */) 343 bool /* success */)
352 344
353 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetPluginElement, 345 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetPluginElement,
354 int /* route id */, 346 int /* route id */,
355 bool /* success */) 347 bool /* success */)
356 348
357 IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, 349 IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie,
358 GURL /* url */, 350 GURL /* url */,
359 GURL /* first_party_for_cookies */, 351 GURL /* first_party_for_cookies */,
360 std::string /* cookie */) 352 std::string /* cookie */)
361 353
362 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, 354 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies,
363 GURL /* url */, 355 GURL /* url */,
364 GURL /* first_party_for_cookies */, 356 GURL /* first_party_for_cookies */,
365 std::string /* cookies */) 357 std::string /* cookies */)
366 358
367 // Asks the browser to show a modal HTML dialog. The dialog is passed the 359 // Asks the browser to show a modal HTML dialog. The dialog is passed the
368 // given arguments as a JSON string, and returns its result as a JSON string 360 // given arguments as a JSON string, and returns its result as a JSON string
369 // through json_retval. 361 // through json_retval.
370 IPC_SYNC_MESSAGE_ROUTED4_1(PluginHostMsg_ShowModalHTMLDialog, 362 IPC_SYNC_MESSAGE_ROUTED4_1(PluginHostMsg_ShowModalHTMLDialog,
371 GURL /* url */, 363 GURL /* url */,
372 int /* width */, 364 int /* width */,
373 int /* height */, 365 int /* height */,
374 std::string /* json_arguments */, 366 std::string /* json_arguments */,
375 std::string /* json_retval */) 367 std::string /* json_retval */)
376 368
377 IPC_SYNC_MESSAGE_ROUTED2_2(PluginHostMsg_GetDragData, 369 IPC_SYNC_MESSAGE_ROUTED2_2(PluginHostMsg_GetDragData,
378 NPVariant_Param /* event */, 370 NPVariant_Param /* event */,
379 bool /* add_data */, 371 bool /* add_data */,
380 std::vector<NPVariant_Param> /* result_values */, 372 std::vector<NPVariant_Param> /* result_values */,
381 bool /* result_success */) 373 bool /* result_success */)
382 374
383 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_SetDropEffect, 375 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_SetDropEffect,
384 NPVariant_Param /* event */, 376 NPVariant_Param /* event */,
385 int /* effect */, 377 int /* effect */,
386 bool /* result_success */) 378 bool /* result_success */)
387 379
388 IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus, 380 IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus,
389 int /* status */) 381 int /* status */)
390 382
391 IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_GetCPBrowsingContext, 383 IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_GetCPBrowsingContext,
392 uint32 /* context */) 384 uint32 /* context */)
393 385
394 IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) 386 IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad)
395 387
396 IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest, 388 IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest,
397 std::string /* url */, 389 std::string /* url */,
398 std::string /* range_info */, 390 std::string /* range_info */,
399 int /* range_request_id */) 391 int /* range_request_id */)
400 392
401 IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading, 393 IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading,
402 unsigned long /* resource_id */, 394 unsigned long /* resource_id */,
403 bool /* defer */) 395 bool /* defer */)
404 396
405 IPC_SYNC_MESSAGE_CONTROL1_0(PluginHostMsg_SetException, 397 IPC_SYNC_MESSAGE_CONTROL1_0(PluginHostMsg_SetException,
406 std::string /* message */) 398 std::string /* message */)
407 399
408 IPC_MESSAGE_CONTROL0(PluginHostMsg_PluginShuttingDown) 400 IPC_MESSAGE_CONTROL0(PluginHostMsg_PluginShuttingDown)
409 401
410 #if defined(OS_MACOSX) 402 #if defined(OS_MACOSX)
411 IPC_MESSAGE_ROUTED1(PluginHostMsg_UpdateGeometry_ACK, 403 IPC_MESSAGE_ROUTED1(PluginHostMsg_UpdateGeometry_ACK,
412 int /* ack_key */) 404 int /* ack_key */)
413 405
414 IPC_MESSAGE_ROUTED1(PluginHostMsg_SetImeEnabled, 406 IPC_MESSAGE_ROUTED1(PluginHostMsg_SetImeEnabled,
415 bool /* enabled */) 407 bool /* enabled */)
416 408
417 // This message, used in Mac OS X 10.5 and earlier, is sent from the plug-in 409 // This message, used in Mac OS X 10.5 and earlier, is sent from the plug-in
418 // process to the renderer process to indicate that the plug-in allocated a 410 // process to the renderer process to indicate that the plug-in allocated a
419 // new TransportDIB that holds the GPU's rendered image. This information is 411 // new TransportDIB that holds the GPU's rendered image. This information is
420 // then forwarded to the browser process via a similar message. 412 // then forwarded to the browser process via a similar message.
421 IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, 413 IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetTransportDIB,
422 gfx::PluginWindowHandle /* window */, 414 gfx::PluginWindowHandle /* window */,
423 int32 /* width */, 415 int32 /* width */,
424 int32 /* height */, 416 int32 /* height */,
425 TransportDIB::Handle /* handle to the TransportDIB */) 417 TransportDIB::Handle /* handle to the TransportDIB */)
426 418
427 // Synthesize a fake window handle for the plug-in to identify the instance 419 // Synthesize a fake window handle for the plug-in to identify the instance
428 // to the browser, allowing mapping to a surface for hardware accelleration 420 // to the browser, allowing mapping to a surface for hardware accelleration
429 // of plug-in content. The browser generates the handle which is then set on 421 // of plug-in content. The browser generates the handle which is then set on
430 // the plug-in. |opaque| indicates whether the content should be treated as 422 // the plug-in. |opaque| indicates whether the content should be treated as
431 // opaque. 423 // opaque.
432 IPC_MESSAGE_ROUTED1(PluginHostMsg_BindFakePluginWindowHandle, 424 IPC_MESSAGE_ROUTED1(PluginHostMsg_BindFakePluginWindowHandle,
433 bool /* opaque */) 425 bool /* opaque */)
434 426
435 // This message, used only on 10.6 and later, is sent from the plug-in process 427 // This message, used only on 10.6 and later, is sent from the plug-in process
436 // to the renderer process to indicate that the plugin allocated a new 428 // to the renderer process to indicate that the plugin allocated a new
437 // IOSurface object of the given width and height. This information is then 429 // IOSurface object of the given width and height. This information is then
438 // forwarded on to the browser process. 430 // forwarded on to the browser process.
439 // 431 //
440 // NOTE: the original intent was to pass a mach port as the IOSurface 432 // NOTE: the original intent was to pass a mach port as the IOSurface
441 // identifier but it looks like that will be a lot of work. For now we pass an 433 // identifier but it looks like that will be a lot of work. For now we pass an
442 // ID from IOSurfaceGetID. 434 // ID from IOSurfaceGetID.
443 IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetIOSurface, 435 IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetIOSurface,
444 gfx::PluginWindowHandle /* window */, 436 gfx::PluginWindowHandle /* window */,
445 int32 /* width */, 437 int32 /* width */,
446 int32 /* height */, 438 int32 /* height */,
447 uint64 /* surface_id */) 439 uint64 /* surface_id */)
448 440
449 441
450 // On the Mac, shared memory can't be allocated in the sandbox, so 442 // On the Mac, shared memory can't be allocated in the sandbox, so
451 // the TransportDIB used by the plug-in for rendering has to be allocated 443 // the TransportDIB used by the plug-in for rendering has to be allocated
452 // and managed by the browser. This is a synchronous message, use with care. 444 // and managed by the browser. This is a synchronous message, use with care.
453 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_AllocTransportDIB, 445 IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_AllocTransportDIB,
454 size_t /* requested memory size */, 446 size_t /* requested memory size */,
455 TransportDIB::Handle /* output: DIB handle */) 447 TransportDIB::Handle /* output: DIB handle */)
456 448
457 // Since the browser keeps handles to the allocated transport DIBs, this 449 // Since the browser keeps handles to the allocated transport DIBs, this
458 // message is sent to tell the browser that it may release them when the 450 // message is sent to tell the browser that it may release them when the
459 // renderer is finished with them. 451 // renderer is finished with them.
460 IPC_MESSAGE_ROUTED1(PluginHostMsg_FreeTransportDIB, 452 IPC_MESSAGE_ROUTED1(PluginHostMsg_FreeTransportDIB,
461 TransportDIB::Id /* DIB id */) 453 TransportDIB::Id /* DIB id */)
462 454
463 // This message notifies the renderer process (and from there the 455 // This message notifies the renderer process (and from there the
464 // browser process) that the plug-in swapped the buffers associated 456 // browser process) that the plug-in swapped the buffers associated
465 // with the given "window", which should cause the browser to redraw 457 // with the given "window", which should cause the browser to redraw
466 // the various plug-ins' contents. 458 // the various plug-ins' contents.
467 IPC_MESSAGE_ROUTED2(PluginHostMsg_AcceleratedSurfaceBuffersSwapped, 459 IPC_MESSAGE_ROUTED2(PluginHostMsg_AcceleratedSurfaceBuffersSwapped,
468 gfx::PluginWindowHandle /* window */, 460 gfx::PluginWindowHandle /* window */,
469 uint64 /* surface_id */) 461 uint64 /* surface_id */)
470 #endif 462 #endif
471 463
472 IPC_MESSAGE_CONTROL1(PluginHostMsg_ClearSiteDataResult, 464 IPC_MESSAGE_CONTROL1(PluginHostMsg_ClearSiteDataResult,
473 bool /* success */) 465 bool /* success */)
474 466
475 IPC_MESSAGE_ROUTED2(PluginHostMsg_URLRedirectResponse, 467 IPC_MESSAGE_ROUTED2(PluginHostMsg_URLRedirectResponse,
476 bool /* allow */, 468 bool /* allow */,
477 int /* resource_id */) 469 int /* resource_id */)
478 470
479 IPC_END_MESSAGES(PluginHost)
480 471
481 //----------------------------------------------------------------------------- 472 //-----------------------------------------------------------------------------
482 // NPObject messages 473 // NPObject messages
483 // These are messages used to marshall NPObjects. They are sent both from the 474 // These are messages used to marshall NPObjects. They are sent both from the
484 // plugin to the renderer and from the renderer to the plugin. 475 // plugin to the renderer and from the renderer to the plugin.
485 IPC_BEGIN_MESSAGES(NPObject) 476 IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Release)
486 IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Release) 477
487 478 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasMethod,
488 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasMethod, 479 NPIdentifier_Param /* name */,
489 NPIdentifier_Param /* name */, 480 bool /* result */)
490 bool /* result */) 481
491 482 IPC_SYNC_MESSAGE_ROUTED3_2(NPObjectMsg_Invoke,
492 IPC_SYNC_MESSAGE_ROUTED3_2(NPObjectMsg_Invoke, 483 bool /* is_default */,
493 bool /* is_default */, 484 NPIdentifier_Param /* method */,
494 NPIdentifier_Param /* method */, 485 std::vector<NPVariant_Param> /* args */,
495 std::vector<NPVariant_Param> /* args */, 486 NPVariant_Param /* result_param */,
496 NPVariant_Param /* result_param */, 487 bool /* result */)
497 bool /* result */) 488
498 489 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasProperty,
499 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasProperty, 490 NPIdentifier_Param /* name */,
500 NPIdentifier_Param /* name */, 491 bool /* result */)
501 bool /* result */) 492
502 493 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_GetProperty,
503 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_GetProperty, 494 NPIdentifier_Param /* name */,
504 NPIdentifier_Param /* name */, 495 NPVariant_Param /* property */,
505 NPVariant_Param /* property */, 496 bool /* result */)
506 bool /* result */) 497
507 498 IPC_SYNC_MESSAGE_ROUTED2_1(NPObjectMsg_SetProperty,
508 IPC_SYNC_MESSAGE_ROUTED2_1(NPObjectMsg_SetProperty, 499 NPIdentifier_Param /* name */,
509 NPIdentifier_Param /* name */, 500 NPVariant_Param /* property */,
510 NPVariant_Param /* property */, 501 bool /* result */)
511 bool /* result */) 502
512 503 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_RemoveProperty,
513 IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_RemoveProperty, 504 NPIdentifier_Param /* name */,
514 NPIdentifier_Param /* name */, 505 bool /* result */)
515 bool /* result */) 506
516 507 IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Invalidate)
517 IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Invalidate) 508
518 509 IPC_SYNC_MESSAGE_ROUTED0_2(NPObjectMsg_Enumeration,
519 IPC_SYNC_MESSAGE_ROUTED0_2(NPObjectMsg_Enumeration, 510 std::vector<NPIdentifier_Param> /* value */,
520 std::vector<NPIdentifier_Param> /* value */, 511 bool /* result */)
521 bool /* result */) 512
522 513 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct,
523 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, 514 std::vector<NPVariant_Param> /* args */,
524 std::vector<NPVariant_Param> /* args */, 515 NPVariant_Param /* result_param */,
525 NPVariant_Param /* result_param */, 516 bool /* result */)
526 bool /* result */) 517
527 518 IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate,
528 IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, 519 std::string /* script */,
529 std::string /* script */, 520 bool /* popups_allowed */,
530 bool /* popups_allowed */, 521 NPVariant_Param /* result_param */,
531 NPVariant_Param /* result_param */, 522 bool /* result */)
532 bool /* result */)
533
534 IPC_END_MESSAGES(NPObject)
OLDNEW
« no previous file with comments | « chrome/common/plugin_messages.cc ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698