| 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/process.h" | 10 #include "base/process/process.h" |
| 11 #include "base/values.h" | |
| 12 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 13 #include "content/common/content_param_traits.h" | 12 #include "content/common/content_param_traits.h" |
| 14 #include "content/common/cursors/webcursor.h" | 13 #include "content/common/cursors/webcursor.h" |
| 15 #include "content/common/edit_command.h" | 14 #include "content/common/edit_command.h" |
| 16 #include "content/common/frame_param_macros.h" | 15 #include "content/common/frame_param_macros.h" |
| 17 #include "content/public/common/common_param_traits.h" | 16 #include "content/public/common/common_param_traits.h" |
| 18 #include "content/public/common/drop_data.h" | 17 #include "content/public/common/drop_data.h" |
| 19 #include "ipc/ipc_channel_handle.h" | 18 #include "ipc/ipc_channel_handle.h" |
| 20 #include "ipc/ipc_message_macros.h" | 19 #include "ipc/ipc_message_macros.h" |
| 21 #include "ipc/ipc_message_utils.h" | 20 #include "ipc/ipc_message_utils.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 IPC_STRUCT_END() | 75 IPC_STRUCT_END() |
| 77 | 76 |
| 78 // Browser plugin messages | 77 // Browser plugin messages |
| 79 | 78 |
| 80 // ----------------------------------------------------------------------------- | 79 // ----------------------------------------------------------------------------- |
| 81 // These messages are from the embedder to the browser process. | 80 // These messages are from the embedder to the browser process. |
| 82 | 81 |
| 83 // This message is sent from BrowserPlugin to BrowserPluginGuest to issue an | 82 // This message is sent from BrowserPlugin to BrowserPluginGuest to issue an |
| 84 // edit command. | 83 // edit command. |
| 85 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ExecuteEditCommand, | 84 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ExecuteEditCommand, |
| 86 int /* instance_id */, | 85 int /* browser_plugin_instance_id */, |
| 87 std::string /* command */) | 86 std::string /* command */) |
| 88 | 87 |
| 89 // This message must be sent just before sending a key event. | 88 // This message must be sent just before sending a key event. |
| 90 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent, | 89 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent, |
| 91 int /* instance_id */, | 90 int /* browser_plugin_instance_id */, |
| 92 std::vector<content::EditCommand> /* edit_commands */) | 91 std::vector<content::EditCommand> /* edit_commands */) |
| 93 | 92 |
| 94 // This message is sent from BrowserPlugin to BrowserPluginGuest whenever IME | 93 // This message is sent from BrowserPlugin to BrowserPluginGuest whenever IME |
| 95 // composition state is updated. | 94 // composition state is updated. |
| 96 IPC_MESSAGE_ROUTED5( | 95 IPC_MESSAGE_ROUTED5( |
| 97 BrowserPluginHostMsg_ImeSetComposition, | 96 BrowserPluginHostMsg_ImeSetComposition, |
| 98 int /* instance_id */, | 97 int /* browser_plugin_instance_id */, |
| 99 std::string /* text */, | 98 std::string /* text */, |
| 100 std::vector<blink::WebCompositionUnderline> /* underlines */, | 99 std::vector<blink::WebCompositionUnderline> /* underlines */, |
| 101 int /* selectiont_start */, | 100 int /* selectiont_start */, |
| 102 int /* selection_end */) | 101 int /* selection_end */) |
| 103 | 102 |
| 104 // This message is sent from BrowserPlugin to BrowserPluginGuest to notify that | 103 // This message is sent from BrowserPlugin to BrowserPluginGuest to notify that |
| 105 // confirming the current composition is requested. | 104 // confirming the current composition is requested. |
| 106 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_ImeConfirmComposition, | 105 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_ImeConfirmComposition, |
| 107 int /* instance_id */, | 106 int /* browser_plugin_instance_id */, |
| 108 std::string /* text */, | 107 std::string /* text */, |
| 109 bool /* keep selection */) | 108 bool /* keep selection */) |
| 110 | 109 |
| 111 // Deletes the current selection plus the specified number of characters before | 110 // Deletes the current selection plus the specified number of characters before |
| 112 // and after the selection or caret. | 111 // and after the selection or caret. |
| 113 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_ExtendSelectionAndDelete, | 112 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_ExtendSelectionAndDelete, |
| 114 int /* instance_id */, | 113 int /* browser_plugin_instance_id */, |
| 115 int /* before */, | 114 int /* before */, |
| 116 int /* after */) | 115 int /* after */) |
| 117 | 116 |
| 118 // This message is sent to the browser process to indicate that a BrowserPlugin | 117 // This message is sent to the browser process to indicate that a BrowserPlugin |
| 119 // has taken ownership of the lifetime of the guest of the given |instance_id|. | 118 // has taken ownership of the lifetime of the guest of the given |
| 120 // |params| is the state of the BrowserPlugin taking ownership of | 119 // |browser_plugin_instance_id|. |params| is the state of the BrowserPlugin |
| 121 // the guest. If a guest doesn't already exist with the given |instance_id|, | 120 // taking ownership of the guest. |
| 122 // a new one will be created. | 121 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_Attach, |
| 123 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_Attach, | 122 int /* browser_plugin_instance_id */, |
| 124 int /* instance_id */, | 123 BrowserPluginHostMsg_Attach_Params /* params */) |
| 125 BrowserPluginHostMsg_Attach_Params /* params */, | |
| 126 base::DictionaryValue /* extra_params */) | |
| 127 | 124 |
| 128 // Tells the guest to focus or defocus itself. | 125 // Tells the guest to focus or defocus itself. |
| 129 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus, | 126 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus, |
| 130 int /* instance_id */, | 127 int /* browser_plugin_instance_id */, |
| 131 bool /* enable */) | 128 bool /* enable */) |
| 132 | 129 |
| 133 // Sends an input event to the guest. | 130 // Sends an input event to the guest. |
| 134 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_HandleInputEvent, | 131 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_HandleInputEvent, |
| 135 int /* instance_id */, | 132 int /* browser_plugin_instance_id */, |
| 136 gfx::Rect /* guest_window_rect */, | 133 gfx::Rect /* guest_window_rect */, |
| 137 IPC::WebInputEventPointer /* event */) | 134 IPC::WebInputEventPointer /* event */) |
| 138 | 135 |
| 139 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_CopyFromCompositingSurfaceAck, | 136 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_CopyFromCompositingSurfaceAck, |
| 140 int /* instance_id */, | 137 int /* browser_plugin_instance_id */, |
| 141 int /* request_id */, | 138 int /* request_id */, |
| 142 SkBitmap) | 139 SkBitmap) |
| 143 | 140 |
| 144 // Notify the guest renderer that some resources given to the embededer | 141 // Notify the guest renderer that some resources given to the embededer |
| 145 // are not used any more. | 142 // are not used any more. |
| 146 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ReclaimCompositorResources, | 143 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ReclaimCompositorResources, |
| 147 int /* instance_id */, | 144 int /* browser_plugin_instance_id */, |
| 148 FrameHostMsg_ReclaimCompositorResources_Params /* params */) | 145 FrameHostMsg_ReclaimCompositorResources_Params /* params */) |
| 149 | 146 |
| 150 // When a BrowserPlugin has been removed from the embedder's DOM, it informs | 147 // When a BrowserPlugin has been removed from the embedder's DOM, it informs |
| 151 // the browser process to cleanup the guest. | 148 // the browser process to cleanup the guest. |
| 152 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_PluginDestroyed, | 149 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_PluginDestroyed, |
| 153 int /* instance_id */) | 150 int /* browser_plugin_instance_id */) |
| 154 | 151 |
| 155 // Tells the guest it has been shown or hidden. | 152 // Tells the guest it has been shown or hidden. |
| 156 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetVisibility, | 153 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetVisibility, |
| 157 int /* instance_id */, | 154 int /* browser_plugin_instance_id */, |
| 158 bool /* visible */) | 155 bool /* visible */) |
| 159 | 156 |
| 160 // Tells the guest to change its background opacity. | 157 // Tells the guest to change its background opacity. |
| 161 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetContentsOpaque, | 158 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetContentsOpaque, |
| 162 int /* instance_id */, | 159 int /* browser_plugin_instance_id */, |
| 163 bool /* opaque */) | 160 bool /* opaque */) |
| 164 | 161 |
| 165 // Tells the guest that a drag event happened on the plugin. | 162 // Tells the guest that a drag event happened on the plugin. |
| 166 IPC_MESSAGE_ROUTED5(BrowserPluginHostMsg_DragStatusUpdate, | 163 IPC_MESSAGE_ROUTED5(BrowserPluginHostMsg_DragStatusUpdate, |
| 167 int /* instance_id */, | 164 int /* browser_plugin_instance_id */, |
| 168 blink::WebDragStatus /* drag_status */, | 165 blink::WebDragStatus /* drag_status */, |
| 169 content::DropData /* drop_data */, | 166 content::DropData /* drop_data */, |
| 170 blink::WebDragOperationsMask /* operation_mask */, | 167 blink::WebDragOperationsMask /* operation_mask */, |
| 171 gfx::Point /* plugin_location */) | 168 gfx::Point /* plugin_location */) |
| 172 | 169 |
| 173 // Sends a PointerLock Lock ACK to the BrowserPluginGuest. | 170 // Sends a PointerLock Lock ACK to the BrowserPluginGuest. |
| 174 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_LockMouse_ACK, | 171 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_LockMouse_ACK, |
| 175 int /* instance_id */, | 172 int /* browser_plugin_instance_id */, |
| 176 bool /* succeeded */) | 173 bool /* succeeded */) |
| 177 | 174 |
| 178 // Sends a PointerLock Unlock ACK to the BrowserPluginGuest. | 175 // Sends a PointerLock Unlock ACK to the BrowserPluginGuest. |
| 179 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_UnlockMouse_ACK, int /* instance_id */) | 176 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_UnlockMouse_ACK, |
| 177 int /* browser_plugin_instance_id */) |
| 180 | 178 |
| 181 // Sent when plugin's position has changed without UpdateRect. | 179 // Sent when plugin's position has changed without UpdateRect. |
| 182 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_UpdateGeometry, | 180 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_UpdateGeometry, |
| 183 int /* instance_id */, | 181 int /* browser_plugin_instance_id */, |
| 184 gfx::Rect /* view_rect */) | 182 gfx::Rect /* view_rect */) |
| 185 | 183 |
| 186 // ----------------------------------------------------------------------------- | 184 // ----------------------------------------------------------------------------- |
| 187 // These messages are from the guest renderer to the browser process | 185 // These messages are from the guest renderer to the browser process |
| 188 | 186 |
| 189 // A embedder sends this message to the browser when it wants | 187 // A embedder sends this message to the browser when it wants |
| 190 // to resize a guest plugin container so that the guest is relaid out | 188 // to resize a guest plugin container so that the guest is relaid out |
| 191 // according to the new size. | 189 // according to the new size. |
| 192 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ResizeGuest, | 190 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ResizeGuest, |
| 193 int /* instance_id*/, | 191 int /* browser_plugin_instance_id*/, |
| 194 BrowserPluginHostMsg_ResizeGuest_Params) | 192 BrowserPluginHostMsg_ResizeGuest_Params) |
| 195 | 193 |
| 196 // ----------------------------------------------------------------------------- | 194 // ----------------------------------------------------------------------------- |
| 197 // These messages are from the browser process to the embedder. | 195 // These messages are from the browser process to the embedder. |
| 198 | 196 |
| 199 // This message is sent in response to a completed attachment of a guest | 197 // This message is sent in response to a completed attachment of a guest |
| 200 // to a BrowserPlugin. | 198 // to a BrowserPlugin. |
| 201 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_Attach_ACK, int /* instance_id */) | 199 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_Attach_ACK, |
| 200 int /* browser_plugin_instance_id */) |
| 202 | 201 |
| 203 // Once the swapped out guest RenderView has been created in the embedder render | 202 // Once the swapped out guest RenderView has been created in the embedder render |
| 204 // process, the browser process informs the embedder of its routing ID. | 203 // process, the browser process informs the embedder of its routing ID. |
| 205 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestContentWindowReady, | 204 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestContentWindowReady, |
| 206 int /* instance_id */, | 205 int /* browser_plugin_instance_id */, |
| 207 int /* source_routing_id */) | 206 int /* source_routing_id */) |
| 208 | 207 |
| 209 // When the guest crashes, the browser process informs the embedder through this | 208 // When the guest crashes, the browser process informs the embedder through this |
| 210 // message. | 209 // message. |
| 211 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_GuestGone, | 210 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_GuestGone, |
| 212 int /* instance_id */) | 211 int /* browser_plugin_instance_id */) |
| 213 | 212 |
| 214 // When the user tabs to the end of the tab stops of a guest, the browser | 213 // When the user tabs to the end of the tab stops of a guest, the browser |
| 215 // process informs the embedder to tab out of the browser plugin. | 214 // process informs the embedder to tab out of the browser plugin. |
| 216 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, | 215 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, |
| 217 int /* instance_id */, | 216 int /* browser_plugin_instance_id */, |
| 218 bool /* reverse */) | 217 bool /* reverse */) |
| 219 | 218 |
| 220 // When the guest starts/stops listening to touch events, it needs to notify the | 219 // When the guest starts/stops listening to touch events, it needs to notify the |
| 221 // plugin in the embedder about it. | 220 // plugin in the embedder about it. |
| 222 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_ShouldAcceptTouchEvents, | 221 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_ShouldAcceptTouchEvents, |
| 223 int /* instance_id */, | 222 int /* browser_plugin_instance_id */, |
| 224 bool /* accept */) | 223 bool /* accept */) |
| 225 | 224 |
| 226 // Inform the embedder of the cursor the guest wishes to display. | 225 // Inform the embedder of the cursor the guest wishes to display. |
| 227 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_SetCursor, | 226 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_SetCursor, |
| 228 int /* instance_id */, | 227 int /* browser_plugin_instance_id */, |
| 229 content::WebCursor /* cursor */) | 228 content::WebCursor /* cursor */) |
| 230 | 229 |
| 231 // The guest has damage it wants to convey to the embedder so that it can | 230 // The guest has damage it wants to convey to the embedder so that it can |
| 232 // update its backing store. | 231 // update its backing store. |
| 233 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_UpdateRect, | 232 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_UpdateRect, |
| 234 int /* instance_id */, | 233 int /* browser_plugin_instance_id */, |
| 235 BrowserPluginMsg_UpdateRect_Params) | 234 BrowserPluginMsg_UpdateRect_Params) |
| 236 | 235 |
| 237 IPC_MESSAGE_CONTROL4(BrowserPluginMsg_CopyFromCompositingSurface, | 236 IPC_MESSAGE_CONTROL4(BrowserPluginMsg_CopyFromCompositingSurface, |
| 238 int /* instance_id */, | 237 int /* browser_plugin_instance_id */, |
| 239 int /* request_id */, | 238 int /* request_id */, |
| 240 gfx::Rect /* source_rect */, | 239 gfx::Rect /* source_rect */, |
| 241 gfx::Size /* dest_size */) | 240 gfx::Size /* dest_size */) |
| 242 | 241 |
| 243 // Guest renders into an FBO with textures provided by the embedder. | 242 // Guest renders into an FBO with textures provided by the embedder. |
| 244 // BrowserPlugin shares mostly the same logic as out-of-process RenderFrames but | 243 // BrowserPlugin shares mostly the same logic as out-of-process RenderFrames but |
| 245 // because BrowserPlugins implement custom a second level of routing logic, | 244 // because BrowserPlugins implement custom a second level of routing logic, |
| 246 // the IPCs need to be annotated with an extra instance_id. These messages | 245 // the IPCs need to be annotated with an extra browser_plugin_instance_id. These |
| 247 // provide that extra id. | 246 // messages provide that extra id. |
| 248 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_BuffersSwapped, | 247 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_BuffersSwapped, |
| 249 int /* instance_id */, | 248 int /* browser_plugin_instance_id */, |
| 250 FrameMsg_BuffersSwapped_Params /* params */) | 249 FrameMsg_BuffersSwapped_Params /* params */) |
| 251 | 250 |
| 252 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_CompositorFrameSwapped, | 251 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_CompositorFrameSwapped, |
| 253 int /* instance_id */, | 252 int /* browser_plugin_instance_id */, |
| 254 FrameMsg_CompositorFrameSwapped_Params /* params */) | 253 FrameMsg_CompositorFrameSwapped_Params /* params */) |
| 255 | 254 |
| 256 // Forwards a PointerLock Unlock request to the BrowserPlugin. | 255 // Forwards a PointerLock Unlock request to the BrowserPlugin. |
| 257 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_SetMouseLock, | 256 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_SetMouseLock, |
| 258 int /* instance_id */, | 257 int /* browser_plugin_instance_id */, |
| 259 bool /* enable */) | 258 bool /* enable */) |
| 260 | 259 |
| 261 // See comment about BrowserPluginMsg_BuffersSwapped and | 260 // See comment about BrowserPluginMsg_BuffersSwapped and |
| 262 // BrowserPluginMsg_CompositorFrameSwapped for how these related | 261 // BrowserPluginMsg_CompositorFrameSwapped for how these related |
| 263 // to the FrameHostMsg variants. | 262 // to the FrameHostMsg variants. |
| 264 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_BuffersSwappedACK, | 263 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_BuffersSwappedACK, |
| 265 FrameHostMsg_BuffersSwappedACK_Params /* params */) | 264 FrameHostMsg_BuffersSwappedACK_Params /* params */) |
| 266 | 265 |
| 267 // Acknowledge that we presented an ubercomp frame. | 266 // Acknowledge that we presented an ubercomp frame. |
| 268 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_CompositorFrameSwappedACK, | 267 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_CompositorFrameSwappedACK, |
| 269 int /* instance_id */, | 268 int /* browser_plugin_instance_id */, |
| 270 FrameHostMsg_CompositorFrameSwappedACK_Params /* params */) | 269 FrameHostMsg_CompositorFrameSwappedACK_Params /* params */) |
| OLD | NEW |