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

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

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

Powered by Google App Engine
This is Rietveld 408576698