blob: 4cd425aaa2c0256549ca3207af7f0dab5755f1ff [file] [log] [blame]
[email protected]f24448db2011-01-27 20:40:391// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]c2932f5e2010-11-03 03:22:332// 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_PPAPI_PARAM_TRAITS_H_
6#define PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_
7
[email protected]ea505a9d2011-07-07 18:34:408#include <string>
9#include <vector>
10
[email protected]c2932f5e2010-11-03 03:22:3311#include "ipc/ipc_message_utils.h"
[email protected]43a40202010-11-12 16:25:0112#include "ipc/ipc_platform_file.h"
[email protected]c2932f5e2010-11-03 03:22:3313#include "ppapi/c/pp_completion_callback.h"
[email protected]c2932f5e2010-11-03 03:22:3314#include "ppapi/c/pp_rect.h"
15#include "ppapi/c/pp_var.h"
[email protected]c2932f5e2010-11-03 03:22:3316
[email protected]ea505a9d2011-07-07 18:34:4017struct PP_FileInfo;
[email protected]799d1ab2010-11-09 17:16:2818struct PP_ObjectProperty;
[email protected]7358d572011-02-15 18:44:4019struct PP_Flash_Menu;
[email protected]373a95a2011-07-01 16:58:1420struct PP_Flash_NetAddress;
[email protected]c2932f5e2010-11-03 03:22:3321
[email protected]be0a84b2011-08-13 04:18:4422namespace ppapi {
23
24class HostResource;
25
26} // namespace ppapi
27
[email protected]c2932f5e2010-11-03 03:22:3328namespace pp {
29namespace proxy {
[email protected]f24448db2011-01-27 20:40:3930
[email protected]4deeb432011-02-17 23:59:3931struct PPBFileRef_CreateInfo;
[email protected]43a40202010-11-12 16:25:0132struct PPBFlash_DrawGlyphs_Params;
[email protected]f24448db2011-01-27 20:40:3933struct PPBURLLoader_UpdateProgress_Params;
[email protected]43a40202010-11-12 16:25:0134struct SerializedDirEntry;
[email protected]709a847e2010-11-10 01:16:1135struct SerializedFontDescription;
[email protected]7358d572011-02-15 18:44:4036class SerializedFlashMenu;
[email protected]c2932f5e2010-11-03 03:22:3337class SerializedVar;
[email protected]f24448db2011-01-27 20:40:3938
39} // namespace proxy
40} // namespace pp
[email protected]c2932f5e2010-11-03 03:22:3341
42namespace IPC {
43
44template<>
[email protected]799d1ab2010-11-09 17:16:2845struct ParamTraits<PP_Bool> {
46 typedef PP_Bool param_type;
47 static void Write(Message* m, const param_type& p);
48 static bool Read(const Message* m, void** iter, param_type* r);
49 static void Log(const param_type& p, std::string* l);
50};
51
52template<>
[email protected]ea505a9d2011-07-07 18:34:4053struct ParamTraits<PP_FileInfo> {
54 typedef PP_FileInfo param_type;
[email protected]43a40202010-11-12 16:25:0155 static void Write(Message* m, const param_type& p);
56 static bool Read(const Message* m, void** iter, param_type* r);
57 static void Log(const param_type& p, std::string* l);
58};
59
[email protected]373a95a2011-07-01 16:58:1460template <>
61struct ParamTraits<PP_Flash_NetAddress> {
62 typedef PP_Flash_NetAddress param_type;
63 static void Write(Message* m, const param_type& p);
64 static bool Read(const Message* m, void** iter, param_type* p);
65 static void Log(const param_type& p, std::string* l);
66};
67
[email protected]43a40202010-11-12 16:25:0168template<>
[email protected]c2932f5e2010-11-03 03:22:3369struct ParamTraits<PP_ObjectProperty> {
70 typedef PP_ObjectProperty param_type;
71 static void Write(Message* m, const param_type& p);
72 static bool Read(const Message* m, void** iter, param_type* r);
73 static void Log(const param_type& p, std::string* l);
74};
75
76template<>
[email protected]43a40202010-11-12 16:25:0177struct ParamTraits<pp::proxy::PPBFlash_DrawGlyphs_Params> {
78 typedef pp::proxy::PPBFlash_DrawGlyphs_Params param_type;
79 static void Write(Message* m, const param_type& p);
80 static bool Read(const Message* m, void** iter, param_type* r);
81 static void Log(const param_type& p, std::string* l);
82};
83
84template<>
[email protected]4deeb432011-02-17 23:59:3985struct ParamTraits<pp::proxy::PPBFileRef_CreateInfo> {
86 typedef pp::proxy::PPBFileRef_CreateInfo param_type;
87 static void Write(Message* m, const param_type& p);
88 static bool Read(const Message* m, void** iter, param_type* r);
89 static void Log(const param_type& p, std::string* l);
90};
91
92template<>
[email protected]f24448db2011-01-27 20:40:3993struct ParamTraits<pp::proxy::PPBURLLoader_UpdateProgress_Params> {
94 typedef pp::proxy::PPBURLLoader_UpdateProgress_Params param_type;
95 static void Write(Message* m, const param_type& p);
96 static bool Read(const Message* m, void** iter, param_type* r);
97 static void Log(const param_type& p, std::string* l);
98};
99
100template<>
[email protected]43a40202010-11-12 16:25:01101struct ParamTraits<pp::proxy::SerializedDirEntry> {
102 typedef pp::proxy::SerializedDirEntry param_type;
103 static void Write(Message* m, const param_type& p);
104 static bool Read(const Message* m, void** iter, param_type* r);
105 static void Log(const param_type& p, std::string* l);
106};
107
108template<>
[email protected]799d1ab2010-11-09 17:16:28109struct ParamTraits<pp::proxy::SerializedFontDescription> {
110 typedef pp::proxy::SerializedFontDescription param_type;
111 static void Write(Message* m, const param_type& p);
112 static bool Read(const Message* m, void** iter, param_type* r);
113 static void Log(const param_type& p, std::string* l);
114};
115
116template<>
[email protected]be0a84b2011-08-13 04:18:44117struct ParamTraits<ppapi::HostResource> {
118 typedef ppapi::HostResource param_type;
[email protected]f24448db2011-01-27 20:40:39119 static void Write(Message* m, const param_type& p);
120 static bool Read(const Message* m, void** iter, param_type* r);
121 static void Log(const param_type& p, std::string* l);
122};
123
124template<>
[email protected]c2932f5e2010-11-03 03:22:33125struct ParamTraits<pp::proxy::SerializedVar> {
126 typedef pp::proxy::SerializedVar param_type;
127 static void Write(Message* m, const param_type& p);
128 static bool Read(const Message* m, void** iter, param_type* r);
129 static void Log(const param_type& p, std::string* l);
130};
131
[email protected]c2932f5e2010-11-03 03:22:33132template<>
133struct ParamTraits< std::vector<pp::proxy::SerializedVar> > {
134 typedef std::vector<pp::proxy::SerializedVar> param_type;
135 static void Write(Message* m, const param_type& p);
136 static bool Read(const Message* m, void** iter, param_type* r);
137 static void Log(const param_type& p, std::string* l);
138};
139
[email protected]7358d572011-02-15 18:44:40140template<>
[email protected]1162a6a2011-04-21 17:28:16141struct ParamTraits< std::vector<pp::proxy::PPBFileRef_CreateInfo> > {
142 typedef std::vector<pp::proxy::PPBFileRef_CreateInfo> param_type;
143 static void Write(Message* m, const param_type& p);
144 static bool Read(const Message* m, void** iter, param_type* r);
145 static void Log(const param_type& p, std::string* l);
146};
147
148template<>
[email protected]7358d572011-02-15 18:44:40149struct ParamTraits<pp::proxy::SerializedFlashMenu> {
150 typedef pp::proxy::SerializedFlashMenu param_type;
151 static void Write(Message* m, const param_type& p);
152 static bool Read(const Message* m, void** iter, param_type* r);
153 static void Log(const param_type& p, std::string* l);
154};
155
[email protected]c2932f5e2010-11-03 03:22:33156} // namespace IPC
157
158#endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_