OLD | NEW |
1 // Copyright (c) 2010 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 #ifndef PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | 5 #ifndef PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
6 #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | 6 #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "ipc/ipc_platform_file.h" |
13 #include "ppapi/c/pp_bool.h" | 14 #include "ppapi/c/pp_bool.h" |
14 #include "ppapi/c/pp_instance.h" | 15 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_point.h" | 16 #include "ppapi/c/pp_point.h" |
16 #include "ppapi/c/pp_rect.h" | 17 #include "ppapi/c/pp_rect.h" |
17 #include "ppapi/c/pp_resource.h" | 18 #include "ppapi/proxy/host_resource.h" |
18 #include "ppapi/proxy/serialized_var.h" | 19 #include "ppapi/proxy/serialized_var.h" |
19 | 20 |
20 struct PP_FontDescription_Dev; | 21 struct PP_FontDescription_Dev; |
21 | 22 |
22 namespace pp { | 23 namespace pp { |
23 namespace proxy { | 24 namespace proxy { |
24 | 25 |
25 class Dispatcher; | 26 class Dispatcher; |
26 | 27 |
27 // PP_FontDescript_Dev has to be redefined with a SerializedVar in place of | 28 // PP_FontDescript_Dev has to be redefined with a SerializedVar in place of |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 struct SerializedDirEntry { | 68 struct SerializedDirEntry { |
68 std::string name; | 69 std::string name; |
69 bool is_dir; | 70 bool is_dir; |
70 }; | 71 }; |
71 | 72 |
72 // Since there are so many parameters, DrawTextAt requires this separate | 73 // Since there are so many parameters, DrawTextAt requires this separate |
73 // structure. This includes everything but the font name. Because the font name | 74 // structure. This includes everything but the font name. Because the font name |
74 // is a var, it's much more convenient to use the normal way of passing a | 75 // is a var, it's much more convenient to use the normal way of passing a |
75 // PP_Var. | 76 // PP_Var. |
76 struct PPBFont_DrawTextAt_Params { | 77 struct PPBFont_DrawTextAt_Params { |
77 PP_Resource font; | 78 HostResource font; |
78 PP_Resource image_data; | 79 HostResource image_data; |
79 PP_Bool text_is_rtl; | 80 PP_Bool text_is_rtl; |
80 PP_Bool override_direction; | 81 PP_Bool override_direction; |
81 PP_Point position; | 82 PP_Point position; |
82 uint32_t color; | 83 uint32_t color; |
83 PP_Rect clip; | 84 PP_Rect clip; |
84 bool clip_is_null; | 85 bool clip_is_null; |
85 PP_Bool image_data_is_opaque; | 86 PP_Bool image_data_is_opaque; |
86 }; | 87 }; |
87 | 88 |
88 struct PPBFlash_DrawGlyphs_Params { | 89 struct PPBFlash_DrawGlyphs_Params { |
89 PPBFlash_DrawGlyphs_Params(); | 90 PPBFlash_DrawGlyphs_Params(); |
90 ~PPBFlash_DrawGlyphs_Params(); | 91 ~PPBFlash_DrawGlyphs_Params(); |
91 | 92 |
92 PP_Instance instance; | 93 PP_Instance instance; |
93 PP_Resource pp_image_data; | 94 HostResource image_data; |
94 SerializedFontDescription font_desc; | 95 SerializedFontDescription font_desc; |
95 uint32_t color; | 96 uint32_t color; |
96 PP_Point position; | 97 PP_Point position; |
97 PP_Rect clip; | 98 PP_Rect clip; |
98 float transformation[3][3]; | 99 float transformation[3][3]; |
99 std::vector<uint16_t> glyph_indices; | 100 std::vector<uint16_t> glyph_indices; |
100 std::vector<PP_Point> glyph_advances; | 101 std::vector<PP_Point> glyph_advances; |
101 }; | 102 }; |
102 | 103 |
| 104 struct PPBAudio_NotifyAudioStreamCreated_Params { |
| 105 pp::proxy::HostResource audio_id; |
| 106 int32_t result_code; // Will be != PP_OK on failure |
| 107 IPC::PlatformFileForTransit socket_handle; |
| 108 base::SharedMemoryHandle handle; |
| 109 int32_t length; |
| 110 }; |
| 111 |
| 112 struct PPBURLLoader_UpdateProgress_Params { |
| 113 PP_Instance instance; |
| 114 pp::proxy::HostResource resource; |
| 115 int64_t bytes_sent; |
| 116 int64_t total_bytes_to_be_sent; |
| 117 int64_t bytes_received; |
| 118 int64_t total_bytes_to_be_received; |
| 119 }; |
| 120 |
103 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
104 typedef HANDLE ImageHandle; | 122 typedef HANDLE ImageHandle; |
105 #elif defined(OS_MACOSX) | 123 #elif defined(OS_MACOSX) |
106 typedef base::SharedMemoryHandle ImageHandle; | 124 typedef base::SharedMemoryHandle ImageHandle; |
107 #else | 125 #else |
108 // On X Windows this is a SysV shared memory key. | 126 // On X Windows this is a SysV shared memory key. |
109 typedef int ImageHandle; | 127 typedef int ImageHandle; |
110 #endif | 128 #endif |
111 | 129 |
112 } // namespace proxy | 130 } // namespace proxy |
113 } // namespace pp | 131 } // namespace pp |
114 | 132 |
115 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | 133 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |
OLD | NEW |