OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_WRITE_MACROS_H_ | 5 #ifndef CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_WRITE_MACROS_H_ |
6 #define CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_WRITE_MACROS_H_ | 6 #define CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_WRITE_MACROS_H_ |
7 | 7 |
8 // Null out all the macros that need nulling. | 8 // Null out all the macros that need nulling. |
9 #include "chrome/common/safe_browsing/ipc_protobuf_message_null_macros.h" | 9 #include "chrome/common/safe_browsing/ipc_protobuf_message_null_macros.h" |
10 | 10 |
11 // Set up so next include will generate write methods. | 11 // Set up so next include will generate write methods. |
12 #undef IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN | 12 #undef IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN |
13 #undef IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER | 13 #undef IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER |
14 #undef IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER | 14 #undef IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER |
15 #undef IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER | 15 #undef IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER |
16 #undef IPC_PROTOBUF_MESSAGE_TRAITS_END | 16 #undef IPC_PROTOBUF_MESSAGE_TRAITS_END |
17 | 17 |
18 #define IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN(message_name) \ | 18 #define IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN(message_name) \ |
19 void ParamTraits<message_name>::Write(Message* m, const param_type& p) { | 19 void ParamTraits<message_name>::Write(base::Pickle* m, const param_type& p) { |
20 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER \ | 20 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER \ |
21 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER | 21 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER |
22 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(name) \ | 22 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(name) \ |
23 if (p.has_##name()) { \ | 23 if (p.has_##name()) { \ |
24 m->WriteBool(true); \ | 24 m->WriteBool(true); \ |
25 WriteParam(m, p.name()); \ | 25 WriteParam(m, p.name()); \ |
26 } else { \ | 26 } else { \ |
27 m->WriteBool(false); \ | 27 m->WriteBool(false); \ |
28 } | 28 } |
29 #define IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(name) \ | 29 #define IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(name) \ |
30 WriteParam(m, p.name()); | 30 WriteParam(m, p.name()); |
31 #define IPC_PROTOBUF_MESSAGE_TRAITS_END() } | 31 #define IPC_PROTOBUF_MESSAGE_TRAITS_END() } |
32 | 32 |
33 #endif // CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_WRITE_MACROS_H_ | 33 #endif // CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_WRITE_MACROS_H_ |
OLD | NEW |