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 // Multiply-included message header, no traditional include guard. | 5 // Multiply-included message header, no traditional include guard. |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "ppapi/c/pp_bool.h" | 22 #include "ppapi/c/pp_bool.h" |
23 #include "ppapi/c/pp_instance.h" | 23 #include "ppapi/c/pp_instance.h" |
24 #include "ppapi/c/pp_module.h" | 24 #include "ppapi/c/pp_module.h" |
25 #include "ppapi/c/pp_point.h" | 25 #include "ppapi/c/pp_point.h" |
26 #include "ppapi/c/pp_rect.h" | 26 #include "ppapi/c/pp_rect.h" |
27 #include "ppapi/c/pp_resource.h" | 27 #include "ppapi/c/pp_resource.h" |
28 #include "ppapi/c/pp_size.h" | 28 #include "ppapi/c/pp_size.h" |
29 #include "ppapi/proxy/ppapi_param_traits.h" | 29 #include "ppapi/proxy/ppapi_param_traits.h" |
30 #include "ppapi/proxy/serialized_flash_menu.h" | 30 #include "ppapi/proxy/serialized_flash_menu.h" |
31 #include "ppapi/proxy/serialized_structs.h" | 31 #include "ppapi/proxy/serialized_structs.h" |
| 32 #include "ppapi/shared_impl/ppapi_preferences.h" |
32 | 33 |
33 #define IPC_MESSAGE_START PpapiMsgStart | 34 #define IPC_MESSAGE_START PpapiMsgStart |
34 | 35 |
35 IPC_STRUCT_TRAITS_BEGIN(PP_Point) | 36 IPC_STRUCT_TRAITS_BEGIN(PP_Point) |
36 IPC_STRUCT_TRAITS_MEMBER(x) | 37 IPC_STRUCT_TRAITS_MEMBER(x) |
37 IPC_STRUCT_TRAITS_MEMBER(y) | 38 IPC_STRUCT_TRAITS_MEMBER(y) |
38 IPC_STRUCT_TRAITS_END() | 39 IPC_STRUCT_TRAITS_END() |
39 | 40 |
40 IPC_STRUCT_TRAITS_BEGIN(PP_Size) | 41 IPC_STRUCT_TRAITS_BEGIN(PP_Size) |
41 IPC_STRUCT_TRAITS_MEMBER(height) | 42 IPC_STRUCT_TRAITS_MEMBER(height) |
42 IPC_STRUCT_TRAITS_MEMBER(width) | 43 IPC_STRUCT_TRAITS_MEMBER(width) |
43 IPC_STRUCT_TRAITS_END() | 44 IPC_STRUCT_TRAITS_END() |
44 | 45 |
45 IPC_STRUCT_TRAITS_BEGIN(PP_Rect) | 46 IPC_STRUCT_TRAITS_BEGIN(PP_Rect) |
46 IPC_STRUCT_TRAITS_MEMBER(point) | 47 IPC_STRUCT_TRAITS_MEMBER(point) |
47 IPC_STRUCT_TRAITS_MEMBER(size) | 48 IPC_STRUCT_TRAITS_MEMBER(size) |
48 IPC_STRUCT_TRAITS_END() | 49 IPC_STRUCT_TRAITS_END() |
49 | 50 |
| 51 IPC_STRUCT_TRAITS_BEGIN(::ppapi::Preferences) |
| 52 IPC_STRUCT_TRAITS_MEMBER(standard_font_family) |
| 53 IPC_STRUCT_TRAITS_MEMBER(fixed_font_family) |
| 54 IPC_STRUCT_TRAITS_MEMBER(serif_font_family) |
| 55 IPC_STRUCT_TRAITS_MEMBER(sans_serif_font_family) |
| 56 IPC_STRUCT_TRAITS_MEMBER(default_font_size) |
| 57 IPC_STRUCT_TRAITS_MEMBER(default_fixed_font_size) |
| 58 IPC_STRUCT_TRAITS_END() |
| 59 |
50 // These are from the browser to the plugin. | 60 // These are from the browser to the plugin. |
51 // Loads the given plugin. | 61 // Loads the given plugin. |
52 IPC_MESSAGE_CONTROL1(PpapiMsg_LoadPlugin, FilePath /* path */) | 62 IPC_MESSAGE_CONTROL1(PpapiMsg_LoadPlugin, FilePath /* path */) |
53 | 63 |
54 // Creates a channel to talk to a renderer. The plugin will respond with | 64 // Creates a channel to talk to a renderer. The plugin will respond with |
55 // PpapiHostMsg_ChannelCreated. | 65 // PpapiHostMsg_ChannelCreated. |
56 IPC_MESSAGE_CONTROL2(PpapiMsg_CreateChannel, | 66 IPC_MESSAGE_CONTROL2(PpapiMsg_CreateChannel, |
57 base::ProcessHandle /* host_process_handle */, | 67 base::ProcessHandle /* host_process_handle */, |
58 int /* renderer_id */) | 68 int /* renderer_id */) |
59 | 69 |
60 // Each plugin may be referenced by multiple renderers. We need the instance | 70 // Each plugin may be referenced by multiple renderers. We need the instance |
61 // IDs to be unique within a plugin, despite coming from different renderers, | 71 // IDs to be unique within a plugin, despite coming from different renderers, |
62 // and unique within a renderer, despite going to different plugins. This means | 72 // and unique within a renderer, despite going to different plugins. This means |
63 // that neither the renderer nor the plugin can generate instance IDs without | 73 // that neither the renderer nor the plugin can generate instance IDs without |
64 // consulting the other. | 74 // consulting the other. |
65 // | 75 // |
66 // We resolve this by having the renderer generate a unique instance ID inside | 76 // We resolve this by having the renderer generate a unique instance ID inside |
67 // its process. It then asks the plugin to reserve that ID by sending this sync | 77 // its process. It then asks the plugin to reserve that ID by sending this sync |
68 // message. If the plugin has not yet seen this ID, it will remember it as used | 78 // message. If the plugin has not yet seen this ID, it will remember it as used |
69 // (to prevent a race condition if another renderer tries to then use the same | 79 // (to prevent a race condition if another renderer tries to then use the same |
70 // instance), and set usable as true. | 80 // instance), and set usable as true. |
71 // | 81 // |
72 // If the plugin has already seen the instance ID, it will set usable as false | 82 // If the plugin has already seen the instance ID, it will set usable as false |
73 // and the renderer must retry a new instance ID. | 83 // and the renderer must retry a new instance ID. |
74 IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_ReserveInstanceId, | 84 IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_ReserveInstanceId, |
75 PP_Instance /* instance */, | 85 PP_Instance /* instance */, |
76 bool /* usable */) | 86 bool /* usable */) |
77 | 87 |
| 88 // Passes the WebKit preferences to the plugin. |
| 89 IPC_MESSAGE_CONTROL1(PpapiMsg_SetPreferences, |
| 90 ::ppapi::Preferences) |
| 91 |
78 // Sent in both directions to see if the other side supports the given | 92 // Sent in both directions to see if the other side supports the given |
79 // interface. | 93 // interface. |
80 IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_SupportsInterface, | 94 IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_SupportsInterface, |
81 std::string /* interface_name */, | 95 std::string /* interface_name */, |
82 bool /* result */) | 96 bool /* result */) |
83 | 97 |
84 IPC_MESSAGE_CONTROL2(PpapiMsg_ExecuteCallback, | 98 IPC_MESSAGE_CONTROL2(PpapiMsg_ExecuteCallback, |
85 uint32 /* serialized_callback */, | 99 uint32 /* serialized_callback */, |
86 int32 /* param */) | 100 int32 /* param */) |
87 | 101 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 pp::proxy::HostResource /* result */) | 765 pp::proxy::HostResource /* result */) |
752 IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_ResourceCreation_ImageData, | 766 IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_ResourceCreation_ImageData, |
753 PP_Instance /* instance */, | 767 PP_Instance /* instance */, |
754 int32 /* format */, | 768 int32 /* format */, |
755 PP_Size /* size */, | 769 PP_Size /* size */, |
756 PP_Bool /* init_to_zero */, | 770 PP_Bool /* init_to_zero */, |
757 pp::proxy::HostResource /* result_resource */, | 771 pp::proxy::HostResource /* result_resource */, |
758 std::string /* image_data_desc */, | 772 std::string /* image_data_desc */, |
759 pp::proxy::ImageHandle /* result */) | 773 pp::proxy::ImageHandle /* result */) |
760 | 774 |
OLD | NEW |