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/file_ref_create_info.h"
19 #include "ppapi/shared_impl/media_stream_video_track_shared.h"
20 #include "ppapi/shared_impl/ppapi_permissions.h"
21 #include "ppapi/shared_impl/socket_option_data.h"
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 struct SerializedTrueTypeFontDesc
;
37 class SerializedFlashMenu
;
38 class SerializedHandle
;
47 struct PPAPI_PROXY_EXPORT ParamTraits
<PP_Bool
> {
48 typedef PP_Bool param_type
;
49 static void Write(Message
* m
, const param_type
& p
);
50 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
51 static void Log(const param_type
& p
, std::string
* l
);
55 struct PPAPI_PROXY_EXPORT ParamTraits
<PP_NetAddress_Private
> {
56 typedef PP_NetAddress_Private param_type
;
57 static void Write(Message
* m
, const param_type
& p
);
58 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
59 static void Log(const param_type
& p
, std::string
* l
);
63 struct PPAPI_PROXY_EXPORT ParamTraits
<
64 ppapi::proxy::PPBFlash_DrawGlyphs_Params
> {
65 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type
;
66 static void Write(Message
* m
, const param_type
& p
);
67 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
68 static void Log(const param_type
& p
, std::string
* l
);
72 struct PPAPI_PROXY_EXPORT ParamTraits
<
73 ppapi::proxy::PPBURLLoader_UpdateProgress_Params
> {
74 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type
;
75 static void Write(Message
* m
, const param_type
& p
);
76 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
77 static void Log(const param_type
& p
, std::string
* l
);
81 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedDirEntry
> {
82 typedef ppapi::proxy::SerializedDirEntry param_type
;
83 static void Write(Message
* m
, const param_type
& p
);
84 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
85 static void Log(const param_type
& p
, std::string
* l
);
89 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedFontDescription
> {
90 typedef ppapi::proxy::SerializedFontDescription param_type
;
91 static void Write(Message
* m
, const param_type
& p
);
92 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
93 static void Log(const param_type
& p
, std::string
* l
);
97 struct PPAPI_PROXY_EXPORT
98 ParamTraits
<ppapi::proxy::SerializedTrueTypeFontDesc
> {
99 typedef ppapi::proxy::SerializedTrueTypeFontDesc param_type
;
100 static void Write(Message
* m
, const param_type
& p
);
101 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
102 static void Log(const param_type
& p
, std::string
* l
);
106 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedHandle
> {
107 typedef ppapi::proxy::SerializedHandle param_type
;
108 static void Write(Message
* m
, const param_type
& p
);
109 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
110 static void Log(const param_type
& p
, std::string
* l
);
114 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::HostResource
> {
115 typedef ppapi::HostResource param_type
;
116 static void Write(Message
* m
, const param_type
& p
);
117 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
118 static void Log(const param_type
& p
, std::string
* l
);
122 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedVar
> {
123 typedef ppapi::proxy::SerializedVar param_type
;
124 static void Write(Message
* m
, const param_type
& p
);
125 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
126 static void Log(const param_type
& p
, std::string
* l
);
130 struct PPAPI_PROXY_EXPORT ParamTraits
<
131 std::vector
<ppapi::proxy::SerializedVar
> > {
132 typedef std::vector
<ppapi::proxy::SerializedVar
> param_type
;
133 static void Write(Message
* m
, const param_type
& p
);
134 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
135 static void Log(const param_type
& p
, std::string
* l
);
139 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::PpapiPermissions
> {
140 typedef ppapi::PpapiPermissions param_type
;
141 static void Write(Message
* m
, const param_type
& p
);
142 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
143 static void Log(const param_type
& p
, std::string
* l
);
146 #if !defined(OS_NACL) && !defined(NACL_WIN64)
148 struct ParamTraits
<ppapi::PepperFilePath
> {
149 typedef ppapi::PepperFilePath param_type
;
150 static void Write(Message
* m
, const param_type
& p
);
151 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* p
);
152 static void Log(const param_type
& p
, std::string
* l
);
156 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::proxy::SerializedFlashMenu
> {
157 typedef ppapi::proxy::SerializedFlashMenu param_type
;
158 static void Write(Message
* m
, const param_type
& p
);
159 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
160 static void Log(const param_type
& p
, std::string
* l
);
162 #endif // !defined(OS_NACL) && !defined(NACL_WIN64)
165 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::PPB_X509Certificate_Fields
> {
166 typedef ppapi::PPB_X509Certificate_Fields param_type
;
167 static void Write(Message
* m
, const param_type
& p
);
168 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
169 static void Log(const param_type
& p
, std::string
* l
);
173 struct PPAPI_PROXY_EXPORT ParamTraits
<ppapi::SocketOptionData
> {
174 typedef ppapi::SocketOptionData param_type
;
175 static void Write(Message
* m
, const param_type
& p
);
176 static bool Read(const Message
* m
, PickleIterator
* iter
, param_type
* r
);
177 static void Log(const param_type
& p
, std::string
* l
);
182 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_