Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: content/public/common/common_param_traits.h

Issue 138753004: Cast: IPC glue between cast library transport and encoders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor cleanup Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/content_param_traits.cc ('k') | content/public/common/common_param_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // 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 types so that they can be serialized over IPC. IPC::ParamTraits<> 6 // of 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 20 matching lines...) Expand all
31 namespace gfx { 31 namespace gfx {
32 class Point; 32 class Point;
33 class Rect; 33 class Rect;
34 class RectF; 34 class RectF;
35 class Size; 35 class Size;
36 class Vector2d; 36 class Vector2d;
37 } // namespace gfx 37 } // namespace gfx
38 38
39 namespace net { 39 namespace net {
40 class HostPortPair; 40 class HostPortPair;
41 class IPEndPoint;
41 } 42 }
42 43
43 namespace IPC { 44 namespace IPC {
44 45
45 template <> 46 template <>
46 struct CONTENT_EXPORT ParamTraits<GURL> { 47 struct CONTENT_EXPORT ParamTraits<GURL> {
47 typedef GURL param_type; 48 typedef GURL param_type;
48 static void Write(Message* m, const param_type& p); 49 static void Write(Message* m, const param_type& p);
49 static bool Read(const Message* m, PickleIterator* iter, param_type* p); 50 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
50 static void Log(const param_type& p, std::string* l); 51 static void Log(const param_type& p, std::string* l);
51 }; 52 };
52 53
53 template<> 54 template<>
54 struct CONTENT_EXPORT ParamTraits<net::HostPortPair> { 55 struct CONTENT_EXPORT ParamTraits<net::HostPortPair> {
55 typedef net::HostPortPair param_type; 56 typedef net::HostPortPair param_type;
56 static void Write(Message* m, const param_type& p); 57 static void Write(Message* m, const param_type& p);
57 static bool Read(const Message* m, PickleIterator* iter, param_type* r); 58 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
58 static void Log(const param_type& p, std::string* l); 59 static void Log(const param_type& p, std::string* l);
59 }; 60 };
60 61
61 template <> 62 template <>
63 struct CONTENT_EXPORT ParamTraits<net::IPEndPoint> {
64 typedef net::IPEndPoint param_type;
65 static void Write(Message* m, const param_type& p);
66 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
67 static void Log(const param_type& p, std::string* l);
68 };
69
70 template <>
62 struct CONTENT_EXPORT ParamTraits<content::PageState> { 71 struct CONTENT_EXPORT ParamTraits<content::PageState> {
63 typedef content::PageState param_type; 72 typedef content::PageState param_type;
64 static void Write(Message* m, const param_type& p); 73 static void Write(Message* m, const param_type& p);
65 static bool Read(const Message* m, PickleIterator* iter, param_type* p); 74 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
66 static void Log(const param_type& p, std::string* l); 75 static void Log(const param_type& p, std::string* l);
67 }; 76 };
68 77
69 template <> 78 template <>
70 struct CONTENT_EXPORT ParamTraits<gfx::Point> { 79 struct CONTENT_EXPORT ParamTraits<gfx::Point> {
71 typedef gfx::Point param_type; 80 typedef gfx::Point param_type;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // Note: This function expects parameter |r| to be of type &SkBitmap since 219 // Note: This function expects parameter |r| to be of type &SkBitmap since
211 // r->SetConfig() and r->SetPixels() are called. 220 // r->SetConfig() and r->SetPixels() are called.
212 static bool Read(const Message* m, PickleIterator* iter, param_type* r); 221 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
213 222
214 static void Log(const param_type& p, std::string* l); 223 static void Log(const param_type& p, std::string* l);
215 }; 224 };
216 225
217 } // namespace IPC 226 } // namespace IPC
218 227
219 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ 228 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_
OLDNEW
« no previous file with comments | « content/common/content_param_traits.cc ('k') | content/public/common/common_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698