1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_
6 #define PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_
11 #include "ipc/ipc_message_utils.h"
12 #include "ipc/ipc_platform_file.h"
13 #include "ppapi/c/pp_completion_callback.h"
14 #include "ppapi/c/pp_rect.h"
15 #include "ppapi/c/pp_var.h"
16 #include "ppapi/proxy/ppapi_proxy_export.h"
17 #include "ppapi/shared_impl/compositor_layer_data.h"
18 #include "ppapi/shared_impl/file_path.h"
19 #include "ppapi/shared_impl/file_ref_create_info.h"
20 #include "ppapi/shared_impl/media_stream_video_track_shared.h"
21 #include "ppapi/shared_impl/ppapi_permissions.h"
22 #include "ppapi/shared_impl/socket_option_data.h"
24 struct PP_NetAddress_Private
;
29 class PPB_X509Certificate_Fields
;
33 struct PPBFlash_DrawGlyphs_Params
;
34 struct PPBURLLoader_UpdateProgress_Params
;
35 struct SerializedDirEntry
;
36 struct SerializedFontDescription
;
37 struct SerializedTrueTypeFontDesc
;
38 class SerializedFlashMenu
;
39 class SerializedHandle
;
48 struct PPAPI_PROXY_EXPORT ParamTraits
<PP_Bool
> {
49 typedef PP_Bool param_type
;
50 static void Write(Message
* m
, const param_type
& p
);
51 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
52 static void Log(const param_type
& p
, std::string
* l
);
56 struct PPAPI_PROXY_EXPORT ParamTraits
<PP_NetAddress_Private
> {
57 typedef PP_NetAddress_Private param_type
;
58 static void Write(Message
* m
, const param_type
& p
);
59 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
60 static void Log(const param_type
& p
, std::string
* l
);
64 struct PPAPI_PROXY_EXPORT ParamTraits
<
65 ppapi::proxy::PPBFlash_DrawGlyphs_Params
> {
66 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type
;
67 static void Write(Message
* m
, const param_type
& p
);
68 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
69 static void Log(const param_type
& p
, std::string
* l
);
73 struct PPAPI_PROXY_EXPORT ParamTraits
<
74 ppapi::proxy::PPBURLLoader_UpdateProgress_Params
> {
75 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type
;
76 static void Write(Message
* m
, const param_type
& p
);
77 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
78 static void Log(const param_type
& p
, std::string
* l
);
82 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedDirEntry
> {
83 typedef ppapi::proxy::SerializedDirEntry param_type
;
84 static void Write(Message
* m
, const param_type
& p
);
85 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
86 static void Log(const param_type
& p
, std::string
* l
);
90 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedFontDescription
> {
91 typedef ppapi::proxy::SerializedFontDescription param_type
;
92 static void Write(Message
* m
, const param_type
& p
);
93 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
94 static void Log(const param_type
& p
, std::string
* l
);
98 struct PPAPI_PROXY_EXPORT
99 ParamTraits
<ppapi::proxy::SerializedTrueTypeFontDesc
> {
100 typedef ppapi::proxy::SerializedTrueTypeFontDesc param_type
;
101 static void Write(Message
* m
, const param_type
& p
);
102 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
103 static void Log(const param_type
& p
, std::string
* l
);
107 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedHandle
> {
108 typedef ppapi::proxy::SerializedHandle param_type
;
109 static void Write(Message
* m
, const param_type
& p
);
110 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
111 static void Log(const param_type
& p
, std::string
* l
);
115 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::HostResource
> {
116 typedef ppapi::HostResource param_type
;
117 static void Write(Message
* m
, const param_type
& p
);
118 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
119 static void Log(const param_type
& p
, std::string
* l
);
123 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedVar
> {
124 typedef ppapi::proxy::SerializedVar param_type
;
125 static void Write(Message
* m
, const param_type
& p
);
126 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
127 static void Log(const param_type
& p
, std::string
* l
);
131 struct PPAPI_PROXY_EXPORT ParamTraits
<
132 std::vector
<ppapi::proxy::SerializedVar
> > {
133 typedef std::vector
<ppapi::proxy::SerializedVar
> param_type
;
134 static void Write(Message
* m
, const param_type
& p
);
135 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
136 static void Log(const param_type
& p
, std::string
* l
);
140 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::PpapiPermissions
> {
141 typedef ppapi::PpapiPermissions param_type
;
142 static void Write(Message
* m
, const param_type
& p
);
143 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
144 static void Log(const param_type
& p
, std::string
* l
);
147 #if !defined(OS_NACL) && !defined(NACL_WIN64)
149 struct ParamTraits
<ppapi::PepperFilePath
> {
150 typedef ppapi::PepperFilePath param_type
;
151 static void Write(Message
* m
, const param_type
& p
);
152 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
153 static void Log(const param_type
& p
, std::string
* l
);
157 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedFlashMenu
> {
158 typedef ppapi::proxy::SerializedFlashMenu param_type
;
159 static void Write(Message
* m
, const param_type
& p
);
160 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
161 static void Log(const param_type
& p
, std::string
* l
);
163 #endif // !defined(OS_NACL) && !defined(NACL_WIN64)
166 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::PPB_X509Certificate_Fields
> {
167 typedef ppapi::PPB_X509Certificate_Fields param_type
;
168 static void Write(Message
* m
, const param_type
& p
);
169 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
170 static void Log(const param_type
& p
, std::string
* l
);
174 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::SocketOptionData
> {
175 typedef ppapi::SocketOptionData param_type
;
176 static void Write(Message
* m
, const param_type
& p
);
177 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
178 static void Log(const param_type
& p
, std::string
* l
);
182 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::CompositorLayerData::Transform
> {
183 typedef ppapi::CompositorLayerData::Transform param_type
;
184 static void Write(Message
* m
, const param_type
& p
);
185 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
186 static void Log(const param_type
& p
, std::string
* l
);
191 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_