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/file_path.h"
18 #include "ppapi/shared_impl/ppapi_permissions.h"
19 #include "ppapi/shared_impl/ppb_file_ref_shared.h"
22 struct PP_ObjectProperty
;
23 struct PP_NetAddress_Private
;
28 class PPB_X509Certificate_Fields
;
32 struct PPBFlash_DrawGlyphs_Params
;
33 struct PPBURLLoader_UpdateProgress_Params
;
34 struct SerializedDirEntry
;
35 struct SerializedFontDescription
;
36 class SerializedFlashMenu
;
37 class SerializedHandle
;
46 struct PPAPI_PROXY_EXPORT ParamTraits
<PP_Bool
> {
47 typedef PP_Bool param_type
;
48 static void Write(Message
* m
, const param_type
& p
);
49 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
50 static void Log(const param_type
& p
, std::string
* l
);
54 struct PPAPI_PROXY_EXPORT ParamTraits
<PP_FileInfo
> {
55 typedef PP_FileInfo param_type
;
56 static void Write(Message
* m
, const param_type
& p
);
57 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
58 static void Log(const param_type
& p
, std::string
* l
);
62 struct PPAPI_PROXY_EXPORT ParamTraits
<PP_NetAddress_Private
> {
63 typedef PP_NetAddress_Private param_type
;
64 static void Write(Message
* m
, const param_type
& p
);
65 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
66 static void Log(const param_type
& p
, std::string
* l
);
70 struct PPAPI_PROXY_EXPORT ParamTraits
<PP_ObjectProperty
> {
71 typedef PP_ObjectProperty param_type
;
72 static void Write(Message
* m
, const param_type
& p
);
73 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
74 static void Log(const param_type
& p
, std::string
* l
);
78 struct PPAPI_PROXY_EXPORT ParamTraits
<
79 ppapi::proxy::PPBFlash_DrawGlyphs_Params
> {
80 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type
;
81 static void Write(Message
* m
, const param_type
& p
);
82 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
83 static void Log(const param_type
& p
, std::string
* l
);
87 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::PPB_FileRef_CreateInfo
> {
88 typedef ppapi::PPB_FileRef_CreateInfo param_type
;
89 static void Write(Message
* m
, const param_type
& p
);
90 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
91 static void Log(const param_type
& p
, std::string
* l
);
95 struct PPAPI_PROXY_EXPORT ParamTraits
<
96 ppapi::proxy::PPBURLLoader_UpdateProgress_Params
> {
97 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type
;
98 static void Write(Message
* m
, const param_type
& p
);
99 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
100 static void Log(const param_type
& p
, std::string
* l
);
104 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedDirEntry
> {
105 typedef ppapi::proxy::SerializedDirEntry param_type
;
106 static void Write(Message
* m
, const param_type
& p
);
107 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
108 static void Log(const param_type
& p
, std::string
* l
);
112 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedFontDescription
> {
113 typedef ppapi::proxy::SerializedFontDescription param_type
;
114 static void Write(Message
* m
, const param_type
& p
);
115 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
116 static void Log(const param_type
& p
, std::string
* l
);
120 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedHandle
> {
121 typedef ppapi::proxy::SerializedHandle param_type
;
122 static void Write(Message
* m
, const param_type
& p
);
123 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
124 static void Log(const param_type
& p
, std::string
* l
);
128 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::HostResource
> {
129 typedef ppapi::HostResource param_type
;
130 static void Write(Message
* m
, const param_type
& p
);
131 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
132 static void Log(const param_type
& p
, std::string
* l
);
136 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedVar
> {
137 typedef ppapi::proxy::SerializedVar param_type
;
138 static void Write(Message
* m
, const param_type
& p
);
139 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
140 static void Log(const param_type
& p
, std::string
* l
);
144 struct PPAPI_PROXY_EXPORT ParamTraits
<
145 std::vector
<ppapi::proxy::SerializedVar
> > {
146 typedef std::vector
<ppapi::proxy::SerializedVar
> param_type
;
147 static void Write(Message
* m
, const param_type
& p
);
148 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
149 static void Log(const param_type
& p
, std::string
* l
);
153 struct PPAPI_PROXY_EXPORT ParamTraits
< std::vector
<
154 ppapi::PPB_FileRef_CreateInfo
> > {
155 typedef std::vector
<ppapi::PPB_FileRef_CreateInfo
> param_type
;
156 static void Write(Message
* m
, const param_type
& p
);
157 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
158 static void Log(const param_type
& p
, std::string
* l
);
162 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::PpapiPermissions
> {
163 typedef ppapi::PpapiPermissions param_type
;
164 static void Write(Message
* m
, const param_type
& p
);
165 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
166 static void Log(const param_type
& p
, std::string
* l
);
169 #if !defined(OS_NACL) && !defined(NACL_WIN64)
171 struct ParamTraits
<ppapi::PepperFilePath
> {
172 typedef ppapi::PepperFilePath param_type
;
173 static void Write(Message
* m
, const param_type
& p
);
174 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
175 static void Log(const param_type
& p
, std::string
* l
);
179 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedFlashMenu
> {
180 typedef ppapi::proxy::SerializedFlashMenu param_type
;
181 static void Write(Message
* m
, const param_type
& p
);
182 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
183 static void Log(const param_type
& p
, std::string
* l
);
185 #endif // !defined(OS_NACL) && !defined(NACL_WIN64)
188 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::PPB_X509Certificate_Fields
> {
189 typedef ppapi::PPB_X509Certificate_Fields param_type
;
190 static void Write(Message
* m
, const param_type
& p
);
191 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
192 static void Log(const param_type
& p
, std::string
* l
);
198 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_