blob: bec991f105b51573891f3f6c000af7d6badea75f [file] [log] [blame]
[email protected]a0e1adc52012-01-27 07:21:131// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]fb35dcf2010-11-14 17:08:002// 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
avie029c4132015-12-23 06:45:228#include <stdint.h>
9
[email protected]fb35dcf2010-11-14 17:08:0010#include <string>
11#include <vector>
12
[email protected]246fc492012-08-27 20:28:1813#include "base/logging.h"
[email protected]8299b712013-07-17 19:55:2314#include "base/memory/shared_memory.h"
[email protected]3acbbae42010-12-08 07:50:4015#include "build/build_config.h"
[email protected]725056b72013-03-16 09:57:5116#include "ppapi/c/dev/ppb_truetype_font_dev.h"
[email protected]fb35dcf2010-11-14 17:08:0017#include "ppapi/c/pp_bool.h"
lionel.g.landwerlin764a8c92015-11-19 01:48:0818#include "ppapi/c/pp_codecs.h"
[email protected]859a7f32011-01-15 03:44:1319#include "ppapi/c/pp_instance.h"
[email protected]fb35dcf2010-11-14 17:08:0020#include "ppapi/c/pp_point.h"
21#include "ppapi/c/pp_rect.h"
[email protected]86fbad282013-09-22 06:34:0322#include "ppapi/c/ppb_network_list.h"
[email protected]07d0a6bf2013-09-17 04:15:1023#include "ppapi/c/private/ppb_net_address_private.h"
[email protected]cb65f132012-10-09 17:06:0924#include "ppapi/proxy/ppapi_proxy_export.h"
[email protected]be0a84b2011-08-13 04:18:4425#include "ppapi/shared_impl/host_resource.h"
[email protected]fb35dcf2010-11-14 17:08:0026
[email protected]d0e3b4a2012-12-07 22:31:4427struct PP_BrowserFont_Trusted_Description;
[email protected]fb35dcf2010-11-14 17:08:0028
[email protected]4d2efd22011-08-18 21:58:0229namespace ppapi {
[email protected]fb35dcf2010-11-14 17:08:0030namespace proxy {
31
thestigd8ecc842015-11-02 22:29:0632// PP_BrowserFontDescription has to be redefined with a string in place of the
33// PP_Var used for the face name.
[email protected]f0a04c42011-08-26 22:43:2034struct PPAPI_PROXY_EXPORT SerializedFontDescription {
[email protected]aa20e062010-12-07 23:07:2735 SerializedFontDescription();
36 ~SerializedFontDescription();
37
[email protected]d0e3b4a2012-12-07 22:31:4438 void SetFromPPBrowserFontDescription(
39 const PP_BrowserFont_Trusted_Description& desc);
[email protected]fb35dcf2010-11-14 17:08:0040
[email protected]d0e3b4a2012-12-07 22:31:4441 void SetToPPBrowserFontDescription(
42 PP_BrowserFont_Trusted_Description* desc) const;
[email protected]fb35dcf2010-11-14 17:08:0043
[email protected]cb65f132012-10-09 17:06:0944 std::string face;
[email protected]fb35dcf2010-11-14 17:08:0045 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]07d0a6bf2013-09-17 04:15:1054struct PPAPI_PROXY_EXPORT SerializedNetworkInfo {
55 SerializedNetworkInfo();
56 ~SerializedNetworkInfo();
57
58 std::string name;
[email protected]86fbad282013-09-22 06:34:0359 PP_NetworkList_Type type;
60 PP_NetworkList_State state;
[email protected]07d0a6bf2013-09-17 04:15:1061 std::vector<PP_NetAddress_Private> addresses;
62 std::string display_name;
63 int mtu;
64};
65typedef std::vector<SerializedNetworkInfo> SerializedNetworkList;
66
[email protected]725056b72013-03-16 09:57:5167struct 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
thestigd8ecc842015-11-02 22:29:0677 // Converts this to a PP_TrueTypeFontDesc_Dev.
[email protected]725056b72013-03-16 09:57:5178 //
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]fb35dcf2010-11-14 17:08:0091struct SerializedDirEntry {
92 std::string name;
93 bool is_dir;
94};
95
[email protected]24f40c12012-12-19 20:17:4296struct PPAPI_PROXY_EXPORT PPBFlash_DrawGlyphs_Params {
[email protected]aa20e062010-12-07 23:07:2797 PPBFlash_DrawGlyphs_Params();
98 ~PPBFlash_DrawGlyphs_Params();
99
[email protected]859a7f32011-01-15 03:44:13100 PP_Instance instance;
[email protected]be0a84b2011-08-13 04:18:44101 ppapi::HostResource image_data;
[email protected]fb35dcf2010-11-14 17:08:00102 SerializedFontDescription font_desc;
103 uint32_t color;
104 PP_Point position;
105 PP_Rect clip;
106 float transformation[3][3];
[email protected]2e4361ae2011-12-15 00:03:35107 PP_Bool allow_subpixel_aa;
[email protected]fb35dcf2010-11-14 17:08:00108 std::vector<uint16_t> glyph_indices;
109 std::vector<PP_Point> glyph_advances;
110};
111
[email protected]f24448db2011-01-27 20:40:39112struct PPBURLLoader_UpdateProgress_Params {
113 PP_Instance instance;
[email protected]be0a84b2011-08-13 04:18:44114 ppapi::HostResource resource;
[email protected]f24448db2011-01-27 20:40:39115 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]e5aeef02012-08-17 00:18:43121struct PPPDecryptor_Buffer {
122 ppapi::HostResource resource;
123 uint32_t size;
124 base::SharedMemoryHandle handle;
125};
126
lionel.g.landwerlin764a8c92015-11-19 01:48:08127struct 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]f5869d8be2013-04-06 00:33:10136// TODO(raymes): Make ImageHandle compatible with SerializedHandle.
[email protected]1dfb8bef2013-05-17 07:31:44137typedef base::SharedMemoryHandle ImageHandle;
[email protected]3acbbae42010-12-08 07:50:40138
[email protected]fb35dcf2010-11-14 17:08:00139} // namespace proxy
[email protected]4d2efd22011-08-18 21:58:02140} // namespace ppapi
[email protected]fb35dcf2010-11-14 17:08:00141
[email protected]fb35dcf2010-11-14 17:08:00142#endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_