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

Side by Side Diff: chrome/common/safe_browsing/protobuf_message_log_macros.h

Issue 1004323003: Add support for sending protobuf messages over IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@zip
Patch Set: remove todo and enable for cros Created 5 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_LOG_MACROS_H_
6 #define CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_LOG_MACROS_H_
7
8 // Null out all the macros that need nulling.
9 #include "chrome/common/safe_browsing/ipc_protobuf_message_null_macros.h"
10
11 // Set up so next include will generate log methods.
12 #undef IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN
13 #undef IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER
14 #undef IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER
15 #undef IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER
16 #undef IPC_PROTOBUF_MESSAGE_TRAITS_END
17
18 #define IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN(message_name) \
19 void ParamTraits<message_name>::Log(const param_type& p, std::string* l) { \
20 bool needs_comma = false; \
21 l->append("(");
22 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(name) \
23 if (needs_comma) \
24 l->append(", "); \
25 LogParam(p.name(), l); \
26 needs_comma = true;
27 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(name) \
28 if (needs_comma) \
29 l->append(", "); \
30 LogParam(p.name(), l); \
31 needs_comma = true;
32 #define IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(name) \
33 if (needs_comma) \
34 l->append(", "); \
35 LogParam(p.name(), l); \
36 needs_comma = true;
37 #define IPC_PROTOBUF_MESSAGE_TRAITS_END() }
38
39 #endif // CHROME_COMMON_SAFE_BROWSING_PROTOBUF_MESSAGE_LOG_MACROS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698