[email protected] | a0e1adc5 | 2012-01-27 07:21:13 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | ||||
6 | #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_ | ||||
7 | |||||
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 8 | #include <stdint.h> |
9 | |||||
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 10 | #include <string> |
11 | #include <vector> | ||||
12 | |||||
[email protected] | 246fc49 | 2012-08-27 20:28:18 | [diff] [blame] | 13 | #include "base/logging.h" |
[email protected] | 8299b71 | 2013-07-17 19:55:23 | [diff] [blame] | 14 | #include "base/memory/shared_memory.h" |
[email protected] | 3acbbae4 | 2010-12-08 07:50:40 | [diff] [blame] | 15 | #include "build/build_config.h" |
[email protected] | 725056b7 | 2013-03-16 09:57:51 | [diff] [blame] | 16 | #include "ppapi/c/dev/ppb_truetype_font_dev.h" |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 17 | #include "ppapi/c/pp_bool.h" |
lionel.g.landwerlin | 764a8c9 | 2015-11-19 01:48:08 | [diff] [blame] | 18 | #include "ppapi/c/pp_codecs.h" |
[email protected] | 859a7f3 | 2011-01-15 03:44:13 | [diff] [blame] | 19 | #include "ppapi/c/pp_instance.h" |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 20 | #include "ppapi/c/pp_point.h" |
21 | #include "ppapi/c/pp_rect.h" | ||||
[email protected] | 86fbad28 | 2013-09-22 06:34:03 | [diff] [blame] | 22 | #include "ppapi/c/ppb_network_list.h" |
[email protected] | 07d0a6bf | 2013-09-17 04:15:10 | [diff] [blame] | 23 | #include "ppapi/c/private/ppb_net_address_private.h" |
[email protected] | cb65f13 | 2012-10-09 17:06:09 | [diff] [blame] | 24 | #include "ppapi/proxy/ppapi_proxy_export.h" |
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 25 | #include "ppapi/shared_impl/host_resource.h" |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 26 | |
[email protected] | d0e3b4a | 2012-12-07 22:31:44 | [diff] [blame] | 27 | struct PP_BrowserFont_Trusted_Description; |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 28 | |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 29 | namespace ppapi { |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 30 | namespace proxy { |
31 | |||||
thestig | d8ecc84 | 2015-11-02 22:29:06 | [diff] [blame] | 32 | // PP_BrowserFontDescription has to be redefined with a string in place of the |
33 | // PP_Var used for the face name. | ||||
[email protected] | f0a04c4 | 2011-08-26 22:43:20 | [diff] [blame] | 34 | struct PPAPI_PROXY_EXPORT SerializedFontDescription { |
[email protected] | aa20e06 | 2010-12-07 23:07:27 | [diff] [blame] | 35 | SerializedFontDescription(); |
36 | ~SerializedFontDescription(); | ||||
37 | |||||
[email protected] | d0e3b4a | 2012-12-07 22:31:44 | [diff] [blame] | 38 | void SetFromPPBrowserFontDescription( |
39 | const PP_BrowserFont_Trusted_Description& desc); | ||||
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 40 | |
[email protected] | d0e3b4a | 2012-12-07 22:31:44 | [diff] [blame] | 41 | void SetToPPBrowserFontDescription( |
42 | PP_BrowserFont_Trusted_Description* desc) const; | ||||
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 43 | |
[email protected] | cb65f13 | 2012-10-09 17:06:09 | [diff] [blame] | 44 | std::string face; |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 45 | int32_t family; |
46 | uint32_t size; | ||||
47 | int32_t weight; | ||||
48 | PP_Bool italic; | ||||
49 | PP_Bool small_caps; | ||||
50 | int32_t letter_spacing; | ||||
51 | int32_t word_spacing; | ||||
52 | }; | ||||
53 | |||||
[email protected] | 07d0a6bf | 2013-09-17 04:15:10 | [diff] [blame] | 54 | struct PPAPI_PROXY_EXPORT SerializedNetworkInfo { |
55 | SerializedNetworkInfo(); | ||||
56 | ~SerializedNetworkInfo(); | ||||
57 | |||||
58 | std::string name; | ||||
[email protected] | 86fbad28 | 2013-09-22 06:34:03 | [diff] [blame] | 59 | PP_NetworkList_Type type; |
60 | PP_NetworkList_State state; | ||||
[email protected] | 07d0a6bf | 2013-09-17 04:15:10 | [diff] [blame] | 61 | std::vector<PP_NetAddress_Private> addresses; |
62 | std::string display_name; | ||||
63 | int mtu; | ||||
64 | }; | ||||
65 | typedef std::vector<SerializedNetworkInfo> SerializedNetworkList; | ||||
66 | |||||
[email protected] | 725056b7 | 2013-03-16 09:57:51 | [diff] [blame] | 67 | struct PPAPI_PROXY_EXPORT SerializedTrueTypeFontDesc { |
68 | SerializedTrueTypeFontDesc(); | ||||
69 | ~SerializedTrueTypeFontDesc(); | ||||
70 | |||||
71 | // Sets this to correspond to the contents of a PP_TrueTypeFontDesc_Dev. | ||||
72 | // | ||||
73 | // The reference count of the desc.family PP_Var will be unchanged and the | ||||
74 | // caller is responsible for releasing it. | ||||
75 | void SetFromPPTrueTypeFontDesc(const PP_TrueTypeFontDesc_Dev& desc); | ||||
76 | |||||
thestig | d8ecc84 | 2015-11-02 22:29:06 | [diff] [blame] | 77 | // Converts this to a PP_TrueTypeFontDesc_Dev. |
[email protected] | 725056b7 | 2013-03-16 09:57:51 | [diff] [blame] | 78 | // |
79 | // The desc.family PP_Var will have one reference assigned to it. The caller | ||||
80 | // is responsible for releasing it. | ||||
81 | void CopyToPPTrueTypeFontDesc(PP_TrueTypeFontDesc_Dev* desc) const; | ||||
82 | |||||
83 | std::string family; | ||||
84 | PP_TrueTypeFontFamily_Dev generic_family; | ||||
85 | PP_TrueTypeFontStyle_Dev style; | ||||
86 | PP_TrueTypeFontWeight_Dev weight; | ||||
87 | PP_TrueTypeFontWidth_Dev width; | ||||
88 | PP_TrueTypeFontCharset_Dev charset; | ||||
89 | }; | ||||
90 | |||||
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 91 | struct SerializedDirEntry { |
92 | std::string name; | ||||
93 | bool is_dir; | ||||
94 | }; | ||||
95 | |||||
[email protected] | 24f40c1 | 2012-12-19 20:17:42 | [diff] [blame] | 96 | struct PPAPI_PROXY_EXPORT PPBFlash_DrawGlyphs_Params { |
[email protected] | aa20e06 | 2010-12-07 23:07:27 | [diff] [blame] | 97 | PPBFlash_DrawGlyphs_Params(); |
98 | ~PPBFlash_DrawGlyphs_Params(); | ||||
99 | |||||
[email protected] | 859a7f3 | 2011-01-15 03:44:13 | [diff] [blame] | 100 | PP_Instance instance; |
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 101 | ppapi::HostResource image_data; |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 102 | SerializedFontDescription font_desc; |
103 | uint32_t color; | ||||
104 | PP_Point position; | ||||
105 | PP_Rect clip; | ||||
106 | float transformation[3][3]; | ||||
[email protected] | 2e4361ae | 2011-12-15 00:03:35 | [diff] [blame] | 107 | PP_Bool allow_subpixel_aa; |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 108 | std::vector<uint16_t> glyph_indices; |
109 | std::vector<PP_Point> glyph_advances; | ||||
110 | }; | ||||
111 | |||||
[email protected] | f24448db | 2011-01-27 20:40:39 | [diff] [blame] | 112 | struct PPBURLLoader_UpdateProgress_Params { |
113 | PP_Instance instance; | ||||
[email protected] | be0a84b | 2011-08-13 04:18:44 | [diff] [blame] | 114 | ppapi::HostResource resource; |
[email protected] | f24448db | 2011-01-27 20:40:39 | [diff] [blame] | 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 | |||||
[email protected] | e5aeef0 | 2012-08-17 00:18:43 | [diff] [blame] | 121 | struct PPPDecryptor_Buffer { |
122 | ppapi::HostResource resource; | ||||
123 | uint32_t size; | ||||
124 | base::SharedMemoryHandle handle; | ||||
125 | }; | ||||
126 | |||||
lionel.g.landwerlin | 764a8c9 | 2015-11-19 01:48:08 | [diff] [blame] | 127 | struct PPB_AudioEncodeParameters { |
128 | uint32_t channels; | ||||
129 | uint32_t input_sample_rate; | ||||
130 | uint32_t input_sample_size; | ||||
131 | PP_AudioProfile output_profile; | ||||
132 | uint32_t initial_bitrate; | ||||
133 | PP_HardwareAcceleration acceleration; | ||||
134 | }; | ||||
135 | |||||
[email protected] | f5869d8be | 2013-04-06 00:33:10 | [diff] [blame] | 136 | // TODO(raymes): Make ImageHandle compatible with SerializedHandle. |
[email protected] | 1dfb8bef | 2013-05-17 07:31:44 | [diff] [blame] | 137 | typedef base::SharedMemoryHandle ImageHandle; |
[email protected] | 3acbbae4 | 2010-12-08 07:50:40 | [diff] [blame] | 138 | |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 139 | } // namespace proxy |
[email protected] | 4d2efd2 | 2011-08-18 21:58:02 | [diff] [blame] | 140 | } // namespace ppapi |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 141 | |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 142 | #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ |