OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "gpu/command_buffer/common/command_buffer.h" | 5 #include "gpu/command_buffer/common/command_buffer.h" |
6 #include "gpu/ipc/gpu_command_buffer_traits.h" | 6 #include "gpu/ipc/gpu_command_buffer_traits.h" |
7 #include "ipc/ipc_message_macros.h" | 7 #include "ipc/ipc_message_macros.h" |
8 #include "ppapi/c/dev/pp_file_info_dev.h" | 8 #include "ppapi/c/dev/pp_file_info_dev.h" |
9 #include "ppapi/c/ppb_var.h" | 9 #include "ppapi/c/ppb_var.h" |
10 | 10 |
11 #define IPC_MESSAGE_START PpapiMsgStart | 11 #define IPC_MESSAGE_START PpapiMsgStart |
12 | 12 |
13 // These are from the plugin to the renderer | 13 // These are from the plugin to the renderer |
14 // Loads the given plugin. | 14 // Loads the given plugin. |
15 IPC_MESSAGE_CONTROL1(PpapiMsg_LoadPlugin, FilePath /* path */) | 15 IPC_MESSAGE_CONTROL1(PpapiMsg_LoadPlugin, FilePath /* path */) |
16 | 16 |
17 // Creates a channel to talk to a renderer. The plugin will respond with | 17 // Creates a channel to talk to a renderer. The plugin will respond with |
18 // PpapiHostMsg_ChannelCreated. | 18 // PpapiHostMsg_ChannelCreated. |
19 IPC_MESSAGE_CONTROL2(PpapiMsg_CreateChannel, | 19 IPC_MESSAGE_CONTROL2(PpapiMsg_CreateChannel, |
20 base::ProcessHandle /* host_process_handle */, | 20 base::ProcessHandle /* host_process_handle */, |
21 int /* renderer_id */); | 21 int /* renderer_id */); |
22 | 22 |
| 23 // Each plugin may be referenced by multiple renderers. We need the instance |
| 24 // IDs to be unique within a plugin, despite coming from different renderers, |
| 25 // and unique within a renderer, despite going to different plugins. This means |
| 26 // that neither the renderer nor the plugin can generate instance IDs without |
| 27 // consulting the other. |
| 28 // |
| 29 // We resolve this by having the renderer generate a unique instance ID inside |
| 30 // its process. It then asks the plugin to reserve that ID by sending this sync |
| 31 // message. If the plugin has not yet seen this ID, it will remember it as used |
| 32 // (to prevent a race condition if another renderer tries to then use the same |
| 33 // instance), and set usable as true. |
| 34 // |
| 35 // If the plugin has already seen the instance ID, it will set usable as false |
| 36 // and the renderer must retry a new instance ID. |
| 37 IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_ReserveInstanceId, |
| 38 PP_Instance /* instance */, |
| 39 bool /* usable */) |
| 40 |
23 // Sent in both directions to see if the other side supports the given | 41 // Sent in both directions to see if the other side supports the given |
24 // interface. | 42 // interface. |
25 IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_SupportsInterface, | 43 IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_SupportsInterface, |
26 std::string /* interface_name */, | 44 std::string /* interface_name */, |
27 bool /* result */) | 45 bool /* result */) |
28 | 46 |
29 IPC_MESSAGE_CONTROL2(PpapiMsg_ExecuteCallback, | 47 IPC_MESSAGE_CONTROL2(PpapiMsg_ExecuteCallback, |
30 uint32 /* serialized_callback */, | 48 uint32 /* serialized_callback */, |
31 int32 /* param */) | 49 int32 /* param */) |
32 | 50 |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_IsInstanceOfDeprecated, | 701 IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_IsInstanceOfDeprecated, |
684 pp::proxy::SerializedVar /* var */, | 702 pp::proxy::SerializedVar /* var */, |
685 int64 /* object_class */, | 703 int64 /* object_class */, |
686 int64 /* object-data */, | 704 int64 /* object-data */, |
687 PP_Bool /* result */) | 705 PP_Bool /* result */) |
688 IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_CreateObjectDeprecated, | 706 IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_CreateObjectDeprecated, |
689 PP_Instance /* instance */, | 707 PP_Instance /* instance */, |
690 int64 /* object_class */, | 708 int64 /* object_class */, |
691 int64 /* object_data */, | 709 int64 /* object_data */, |
692 pp::proxy::SerializedVar /* result */) | 710 pp::proxy::SerializedVar /* result */) |
OLD | NEW |