| 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 // The following messages are used by all child processes, even though they | 34 // The following messages are used by all child processes, even though they |
| 40 // are listed under PluginProcess. It seems overkill to define ChildProcess. | 35 // are listed under PluginProcess. It seems overkill to define ChildProcess. |
| 41 // Tells the child process it should stop. | 36 // Tells the child process it should stop. |
| 42 IPC_MESSAGE_CONTROL0(PluginProcessMsg_AskBeforeShutdown) | 37 IPC_MESSAGE_CONTROL0(PluginProcessMsg_AskBeforeShutdown) |
| 43 | 38 |
| 44 // Sent in response to PluginProcessHostMsg_ShutdownRequest to tell the child | 39 // Sent in response to PluginProcessHostMsg_ShutdownRequest to tell the child |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 // These are messages sent from the plugin process to the browser process. | 53 // These are messages sent from the plugin process to the browser process. |
| 59 // Response to a PluginProcessMsg_CreateChannel message. | 54 // Response to a PluginProcessMsg_CreateChannel message. |
| 60 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, | 55 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, |
| 61 IPC::ChannelHandle /* channel_handle */) | 56 IPC::ChannelHandle /* channel_handle */) |
| 62 | 57 |
| 63 IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, | 58 IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, |
| 64 std::string /* plugin finder URL */) | 59 std::string /* plugin finder URL */) |
| 65 | 60 |
| 66 IPC_MESSAGE_CONTROL0(PluginProcessHostMsg_ShutdownRequest) | 61 IPC_MESSAGE_CONTROL0(PluginProcessHostMsg_ShutdownRequest) |
| 67 | 62 |
| 68 // 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. | |
| 70 IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginMessage, | |
| 71 std::vector<uint8> /* opaque data */) | |
| 72 | |
| 73 // 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. | |
| 75 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_PluginSyncMessage, | |
| 76 std::vector<uint8> /* opaque data */, | |
| 77 std::vector<uint8> /* opaque data response */) | |
| 78 | |
| 79 // Used to get cookies for the given URL. The request_context is a | |
| 80 // CPBrowsingContext, but is passed as int32 to avoid compilation errors. | |
| 81 IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_GetCookies, | |
| 82 int32 /* request_context */, | |
| 83 GURL /* url */, | |
| 84 std::string /* cookies */) | |
| 85 | |
| 86 // Used by the plugin process to verify that its renderer |renderer_id| has | |
| 87 // permission to access the given |files|. | |
| 88 IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_AccessFiles, | |
| 89 int /* renderer_id */, | |
| 90 std::vector<std::string> /* files */, | |
| 91 bool /* allowed */) | |
| 92 | |
| 93 // Get the list of proxies to use for |url|, as a semicolon delimited list | 63 // Get the list of proxies to use for |url|, as a semicolon delimited list |
| 94 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy | 64 // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy |
| 95 // which does the same thing. | 65 // which does the same thing. |
| 96 IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy, | 66 IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy, |
| 97 GURL /* url */, | 67 GURL /* url */, |
| 98 int /* network error */, | 68 int /* network error */, |
| 99 std::string /* proxy list */) | 69 std::string /* proxy list */) |
| 100 | 70 |
| 101 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
| 102 // Creates a child window of the given parent window on the UI thread. | |
| 103 IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_CreateWindow, | |
| 104 HWND /* parent */, | |
| 105 HWND /* child */) | |
| 106 | |
| 107 // Destroys the given window's parent on the UI thread. | 72 // Destroys the given window's parent on the UI thread. |
| 108 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed, | 73 IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed, |
| 109 HWND /* window */, | 74 HWND /* window */, |
| 110 HWND /* parent */) | 75 HWND /* parent */) |
| 111 | 76 |
| 112 IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, | 77 IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, |
| 113 std::string /* URL */, | 78 std::string /* URL */, |
| 114 int /* process id */, | 79 int /* process id */, |
| 115 HWND /* caller window */) | 80 HWND /* caller window */) |
| 116 #endif | 81 #endif |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, | 314 IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, |
| 350 GURL /* url */, | 315 GURL /* url */, |
| 351 GURL /* first_party_for_cookies */, | 316 GURL /* first_party_for_cookies */, |
| 352 std::string /* cookie */) | 317 std::string /* cookie */) |
| 353 | 318 |
| 354 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, | 319 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, |
| 355 GURL /* url */, | 320 GURL /* url */, |
| 356 GURL /* first_party_for_cookies */, | 321 GURL /* first_party_for_cookies */, |
| 357 std::string /* cookies */) | 322 std::string /* cookies */) |
| 358 | 323 |
| 359 // Asks the browser to show a modal HTML dialog. The dialog is passed the | |
| 360 // given arguments as a JSON string, and returns its result as a JSON string | |
| 361 // through json_retval. | |
| 362 IPC_SYNC_MESSAGE_ROUTED4_1(PluginHostMsg_ShowModalHTMLDialog, | |
| 363 GURL /* url */, | |
| 364 int /* width */, | |
| 365 int /* height */, | |
| 366 std::string /* json_arguments */, | |
| 367 std::string /* json_retval */) | |
| 368 | |
| 369 IPC_SYNC_MESSAGE_ROUTED2_2(PluginHostMsg_GetDragData, | |
| 370 NPVariant_Param /* event */, | |
| 371 bool /* add_data */, | |
| 372 std::vector<NPVariant_Param> /* result_values */, | |
| 373 bool /* result_success */) | |
| 374 | |
| 375 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_SetDropEffect, | |
| 376 NPVariant_Param /* event */, | |
| 377 int /* effect */, | |
| 378 bool /* result_success */) | |
| 379 | |
| 380 IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus, | 324 IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus, |
| 381 int /* status */) | 325 int /* status */) |
| 382 | 326 |
| 383 IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_GetCPBrowsingContext, | |
| 384 uint32 /* context */) | |
| 385 | |
| 386 IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) | 327 IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) |
| 387 | 328 |
| 388 IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest, | 329 IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest, |
| 389 std::string /* url */, | 330 std::string /* url */, |
| 390 std::string /* range_info */, | 331 std::string /* range_info */, |
| 391 int /* range_request_id */) | 332 int /* range_request_id */) |
| 392 | 333 |
| 393 IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading, | 334 IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading, |
| 394 unsigned long /* resource_id */, | 335 unsigned long /* resource_id */, |
| 395 bool /* defer */) | 336 bool /* defer */) |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, | 456 IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, |
| 516 std::vector<NPVariant_Param> /* args */, | 457 std::vector<NPVariant_Param> /* args */, |
| 517 NPVariant_Param /* result_param */, | 458 NPVariant_Param /* result_param */, |
| 518 bool /* result */) | 459 bool /* result */) |
| 519 | 460 |
| 520 IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, | 461 IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, |
| 521 std::string /* script */, | 462 std::string /* script */, |
| 522 bool /* popups_allowed */, | 463 bool /* popups_allowed */, |
| 523 NPVariant_Param /* result_param */, | 464 NPVariant_Param /* result_param */, |
| 524 bool /* result */) | 465 bool /* result */) |
| OLD | NEW |