Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file is used to define IPC::ParamTraits<> specializations for a number | 5 // This file is used to define IPC::ParamTraits<> specializations for a number |
| 6 // of WebKit types so that they can be serialized over IPC. IPC::ParamTraits<> | 6 // of WebKit types so that they can be serialized over IPC. IPC::ParamTraits<> |
| 7 // specializations for basic types (like int and std::string) and types in the | 7 // specializations for basic types (like int and std::string) and types in the |
| 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains | 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains |
| 9 // specializations for types that are used by the content code, and which need | 9 // specializations for types that are used by the content code, and which need |
| 10 // manual serialization code. This is usually because they're not structs with | 10 // manual serialization code. This is usually because they're not structs with |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 LogParam(p->size, l); | 225 LogParam(p->size, l); |
| 226 l->append(", "); | 226 l->append(", "); |
| 227 LogParam(p->type, l); | 227 LogParam(p->type, l); |
| 228 l->append(", "); | 228 l->append(", "); |
| 229 LogParam(p->timeStampSeconds, l); | 229 LogParam(p->timeStampSeconds, l); |
| 230 l->append(")"); | 230 l->append(")"); |
| 231 } | 231 } |
| 232 }; | 232 }; |
| 233 | 233 |
| 234 template <> | 234 template <> |
| 235 struct CONTENT_EXPORT ParamTraits<WebKit::WebString> { | |
|
jam
2012/02/10 18:00:09
I think it was by design that we didn't have this
| |
| 236 typedef WebKit::WebString param_type; | |
| 237 static void Write(Message* m, const param_type& p); | |
|
darin (slow to review)
2012/02/13 17:40:43
yes, please please please don't add this. WebStri
| |
| 238 static bool Read(const Message* m, void** iter, param_type* p); | |
| 239 static void Log(const param_type& p, std::string* l); | |
| 240 }; | |
| 241 | |
| 242 template <> | |
| 235 struct SimilarTypeTraits<WebKit::WebTextDirection> { | 243 struct SimilarTypeTraits<WebKit::WebTextDirection> { |
| 236 typedef int Type; | 244 typedef int Type; |
| 237 }; | 245 }; |
| 238 | 246 |
| 239 template <> | 247 template <> |
| 240 struct SimilarTypeTraits<WindowOpenDisposition> { | 248 struct SimilarTypeTraits<WindowOpenDisposition> { |
| 241 typedef int Type; | 249 typedef int Type; |
| 242 }; | 250 }; |
| 243 | 251 |
| 244 template <> | 252 template <> |
| 245 struct CONTENT_EXPORT ParamTraits<webkit::forms::PasswordForm> { | 253 struct CONTENT_EXPORT ParamTraits<webkit::forms::PasswordForm> { |
| 246 typedef webkit::forms::PasswordForm param_type; | 254 typedef webkit::forms::PasswordForm param_type; |
| 247 static void Write(Message* m, const param_type& p); | 255 static void Write(Message* m, const param_type& p); |
| 248 static bool Read(const Message* m, void** iter, param_type* p); | 256 static bool Read(const Message* m, void** iter, param_type* p); |
| 249 static void Log(const param_type& p, std::string* l); | 257 static void Log(const param_type& p, std::string* l); |
| 250 }; | 258 }; |
| 251 | 259 |
| 252 } // namespace IPC | 260 } // namespace IPC |
| 253 | 261 |
| 254 #endif // CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ | 262 #endif // CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ |
| OLD | NEW |