blob: 62f807bb4560c001f97ff67728fe9d8e9448fb92 [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
8#include "ipc/ipc_message_utils.h"
[email protected]43a40202010-11-12 16:25:019#include "ipc/ipc_platform_file.h"
[email protected]c2932f5e2010-11-03 03:22:3310#include "ppapi/c/pp_completion_callback.h"
11#include "ppapi/c/pp_input_event.h"
12#include "ppapi/c/pp_rect.h"
13#include "ppapi/c/pp_var.h"
[email protected]c2932f5e2010-11-03 03:22:3314
[email protected]43a40202010-11-12 16:25:0115struct PP_FileInfo_Dev;
[email protected]799d1ab2010-11-09 17:16:2816struct PP_ObjectProperty;
[email protected]7358d572011-02-15 18:44:4017struct PP_Flash_Menu;
[email protected]373a95a2011-07-01 16:58:1418struct PP_Flash_NetAddress;
[email protected]c2932f5e2010-11-03 03:22:3319
20namespace pp {
21namespace proxy {
[email protected]f24448db2011-01-27 20:40:3922
[email protected]7358d572011-02-15 18:44:4023class HostResource;
[email protected]4deeb432011-02-17 23:59:3924struct PPBFileRef_CreateInfo;
[email protected]43a40202010-11-12 16:25:0125struct PPBFlash_DrawGlyphs_Params;
[email protected]f24448db2011-01-27 20:40:3926struct PPBURLLoader_UpdateProgress_Params;
[email protected]43a40202010-11-12 16:25:0127struct SerializedDirEntry;
[email protected]709a847e2010-11-10 01:16:1128struct SerializedFontDescription;
[email protected]7358d572011-02-15 18:44:4029class SerializedFlashMenu;
[email protected]c2932f5e2010-11-03 03:22:3330class SerializedVar;
[email protected]f24448db2011-01-27 20:40:3931
32} // namespace proxy
33} // namespace pp
[email protected]c2932f5e2010-11-03 03:22:3334
35namespace IPC {
36
37template<>
[email protected]799d1ab2010-11-09 17:16:2838struct ParamTraits<PP_Bool> {
39 typedef PP_Bool param_type;
40 static void Write(Message* m, const param_type& p);
41 static bool Read(const Message* m, void** iter, param_type* r);
42 static void Log(const param_type& p, std::string* l);
43};
44
45template<>
[email protected]43a40202010-11-12 16:25:0146struct ParamTraits<PP_FileInfo_Dev> {
47 typedef PP_FileInfo_Dev param_type;
48 static void Write(Message* m, const param_type& p);
49 static bool Read(const Message* m, void** iter, param_type* r);
50 static void Log(const param_type& p, std::string* l);
51};
52
[email protected]373a95a2011-07-01 16:58:1453template <>
54struct ParamTraits<PP_Flash_NetAddress> {
55 typedef PP_Flash_NetAddress param_type;
56 static void Write(Message* m, const param_type& p);
57 static bool Read(const Message* m, void** iter, param_type* p);
58 static void Log(const param_type& p, std::string* l);
59};
60
[email protected]43a40202010-11-12 16:25:0161template<>
[email protected]c2932f5e2010-11-03 03:22:3362struct ParamTraits<PP_InputEvent> {
63 typedef PP_InputEvent param_type;
64 static void Write(Message* m, const param_type& p);
65 static bool Read(const Message* m, void** iter, param_type* r);
66 static void Log(const param_type& p, std::string* l);
67};
68
69template<>
70struct 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, void** iter, param_type* r);
74 static void Log(const param_type& p, std::string* l);
75};
76
77template<>
[email protected]43a40202010-11-12 16:25:0178struct ParamTraits<pp::proxy::PPBFlash_DrawGlyphs_Params> {
79 typedef pp::proxy::PPBFlash_DrawGlyphs_Params param_type;
80 static void Write(Message* m, const param_type& p);
81 static bool Read(const Message* m, void** iter, param_type* r);
82 static void Log(const param_type& p, std::string* l);
83};
84
85template<>
[email protected]4deeb432011-02-17 23:59:3986struct ParamTraits<pp::proxy::PPBFileRef_CreateInfo> {
87 typedef pp::proxy::PPBFileRef_CreateInfo param_type;
88 static void Write(Message* m, const param_type& p);
89 static bool Read(const Message* m, void** iter, param_type* r);
90 static void Log(const param_type& p, std::string* l);
91};
92
93template<>
[email protected]f24448db2011-01-27 20:40:3994struct ParamTraits<pp::proxy::PPBURLLoader_UpdateProgress_Params> {
95 typedef pp::proxy::PPBURLLoader_UpdateProgress_Params param_type;
96 static void Write(Message* m, const param_type& p);
97 static bool Read(const Message* m, void** iter, param_type* r);
98 static void Log(const param_type& p, std::string* l);
99};
100
101template<>
[email protected]43a40202010-11-12 16:25:01102struct ParamTraits<pp::proxy::SerializedDirEntry> {
103 typedef pp::proxy::SerializedDirEntry param_type;
104 static void Write(Message* m, const param_type& p);
105 static bool Read(const Message* m, void** iter, param_type* r);
106 static void Log(const param_type& p, std::string* l);
107};
108
109template<>
[email protected]799d1ab2010-11-09 17:16:28110struct ParamTraits<pp::proxy::SerializedFontDescription> {
111 typedef pp::proxy::SerializedFontDescription param_type;
112 static void Write(Message* m, const param_type& p);
113 static bool Read(const Message* m, void** iter, param_type* r);
114 static void Log(const param_type& p, std::string* l);
115};
116
117template<>
[email protected]f24448db2011-01-27 20:40:39118struct ParamTraits<pp::proxy::HostResource> {
119 typedef pp::proxy::HostResource param_type;
120 static void Write(Message* m, const param_type& p);
121 static bool Read(const Message* m, void** iter, param_type* r);
122 static void Log(const param_type& p, std::string* l);
123};
124
125template<>
[email protected]c2932f5e2010-11-03 03:22:33126struct ParamTraits<pp::proxy::SerializedVar> {
127 typedef pp::proxy::SerializedVar param_type;
128 static void Write(Message* m, const param_type& p);
129 static bool Read(const Message* m, void** iter, param_type* r);
130 static void Log(const param_type& p, std::string* l);
131};
132
[email protected]c2932f5e2010-11-03 03:22:33133template<>
134struct ParamTraits< std::vector<pp::proxy::SerializedVar> > {
135 typedef std::vector<pp::proxy::SerializedVar> param_type;
136 static void Write(Message* m, const param_type& p);
137 static bool Read(const Message* m, void** iter, param_type* r);
138 static void Log(const param_type& p, std::string* l);
139};
140
[email protected]7358d572011-02-15 18:44:40141template<>
[email protected]1162a6a2011-04-21 17:28:16142struct ParamTraits< std::vector<pp::proxy::PPBFileRef_CreateInfo> > {
143 typedef std::vector<pp::proxy::PPBFileRef_CreateInfo> param_type;
144 static void Write(Message* m, const param_type& p);
145 static bool Read(const Message* m, void** iter, param_type* r);
146 static void Log(const param_type& p, std::string* l);
147};
148
149template<>
[email protected]7358d572011-02-15 18:44:40150struct ParamTraits<pp::proxy::SerializedFlashMenu> {
151 typedef pp::proxy::SerializedFlashMenu param_type;
152 static void Write(Message* m, const param_type& p);
153 static bool Read(const Message* m, void** iter, param_type* r);
154 static void Log(const param_type& p, std::string* l);
155};
156
[email protected]c2932f5e2010-11-03 03:22:33157} // namespace IPC
158
159#endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_