OLD | NEW |
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 "ipc/ipc_message_macros.h" | 7 #include "ipc/ipc_message_macros.h" |
8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.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 | 15 #define IPC_MESSAGE_START PluginMsgStart |
16 | 16 |
17 //----------------------------------------------------------------------------- | 17 //----------------------------------------------------------------------------- |
18 // PluginProcess messages | 18 // PluginProcess messages |
19 // These are messages sent from the browser to the plugin process. | 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 | 20 // Tells the plugin process to create a new channel for communication with a |
21 // given renderer. The channel name is returned in a | 21 // given renderer. The channel name is returned in a |
22 // PluginProcessHostMsg_ChannelCreated message. The renderer ID is passed so | 22 // PluginProcessHostMsg_ChannelCreated message. The renderer ID is passed so |
23 // that the plugin process reuses an existing channel to that process if it | 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 | 24 // exists. This ID is a unique opaque identifier generated by the browser |
25 // process. | 25 // process. |
26 IPC_MESSAGE_CONTROL2(PluginProcessMsg_CreateChannel, | 26 IPC_MESSAGE_CONTROL2(PluginProcessMsg_CreateChannel, |
27 int /* renderer_id */, | 27 int /* renderer_id */, |
28 bool /* off_the_record */) | 28 bool /* off_the_record */) |
29 | 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 | 30 // Tells the plugin process to notify every connected renderer of the pending |
36 // shutdown, so we don't mistake it for a crash. | 31 // shutdown, so we don't mistake it for a crash. |
37 IPC_MESSAGE_CONTROL0(PluginProcessMsg_NotifyRenderersOfPendingShutdown) | 32 IPC_MESSAGE_CONTROL0(PluginProcessMsg_NotifyRenderersOfPendingShutdown) |
38 | 33 |
39 | 34 |
40 //----------------------------------------------------------------------------- | 35 //----------------------------------------------------------------------------- |
41 // PluginProcessHost messages | 36 // PluginProcessHost messages |
42 // These are messages sent from the plugin process to the browser process. | 37 // These are messages sent from the plugin process to the browser process. |
43 // Response to a PluginProcessMsg_CreateChannel message. | 38 // Response to a PluginProcessMsg_CreateChannel message. |
44 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, | 39 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, |
45 IPC::ChannelHandle /* channel_handle */) | 40 IPC::ChannelHandle /* channel_handle */) |
46 | 41 |
47 IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, | 42 IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, |
48 std::string /* plugin finder URL */) | 43 std::string /* plugin finder URL */) |
49 | 44 |
50 // Allows a chrome plugin loaded in a plugin process to send arbitrary | 45 IPC_MESSAGE_CONTROL0(PluginProcessHostMsg_ShutdownRequest) |
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 | 46 |
75 // Get the list of proxies to use for |url|, as a semicolon delimited list | 47 // Get the list of proxies to use for |url|, as a semicolon delimited list |
76 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy | 48 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy |
77 // which does the same thing. | 49 // which does the same thing. |
78 IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy, | 50 IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy, |
79 GURL /* url */, | 51 GURL /* url */, |
80 int /* network error */, | 52 int /* network error */, |
81 std::string /* proxy list */) | 53 std::string /* proxy list */) |
82 | 54 |
83 #if defined(OS_WIN) | 55 #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. | 56 // Destroys the given window's parent on the UI thread. |
90 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed, | 57 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed, |
91 HWND /* window */, | 58 HWND /* window */, |
92 HWND /* parent */) | 59 HWND /* parent */) |
93 | 60 |
94 IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, | 61 IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, |
95 std::string /* URL */, | 62 std::string /* URL */, |
96 int /* process id */, | 63 int /* process id */, |
97 HWND /* caller window */) | 64 HWND /* caller window */) |
98 #endif | 65 #endif |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, | 293 IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, |
327 GURL /* url */, | 294 GURL /* url */, |
328 GURL /* first_party_for_cookies */, | 295 GURL /* first_party_for_cookies */, |
329 std::string /* cookie */) | 296 std::string /* cookie */) |
330 | 297 |
331 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, | 298 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, |
332 GURL /* url */, | 299 GURL /* url */, |
333 GURL /* first_party_for_cookies */, | 300 GURL /* first_party_for_cookies */, |
334 std::string /* cookies */) | 301 std::string /* cookies */) |
335 | 302 |
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, | 303 IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus, |
358 int /* status */) | 304 int /* status */) |
359 | 305 |
360 IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_GetCPBrowsingContext, | |
361 uint32 /* context */) | |
362 | |
363 IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) | 306 IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) |
364 | 307 |
365 IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest, | 308 IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest, |
366 std::string /* url */, | 309 std::string /* url */, |
367 std::string /* range_info */, | 310 std::string /* range_info */, |
368 int /* range_request_id */) | 311 int /* range_request_id */) |
369 | 312 |
370 IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading, | 313 IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading, |
371 unsigned long /* resource_id */, | 314 unsigned long /* resource_id */, |
372 bool /* defer */) | 315 bool /* defer */) |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, | 435 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, |
493 std::vector<NPVariant_Param> /* args */, | 436 std::vector<NPVariant_Param> /* args */, |
494 NPVariant_Param /* result_param */, | 437 NPVariant_Param /* result_param */, |
495 bool /* result */) | 438 bool /* result */) |
496 | 439 |
497 IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, | 440 IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, |
498 std::string /* script */, | 441 std::string /* script */, |
499 bool /* popups_allowed */, | 442 bool /* popups_allowed */, |
500 NPVariant_Param /* result_param */, | 443 NPVariant_Param /* result_param */, |
501 bool /* result */) | 444 bool /* result */) |
OLD | NEW |