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

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

Issue 1659003003: IPC::Message -> base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more mac fix Created 4 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
OLDNEW
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 // Protobuf Messages over IPC 5 // Protobuf Messages over IPC
6 // 6 //
7 // Protobuf messages are registered with IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN() and 7 // Protobuf messages are registered with IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN() and
8 // friends in much the same way as other externally-defined structs (see 8 // friends in much the same way as other externally-defined structs (see
9 // ipc/ipc_message_macros.h). These macros also cause only registration of the 9 // ipc/ipc_message_macros.h). These macros also cause only registration of the
10 // protobuf message type IPC with message generation. Within matching calls to 10 // protobuf message type IPC with message generation. Within matching calls to
(...skipping 13 matching lines...) Expand all
24 // validation expression should be the _IsValid() function provided by the 24 // validation expression should be the _IsValid() function provided by the
25 // generated protobuf code. For example: 25 // generated protobuf code. For example:
26 // 26 //
27 // IPC_ENUM_TRAITS_VALIDATE(MyEnumType, MyEnumType_IsValid(value)) 27 // IPC_ENUM_TRAITS_VALIDATE(MyEnumType, MyEnumType_IsValid(value))
28 28
29 #ifndef CHROME_COMMON_SAFE_BROWSING_IPC_PROTOBUF_MESSAGE_MACROS_H_ 29 #ifndef CHROME_COMMON_SAFE_BROWSING_IPC_PROTOBUF_MESSAGE_MACROS_H_
30 #define CHROME_COMMON_SAFE_BROWSING_IPC_PROTOBUF_MESSAGE_MACROS_H_ 30 #define CHROME_COMMON_SAFE_BROWSING_IPC_PROTOBUF_MESSAGE_MACROS_H_
31 31
32 #include <string> 32 #include <string>
33 33
34 #define IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN(message_name) \ 34 #define IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN(message_name) \
35 namespace IPC { \ 35 namespace IPC { \
36 template <> \ 36 template <> \
37 struct IPC_MESSAGE_EXPORT ParamTraits<message_name> { \ 37 struct IPC_MESSAGE_EXPORT ParamTraits<message_name> { \
38 typedef message_name param_type; \ 38 typedef message_name param_type; \
39 static void Write(Message* m, const param_type& p); \ 39 static void Write(base::Pickle* m, const param_type& p); \
40 static bool Read(const Message* m, base::PickleIterator* iter, \ 40 static bool Read(const base::Pickle* m, \
41 param_type* p); \ 41 base::PickleIterator* iter, \
42 static void Log(const param_type& p, std::string* l); \ 42 param_type* p); \
43 \ 43 static void Log(const param_type& p, std::string* l); \
44 private: \ 44 \
45 template <class P> \ 45 private: \
46 static bool ReadParamF(const Message* m, \ 46 template <class P> \
47 base::PickleIterator* iter, \ 47 static bool ReadParamF(const base::Pickle* m, \
48 param_type* p, \ 48 base::PickleIterator* iter, \
49 void (param_type::*setter_function)(P)); \ 49 param_type* p, \
50 }; \ 50 void (param_type::*setter_function)(P)); \
51 }; \
51 } // namespace IPC 52 } // namespace IPC
52 53
53 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(name) 54 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(name)
54 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(name) 55 #define IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(name)
55 #define IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(name) 56 #define IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(name)
56 #define IPC_PROTOBUF_MESSAGE_TRAITS_END() 57 #define IPC_PROTOBUF_MESSAGE_TRAITS_END()
57 58
58 #endif // CHROME_COMMON_SAFE_BROWSING_IPC_PROTOBUF_MESSAGE_MACROS_H_ 59 #endif // CHROME_COMMON_SAFE_BROWSING_IPC_PROTOBUF_MESSAGE_MACROS_H_
OLDNEW
« no previous file with comments | « chrome/common/render_messages.cc ('k') | chrome/common/safe_browsing/protobuf_message_param_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698