| 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 "ppapi/c/pp_instance.h" |
| 17 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
| 18 | 18 |
| 19 #define IPC_MESSAGE_START BrowserPluginMsgStart | 19 #define IPC_MESSAGE_START OldBrowserPluginMsgStart |
| 20 | 20 |
| 21 // Browser plugin messages | 21 // Browser plugin messages |
| 22 | 22 |
| 23 // ----------------------------------------------------------------------------- | 23 // ----------------------------------------------------------------------------- |
| 24 // These messages are from the embedder to the browser process | 24 // These messages are from the embedder to the browser process |
| 25 | 25 |
| 26 // 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 |
| 27 // 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 |
| 28 // if necessary. | 28 // if necessary. |
| 29 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_NavigateFromEmbedder, | 29 IPC_MESSAGE_ROUTED3(OldBrowserPluginHostMsg_NavigateFromEmbedder, |
| 30 int /* plugin instance id*/, | 30 int /* plugin instance id*/, |
| 31 long long /* frame id */, | 31 long long /* frame id */, |
| 32 std::string /* src */) | 32 std::string /* src */) |
| 33 | 33 |
| 34 // Initially before we create a guest renderer, browser plugin containers | 34 // Initially before we create a guest renderer, browser plugin containers |
| 35 // have a placeholder called BrowserPlugin where each BrowserPlugin has a unique | 35 // have a placeholder called BrowserPlugin where each BrowserPlugin has a unique |
| 36 // ID. During pepper plugin initialization, the embedder page and the plugin | 36 // ID. During pepper plugin initialization, the embedder page and the plugin |
| 37 // negotiate an ID of type PP_Instance. The browser talks to the guest | 37 // negotiate an ID of type PP_Instance. The browser talks to the guest |
| 38 // RenderView via yet another identifier called the routing ID. The browser | 38 // RenderView via yet another identifier called the routing ID. The browser |
| 39 // has to keep track of how all these identifiers are associated with one | 39 // has to keep track of how all these identifiers are associated with one |
| 40 // another. | 40 // another. |
| 41 // For reference: | 41 // For reference: |
| 42 // 1. The embedder page sees the guest renderer as a plugin and so it talks | 42 // 1. The embedder page sees the guest renderer as a plugin and so it talks |
| 43 // to the guest via the PP_Instance identifer. | 43 // to the guest via the PP_Instance identifer. |
| 44 // 2. The guest renderer talks to the browser and vice versa via a routing ID. | 44 // 2. The guest renderer talks to the browser and vice versa via a routing ID. |
| 45 // 3. The BrowserPlugin ID uniquely identifies a browser plugin container | 45 // 3. The BrowserPlugin ID uniquely identifies a browser plugin container |
| 46 // instance within an embedder. | 46 // instance within an embedder. |
| 47 // This identifier exists prior to the existence of the routing ID and the | 47 // This identifier exists prior to the existence of the routing ID and the |
| 48 // PP_Instance identifier. | 48 // PP_Instance identifier. |
| 49 // The purpose of this message is to tell the browser to map a PP_Instance | 49 // The purpose of this message is to tell the browser to map a PP_Instance |
| 50 // identifier to BrowserPlugin identifier. | 50 // identifier to BrowserPlugin identifier. |
| 51 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_MapInstance, | 51 IPC_MESSAGE_ROUTED2(OldBrowserPluginHostMsg_MapInstance, |
| 52 int /* container_id */, | 52 int /* container_id */, |
| 53 PP_Instance /* instance */) | 53 PP_Instance /* instance */) |
| 54 | 54 |
| 55 // ----------------------------------------------------------------------------- | 55 // ----------------------------------------------------------------------------- |
| 56 // These messages are from the embedder render process to the guest render | 56 // These messages are from the embedder render process to the guest render |
| 57 // process. | 57 // process. |
| 58 | 58 |
| 59 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestReady, | 59 IPC_MESSAGE_CONTROL2(OldBrowserPluginMsg_GuestReady, |
| 60 PP_Instance /* instance */, | 60 PP_Instance /* instance */, |
| 61 int /* embedder_container_id */) | 61 int /* embedder_container_id */) |
| 62 | 62 |
| 63 // ----------------------------------------------------------------------------- | 63 // ----------------------------------------------------------------------------- |
| 64 // These messages are from the guest renderer to the browser process | 64 // These messages are from the guest renderer to the browser process |
| 65 | 65 |
| 66 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_ConnectToChannel, | 66 IPC_MESSAGE_ROUTED1(OldBrowserPluginHostMsg_ConnectToChannel, |
| 67 IPC::ChannelHandle /* handle */) | 67 IPC::ChannelHandle /* handle */) |
| 68 | 68 |
| 69 // A embedder sends this message to the browser when it wants | 69 // A embedder sends this message to the browser when it wants |
| 70 // 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 |
| 71 // according to the new size. | 71 // according to the new size. |
| 72 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ResizeGuest, | 72 IPC_MESSAGE_ROUTED2(OldBrowserPluginHostMsg_ResizeGuest, |
| 73 int32, /* width */ | 73 int32, /* width */ |
| 74 int32 /* height */) | 74 int32 /* height */) |
| 75 | 75 |
| 76 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_NavigateFromGuest, | 76 IPC_MESSAGE_ROUTED2(OldBrowserPluginHostMsg_NavigateFromGuest, |
| 77 PP_Instance /* instance */, | 77 PP_Instance /* instance */, |
| 78 std::string /* src */) | 78 std::string /* src */) |
| 79 | 79 |
| 80 // ----------------------------------------------------------------------------- | 80 // ----------------------------------------------------------------------------- |
| 81 // These messages are from the browser process to the embedder. | 81 // These messages are from the browser process to the embedder. |
| 82 | 82 |
| 83 // A guest instance is ready to be placed. | 83 // A guest instance is ready to be placed. |
| 84 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_LoadGuest, | 84 IPC_MESSAGE_CONTROL3(OldBrowserPluginMsg_LoadGuest, |
| 85 int /* instance_id */, | 85 int /* instance_id */, |
| 86 int /* guest_process_id */, | 86 int /* guest_process_id */, |
| 87 IPC::ChannelHandle /* channel_handle */) | 87 IPC::ChannelHandle /* channel_handle */) |
| 88 | 88 |
| 89 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, | 89 IPC_MESSAGE_CONTROL2(OldBrowserPluginMsg_AdvanceFocus, |
| 90 int /* instance_id */, | 90 int /* instance_id */, |
| 91 bool /* reverse */) | 91 bool /* reverse */) |
| 92 | 92 |
| OLD | NEW |