blob: 0c13ff53037c1f802f97e58e2ed7a236b770eb9d [file] [log] [blame]
[email protected]c2932f5e2010-11-03 03:22:331// Copyright (c) 2010 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.
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"
9#include "ppapi/c/pp_completion_callback.h"
10#include "ppapi/c/pp_input_event.h"
11#include "ppapi/c/pp_rect.h"
12#include "ppapi/c/pp_var.h"
13#include "ppapi/proxy/serialized_var.h" // TODO(brettw) eraseme.
14
[email protected]799d1ab2010-11-09 17:16:2815struct PP_ObjectProperty;
[email protected]c2932f5e2010-11-03 03:22:3316
17namespace pp {
18namespace proxy {
[email protected]799d1ab2010-11-09 17:16:2819struct PPBFont_DrawTextAt_Params;
20class SerializedFontDescription;
[email protected]c2932f5e2010-11-03 03:22:3321class SerializedVar;
22}
23}
24
25namespace IPC {
26
27template<>
[email protected]799d1ab2010-11-09 17:16:2828struct ParamTraits<PP_Bool> {
29 typedef PP_Bool param_type;
30 static void Write(Message* m, const param_type& p);
31 static bool Read(const Message* m, void** iter, param_type* r);
32 static void Log(const param_type& p, std::string* l);
33};
34
35template<>
[email protected]c2932f5e2010-11-03 03:22:3336struct ParamTraits<PP_InputEvent> {
37 typedef PP_InputEvent param_type;
38 static void Write(Message* m, const param_type& p);
39 static bool Read(const Message* m, void** iter, param_type* r);
40 static void Log(const param_type& p, std::string* l);
41};
42
43template<>
44struct ParamTraits<PP_ObjectProperty> {
45 typedef PP_ObjectProperty param_type;
46 static void Write(Message* m, const param_type& p);
47 static bool Read(const Message* m, void** iter, param_type* r);
48 static void Log(const param_type& p, std::string* l);
49};
50
51template<>
52struct ParamTraits<PP_Point> {
53 typedef PP_Point param_type;
54 static void Write(Message* m, const param_type& p);
55 static bool Read(const Message* m, void** iter, param_type* r);
56 static void Log(const param_type& p, std::string* l);
57};
58
59template<>
60struct ParamTraits<PP_Rect> {
61 typedef PP_Rect param_type;
62 static void Write(Message* m, const param_type& p);
63 static bool Read(const Message* m, void** iter, param_type* r);
64 static void Log(const param_type& p, std::string* l);
65};
66
67template<>
68struct ParamTraits<PP_Size> {
69 typedef PP_Size param_type;
70 static void Write(Message* m, const param_type& p);
71 static bool Read(const Message* m, void** iter, param_type* r);
72 static void Log(const param_type& p, std::string* l);
73};
74
75template<>
[email protected]799d1ab2010-11-09 17:16:2876struct ParamTraits<pp::proxy::PPBFont_DrawTextAt_Params> {
77 typedef pp::proxy::PPBFont_DrawTextAt_Params param_type;
78 static void Write(Message* m, const param_type& p);
79 static bool Read(const Message* m, void** iter, param_type* r);
80 static void Log(const param_type& p, std::string* l);
81};
82
83template<>
84struct ParamTraits<pp::proxy::SerializedFontDescription> {
85 typedef pp::proxy::SerializedFontDescription param_type;
86 static void Write(Message* m, const param_type& p);
87 static bool Read(const Message* m, void** iter, param_type* r);
88 static void Log(const param_type& p, std::string* l);
89};
90
91template<>
[email protected]c2932f5e2010-11-03 03:22:3392struct ParamTraits<pp::proxy::SerializedVar> {
93 typedef pp::proxy::SerializedVar param_type;
94 static void Write(Message* m, const param_type& p);
95 static bool Read(const Message* m, void** iter, param_type* r);
96 static void Log(const param_type& p, std::string* l);
97};
98
[email protected]c2932f5e2010-11-03 03:22:3399template<>
100struct ParamTraits< std::vector<pp::proxy::SerializedVar> > {
101 typedef std::vector<pp::proxy::SerializedVar> param_type;
102 static void Write(Message* m, const param_type& p);
103 static bool Read(const Message* m, void** iter, param_type* r);
104 static void Log(const param_type& p, std::string* l);
105};
106
107} // namespace IPC
108
109#endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_