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

Side by Side Diff: ipc/param_traits_macros.h

Issue 1149113006: Move Pickle to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « ipc/mojo/ipc_mojo_param_traits.h ('k') | ipc/param_traits_read_macros.h » ('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 #ifndef IPC_PARAM_TRAITS_MACROS_H_ 5 #ifndef IPC_PARAM_TRAITS_MACROS_H_
6 #define IPC_PARAM_TRAITS_MACROS_H_ 6 #define IPC_PARAM_TRAITS_MACROS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 // Traits generation for structs. 10 // Traits generation for structs.
11 #define IPC_STRUCT_TRAITS_BEGIN(struct_name) \ 11 #define IPC_STRUCT_TRAITS_BEGIN(struct_name) \
12 namespace IPC { \ 12 namespace IPC { \
13 template <> \ 13 template <> \
14 struct IPC_MESSAGE_EXPORT ParamTraits<struct_name> { \ 14 struct IPC_MESSAGE_EXPORT ParamTraits<struct_name> { \
15 typedef struct_name param_type; \ 15 typedef struct_name param_type; \
16 static void Write(Message* m, const param_type& p); \ 16 static void Write(Message* m, const param_type& p); \
17 static bool Read(const Message* m, PickleIterator* iter, param_type* p); \ 17 static bool Read(const Message* m, base::PickleIterator* iter, \
18 param_type* p); \
18 static void Log(const param_type& p, std::string* l); \ 19 static void Log(const param_type& p, std::string* l); \
19 }; \ 20 }; \
20 } 21 }
21 22
22 #define IPC_STRUCT_TRAITS_MEMBER(name) 23 #define IPC_STRUCT_TRAITS_MEMBER(name)
23 #define IPC_STRUCT_TRAITS_PARENT(type) 24 #define IPC_STRUCT_TRAITS_PARENT(type)
24 #define IPC_STRUCT_TRAITS_END() 25 #define IPC_STRUCT_TRAITS_END()
25 26
26 // Convenience macro for defining enumerated type traits for types which are 27 // Convenience macro for defining enumerated type traits for types which are
27 // not range-checked by the IPC system. The author of the message handlers 28 // not range-checked by the IPC system. The author of the message handlers
(...skipping 17 matching lines...) Expand all
45 type, (static_cast<int>(value) >= static_cast<int>(minvalue) && \ 46 type, (static_cast<int>(value) >= static_cast<int>(minvalue) && \
46 static_cast<int>(value) <= static_cast<int>(maxvalue))) 47 static_cast<int>(value) <= static_cast<int>(maxvalue)))
47 48
48 // Traits generation for enums. This macro may be redefined later. 49 // Traits generation for enums. This macro may be redefined later.
49 #define IPC_ENUM_TRAITS_VALIDATE(enum_name, validation_expression) \ 50 #define IPC_ENUM_TRAITS_VALIDATE(enum_name, validation_expression) \
50 namespace IPC { \ 51 namespace IPC { \
51 template <> \ 52 template <> \
52 struct IPC_MESSAGE_EXPORT ParamTraits<enum_name> { \ 53 struct IPC_MESSAGE_EXPORT ParamTraits<enum_name> { \
53 typedef enum_name param_type; \ 54 typedef enum_name param_type; \
54 static void Write(Message* m, const param_type& p); \ 55 static void Write(Message* m, const param_type& p); \
55 static bool Read(const Message* m, PickleIterator* iter, param_type* p); \ 56 static bool Read(const Message* m, base::PickleIterator* iter, \
57 param_type* p); \
56 static void Log(const param_type& p, std::string* l); \ 58 static void Log(const param_type& p, std::string* l); \
57 }; \ 59 }; \
58 } 60 }
59 61
60 #endif // IPC_PARAM_TRAITS_MACROS_H_ 62 #endif // IPC_PARAM_TRAITS_MACROS_H_
61 63
OLDNEW
« no previous file with comments | « ipc/mojo/ipc_mojo_param_traits.h ('k') | ipc/param_traits_read_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698