OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 5 #ifndef PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
6 #define PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 6 #define PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 } // namespace proxy | 43 } // namespace proxy |
44 } // namespace ppapi | 44 } // namespace ppapi |
45 | 45 |
46 namespace IPC { | 46 namespace IPC { |
47 | 47 |
48 template<> | 48 template<> |
49 struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> { | 49 struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> { |
50 typedef PP_Bool param_type; | 50 typedef PP_Bool param_type; |
51 static void Write(Message* m, const param_type& p); | 51 static void Write(Message* m, const param_type& p); |
52 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 52 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
53 static void Log(const param_type& p, std::string* l); | 53 static void Log(const param_type& p, std::string* l); |
54 }; | 54 }; |
55 | 55 |
56 template <> | 56 template <> |
57 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { | 57 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { |
58 typedef PP_NetAddress_Private param_type; | 58 typedef PP_NetAddress_Private param_type; |
59 static void Write(Message* m, const param_type& p); | 59 static void Write(Message* m, const param_type& p); |
60 static bool Read(const Message* m, PickleIterator* iter, param_type* p); | 60 static bool Read(const Message* m, base::PickleIterator* iter, param_type* p); |
61 static void Log(const param_type& p, std::string* l); | 61 static void Log(const param_type& p, std::string* l); |
62 }; | 62 }; |
63 | 63 |
64 template <> | 64 template <> |
65 struct PPAPI_PROXY_EXPORT ParamTraits<PP_KeyInformation> { | 65 struct PPAPI_PROXY_EXPORT ParamTraits<PP_KeyInformation> { |
66 typedef PP_KeyInformation param_type; | 66 typedef PP_KeyInformation param_type; |
67 static void Write(Message* m, const param_type& p); | 67 static void Write(Message* m, const param_type& p); |
68 static bool Read(const Message* m, PickleIterator* iter, param_type* p); | 68 static bool Read(const Message* m, base::PickleIterator* iter, param_type* p); |
69 static void Log(const param_type& p, std::string* l); | 69 static void Log(const param_type& p, std::string* l); |
70 }; | 70 }; |
71 | 71 |
72 template<> | 72 template<> |
73 struct PPAPI_PROXY_EXPORT ParamTraits< | 73 struct PPAPI_PROXY_EXPORT ParamTraits< |
74 ppapi::proxy::PPBFlash_DrawGlyphs_Params> { | 74 ppapi::proxy::PPBFlash_DrawGlyphs_Params> { |
75 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; | 75 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; |
76 static void Write(Message* m, const param_type& p); | 76 static void Write(Message* m, const param_type& p); |
77 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 77 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
78 static void Log(const param_type& p, std::string* l); | 78 static void Log(const param_type& p, std::string* l); |
79 }; | 79 }; |
80 | 80 |
81 template<> | 81 template<> |
82 struct PPAPI_PROXY_EXPORT ParamTraits< | 82 struct PPAPI_PROXY_EXPORT ParamTraits< |
83 ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { | 83 ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { |
84 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; | 84 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; |
85 static void Write(Message* m, const param_type& p); | 85 static void Write(Message* m, const param_type& p); |
86 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 86 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
87 static void Log(const param_type& p, std::string* l); | 87 static void Log(const param_type& p, std::string* l); |
88 }; | 88 }; |
89 | 89 |
90 template<> | 90 template<> |
91 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedDirEntry> { | 91 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedDirEntry> { |
92 typedef ppapi::proxy::SerializedDirEntry param_type; | 92 typedef ppapi::proxy::SerializedDirEntry param_type; |
93 static void Write(Message* m, const param_type& p); | 93 static void Write(Message* m, const param_type& p); |
94 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 94 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
95 static void Log(const param_type& p, std::string* l); | 95 static void Log(const param_type& p, std::string* l); |
96 }; | 96 }; |
97 | 97 |
98 template<> | 98 template<> |
99 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFontDescription> { | 99 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFontDescription> { |
100 typedef ppapi::proxy::SerializedFontDescription param_type; | 100 typedef ppapi::proxy::SerializedFontDescription param_type; |
101 static void Write(Message* m, const param_type& p); | 101 static void Write(Message* m, const param_type& p); |
102 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 102 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
103 static void Log(const param_type& p, std::string* l); | 103 static void Log(const param_type& p, std::string* l); |
104 }; | 104 }; |
105 | 105 |
106 template<> | 106 template<> |
107 struct PPAPI_PROXY_EXPORT | 107 struct PPAPI_PROXY_EXPORT |
108 ParamTraits<ppapi::proxy::SerializedTrueTypeFontDesc> { | 108 ParamTraits<ppapi::proxy::SerializedTrueTypeFontDesc> { |
109 typedef ppapi::proxy::SerializedTrueTypeFontDesc param_type; | 109 typedef ppapi::proxy::SerializedTrueTypeFontDesc param_type; |
110 static void Write(Message* m, const param_type& p); | 110 static void Write(Message* m, const param_type& p); |
111 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 111 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
112 static void Log(const param_type& p, std::string* l); | 112 static void Log(const param_type& p, std::string* l); |
113 }; | 113 }; |
114 | 114 |
115 template<> | 115 template<> |
116 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedHandle> { | 116 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedHandle> { |
117 typedef ppapi::proxy::SerializedHandle param_type; | 117 typedef ppapi::proxy::SerializedHandle param_type; |
118 static void Write(Message* m, const param_type& p); | 118 static void Write(Message* m, const param_type& p); |
119 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 119 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
120 static void Log(const param_type& p, std::string* l); | 120 static void Log(const param_type& p, std::string* l); |
121 }; | 121 }; |
122 | 122 |
123 template<> | 123 template<> |
124 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::HostResource> { | 124 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::HostResource> { |
125 typedef ppapi::HostResource param_type; | 125 typedef ppapi::HostResource param_type; |
126 static void Write(Message* m, const param_type& p); | 126 static void Write(Message* m, const param_type& p); |
127 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 127 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
128 static void Log(const param_type& p, std::string* l); | 128 static void Log(const param_type& p, std::string* l); |
129 }; | 129 }; |
130 | 130 |
131 template<> | 131 template<> |
132 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedVar> { | 132 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedVar> { |
133 typedef ppapi::proxy::SerializedVar param_type; | 133 typedef ppapi::proxy::SerializedVar param_type; |
134 static void Write(Message* m, const param_type& p); | 134 static void Write(Message* m, const param_type& p); |
135 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 135 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
136 static void Log(const param_type& p, std::string* l); | 136 static void Log(const param_type& p, std::string* l); |
137 }; | 137 }; |
138 | 138 |
139 template<> | 139 template<> |
140 struct PPAPI_PROXY_EXPORT ParamTraits< | 140 struct PPAPI_PROXY_EXPORT ParamTraits< |
141 std::vector<ppapi::proxy::SerializedVar> > { | 141 std::vector<ppapi::proxy::SerializedVar> > { |
142 typedef std::vector<ppapi::proxy::SerializedVar> param_type; | 142 typedef std::vector<ppapi::proxy::SerializedVar> param_type; |
143 static void Write(Message* m, const param_type& p); | 143 static void Write(Message* m, const param_type& p); |
144 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 144 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
145 static void Log(const param_type& p, std::string* l); | 145 static void Log(const param_type& p, std::string* l); |
146 }; | 146 }; |
147 | 147 |
148 template<> | 148 template<> |
149 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> { | 149 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> { |
150 typedef ppapi::PpapiPermissions param_type; | 150 typedef ppapi::PpapiPermissions param_type; |
151 static void Write(Message* m, const param_type& p); | 151 static void Write(Message* m, const param_type& p); |
152 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 152 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
153 static void Log(const param_type& p, std::string* l); | 153 static void Log(const param_type& p, std::string* l); |
154 }; | 154 }; |
155 | 155 |
156 #if !defined(OS_NACL) && !defined(NACL_WIN64) | 156 #if !defined(OS_NACL) && !defined(NACL_WIN64) |
157 template <> | 157 template <> |
158 struct ParamTraits<ppapi::PepperFilePath> { | 158 struct ParamTraits<ppapi::PepperFilePath> { |
159 typedef ppapi::PepperFilePath param_type; | 159 typedef ppapi::PepperFilePath param_type; |
160 static void Write(Message* m, const param_type& p); | 160 static void Write(Message* m, const param_type& p); |
161 static bool Read(const Message* m, PickleIterator* iter, param_type* p); | 161 static bool Read(const Message* m, base::PickleIterator* iter, param_type* p); |
162 static void Log(const param_type& p, std::string* l); | 162 static void Log(const param_type& p, std::string* l); |
163 }; | 163 }; |
164 | 164 |
165 template<> | 165 template<> |
166 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFlashMenu> { | 166 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFlashMenu> { |
167 typedef ppapi::proxy::SerializedFlashMenu param_type; | 167 typedef ppapi::proxy::SerializedFlashMenu param_type; |
168 static void Write(Message* m, const param_type& p); | 168 static void Write(Message* m, const param_type& p); |
169 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 169 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
170 static void Log(const param_type& p, std::string* l); | 170 static void Log(const param_type& p, std::string* l); |
171 }; | 171 }; |
172 #endif // !defined(OS_NACL) && !defined(NACL_WIN64) | 172 #endif // !defined(OS_NACL) && !defined(NACL_WIN64) |
173 | 173 |
174 template<> | 174 template<> |
175 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_X509Certificate_Fields> { | 175 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_X509Certificate_Fields> { |
176 typedef ppapi::PPB_X509Certificate_Fields param_type; | 176 typedef ppapi::PPB_X509Certificate_Fields param_type; |
177 static void Write(Message* m, const param_type& p); | 177 static void Write(Message* m, const param_type& p); |
178 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 178 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
179 static void Log(const param_type& p, std::string* l); | 179 static void Log(const param_type& p, std::string* l); |
180 }; | 180 }; |
181 | 181 |
182 template<> | 182 template<> |
183 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::SocketOptionData> { | 183 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::SocketOptionData> { |
184 typedef ppapi::SocketOptionData param_type; | 184 typedef ppapi::SocketOptionData param_type; |
185 static void Write(Message* m, const param_type& p); | 185 static void Write(Message* m, const param_type& p); |
186 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 186 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
187 static void Log(const param_type& p, std::string* l); | 187 static void Log(const param_type& p, std::string* l); |
188 }; | 188 }; |
189 | 189 |
190 template<> | 190 template<> |
191 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::CompositorLayerData::Transform> { | 191 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::CompositorLayerData::Transform> { |
192 typedef ppapi::CompositorLayerData::Transform param_type; | 192 typedef ppapi::CompositorLayerData::Transform param_type; |
193 static void Write(Message* m, const param_type& p); | 193 static void Write(Message* m, const param_type& p); |
194 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 194 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
195 static void Log(const param_type& p, std::string* l); | 195 static void Log(const param_type& p, std::string* l); |
196 }; | 196 }; |
197 | 197 |
198 } // namespace IPC | 198 } // namespace IPC |
199 | 199 |
200 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 200 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
OLD | NEW |