OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Multiply-included message header, no traditional include guard. | 5 // Multiply-included message header, no traditional include guard. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/process.h" | 10 #include "base/process.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "content/public/common/common_param_traits.h" | 12 #include "content/public/common/common_param_traits.h" |
13 #include "ipc/ipc_channel_handle.h" | 13 #include "ipc/ipc_channel_handle.h" |
14 #include "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
15 #include "ipc/ipc_message_utils.h" | 15 #include "ipc/ipc_message_utils.h" |
| 16 #include "ppapi/c/pp_instance.h" |
16 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
17 | 18 |
18 #define IPC_MESSAGE_START BrowserPluginMsgStart | 19 #define IPC_MESSAGE_START BrowserPluginMsgStart |
19 | 20 |
20 // Browser plugin messages | 21 // Browser plugin messages |
21 | 22 |
22 // ----------------------------------------------------------------------------- | 23 // ----------------------------------------------------------------------------- |
23 // These messages are from the host renderer to the browser process | 24 // These messages are from the embedder to the browser process |
24 | 25 |
25 // A renderer sends this to the browser process when it wants to | 26 // A renderer sends this to the browser process when it wants to |
26 // create a browser plugin. The browser will create a guest renderer process | 27 // create a browser plugin. The browser will create a guest renderer process |
27 // if necessary. | 28 // if necessary. |
28 IPC_MESSAGE_ROUTED4(BrowserPluginHostMsg_OpenChannel, | 29 IPC_MESSAGE_ROUTED4(BrowserPluginHostMsg_NavigateFromEmbedder, |
29 int /* plugin instance id*/, | 30 int /* plugin instance id*/, |
30 long long /* frame id */, | 31 long long /* frame id */, |
31 std::string /* src */, | 32 std::string /* src */, |
32 gfx::Size /* size */) | 33 gfx::Size /* size */) |
33 | 34 |
| 35 // Initially before we create a guest renderer, browser plugin containers |
| 36 // have a placeholder called BrowserPlugin where each BrowserPlugin has a unique |
| 37 // ID. During pepper plugin initialization, the embedder page and the plugin |
| 38 // negotiate an ID of type PP_Instance. The browser talks to the guest |
| 39 // RenderView via yet another identifier called the routing ID. The browser |
| 40 // has to keep track of how all these identifiers are associated with one |
| 41 // another. |
| 42 // For reference: |
| 43 // 1. The embedder page sees the guest renderer as a plugin and so it talks |
| 44 // to the guest via the PP_Instance identifer. |
| 45 // 2. The guest renderer talks to the browser and vice versa via a routing ID. |
| 46 // 3. The BrowserPlugin ID uniquely identifies a browser plugin container |
| 47 // instance within an embedder. |
| 48 // This identifier exists prior to the existence of the routing ID and the |
| 49 // PP_Instance identifier. |
| 50 // The purpose of this message is to tell the browser to map a PP_Instance |
| 51 // identifier to BrowserPlugin identifier. |
| 52 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_MapInstance, |
| 53 int /* container_id */, |
| 54 PP_Instance /* instance */) |
| 55 |
34 // ----------------------------------------------------------------------------- | 56 // ----------------------------------------------------------------------------- |
35 // These messages are from the browser process to the guest renderer. | 57 // These messages are from the browser process to the guest renderer. |
36 | 58 |
37 // Creates a channel to talk to a renderer. The guest renderer will respond | 59 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_CompleteNavigation, |
38 // with BrowserPluginHostMsg_ChannelCreated. | 60 int /* guest_routing_id */, |
39 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_CreateChannel, | 61 PP_Instance /* instance */) |
40 base::ProcessHandle /* host_renderer_process_handle */, | |
41 int /* host_renderer_id */) | |
42 | 62 |
43 // ----------------------------------------------------------------------------- | 63 // ----------------------------------------------------------------------------- |
44 // These messages are from the guest renderer to the browser process | 64 // These messages are from the guest renderer to the browser process |
45 | 65 |
46 // Reply to BrowserPluginMsg_CreateChannel. The handle will be NULL if the | 66 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_ConnectToChannel, |
47 // channel could not be established. This could be because the IPC could not be | 67 IPC::ChannelHandle /* handle */) |
48 // created for some weird reason, but more likely that the renderer failed to | |
49 // initialize properly. | |
50 IPC_MESSAGE_CONTROL1(BrowserPluginHostMsg_ChannelCreated, | |
51 IPC::ChannelHandle /* handle */) | |
52 | 68 |
53 // Indicates the guest renderer is ready in response to a ViewMsg_New | 69 // A embedder sends this message to the browser when it wants |
54 IPC_MESSAGE_ROUTED0(BrowserPluginHostMsg_GuestReady) | |
55 | |
56 // A host renderer sends this message to the browser when it wants | |
57 // to resize a guest plugin container so that the guest is relaid out | 70 // to resize a guest plugin container so that the guest is relaid out |
58 // according to the new size. | 71 // according to the new size. |
59 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ResizeGuest, | 72 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ResizeGuest, |
60 int32, /* width */ | 73 int32, /* width */ |
61 int32 /* height */) | 74 int32 /* height */) |
62 | 75 |
| 76 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_NavigateFromGuest, |
| 77 PP_Instance /* instance */, |
| 78 std::string /* src */) |
| 79 |
63 // ----------------------------------------------------------------------------- | 80 // ----------------------------------------------------------------------------- |
64 // These messages are from the browser process to the host renderer. | 81 // These messages are from the browser process to the embedder. |
65 | 82 |
66 // A guest instance is ready to be placed. | 83 // A guest instance is ready to be placed. |
67 IPC_MESSAGE_ROUTED3(BrowserPluginMsg_GuestReady_ACK, | 84 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_LoadGuest, |
68 int /* instance id */, | 85 int /* instance id */, |
69 base::ProcessHandle /* plugin_process_handle */, | 86 int /* guest_process_id */, |
70 IPC::ChannelHandle /* handle to channel */) | 87 IPC::ChannelHandle /* channel_handle */) |
71 | 88 |
72 | |
OLD | NEW |