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

Side by Side Diff: ipc/ipc_message_macros.h

Issue 1665363002: Clang plugin to check that unstable types are not used in IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blacklist types instead 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 (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 // Defining IPC Messages 5 // Defining IPC Messages
6 // 6 //
7 // Your IPC messages will be defined by macros inside of an XXX_messages.h 7 // Your IPC messages will be defined by macros inside of an XXX_messages.h
8 // header file. Most of the time, the system can automatically generate all 8 // header file. Most of the time, the system can automatically generate all
9 // of messaging mechanism from these definitions, but sometimes some manual 9 // of messaging mechanism from these definitions, but sometimes some manual
10 // coding is required. In these cases, you will also have an XXX_messages.cc 10 // coding is required. In these cases, you will also have an XXX_messages.cc
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // IPC_SYNC_MESSAGE_CONTROL(BarMsg, (int, int), (bool)) 241 // IPC_SYNC_MESSAGE_CONTROL(BarMsg, (int, int), (bool))
242 // 242 //
243 // Implementation detail: The parentheses supplied by the caller for 243 // Implementation detail: The parentheses supplied by the caller for
244 // disambiguation are also used to trigger the IPC_TUPLE invocations below, 244 // disambiguation are also used to trigger the IPC_TUPLE invocations below,
245 // so "IPC_TUPLE in" and "IPC_TUPLE out" are intentional. 245 // so "IPC_TUPLE in" and "IPC_TUPLE out" are intentional.
246 #define IPC_SYNC_MESSAGE_CONTROL(msg_class, in, out) \ 246 #define IPC_SYNC_MESSAGE_CONTROL(msg_class, in, out) \
247 IPC_MESSAGE_DECL(msg_class, CONTROL, IPC_TUPLE in, IPC_TUPLE out) 247 IPC_MESSAGE_DECL(msg_class, CONTROL, IPC_TUPLE in, IPC_TUPLE out)
248 #define IPC_SYNC_MESSAGE_ROUTED(msg_class, in, out) \ 248 #define IPC_SYNC_MESSAGE_ROUTED(msg_class, in, out) \
249 IPC_MESSAGE_DECL(msg_class, ROUTED, IPC_TUPLE in, IPC_TUPLE out) 249 IPC_MESSAGE_DECL(msg_class, ROUTED, IPC_TUPLE in, IPC_TUPLE out)
250 250
251 #define IPC_TUPLE(...) base::Tuple<__VA_ARGS__> 251 #define IPC_TUPLE(...) IPC::CheckedTuple<__VA_ARGS__>::Tuple
252 252
253 #define IPC_MESSAGE_DECL(msg_name, kind, in_tuple, out_tuple) \ 253 #define IPC_MESSAGE_DECL(msg_name, kind, in_tuple, out_tuple) \
254 struct IPC_MESSAGE_EXPORT msg_name##_Meta { \ 254 struct IPC_MESSAGE_EXPORT msg_name##_Meta { \
255 using InTuple = in_tuple; \ 255 using InTuple = in_tuple; \
256 using OutTuple = out_tuple; \ 256 using OutTuple = out_tuple; \
257 enum { ID = IPC_MESSAGE_ID() }; \ 257 enum { ID = IPC_MESSAGE_ID() }; \
258 static const IPC::MessageKind kKind = IPC::MessageKind::kind; \ 258 static const IPC::MessageKind kKind = IPC::MessageKind::kind; \
259 static const char kName[]; \ 259 static const char kName[]; \
260 }; \ 260 }; \
261 extern template class EXPORT_TEMPLATE_DECLARE(IPC_MESSAGE_EXPORT) \ 261 extern template class EXPORT_TEMPLATE_DECLARE(IPC_MESSAGE_EXPORT) \
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 IPC_SYNC_MESSAGE_ROUTED(msg, (a, b, c, d, e), (f, g, h)) 542 IPC_SYNC_MESSAGE_ROUTED(msg, (a, b, c, d, e), (f, g, h))
543 #define IPC_SYNC_MESSAGE_ROUTED5_4(msg, a, b, c, d, e, f, g, h, i) \ 543 #define IPC_SYNC_MESSAGE_ROUTED5_4(msg, a, b, c, d, e, f, g, h, i) \
544 IPC_SYNC_MESSAGE_ROUTED(msg, (a, b, c, d, e), (f, g, h, i)) 544 IPC_SYNC_MESSAGE_ROUTED(msg, (a, b, c, d, e), (f, g, h, i))
545 545
546 #endif // IPC_IPC_MESSAGE_MACROS_H_ 546 #endif // IPC_IPC_MESSAGE_MACROS_H_
547 547
548 // Clean up IPC_MESSAGE_START in this unguarded section so that the 548 // Clean up IPC_MESSAGE_START in this unguarded section so that the
549 // XXX_messages.h files need not do so themselves. This makes the 549 // XXX_messages.h files need not do so themselves. This makes the
550 // XXX_messages.h files easier to write. 550 // XXX_messages.h files easier to write.
551 #undef IPC_MESSAGE_START 551 #undef IPC_MESSAGE_START
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698