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

Side by Side Diff: ipc/attachment_broker_messages.h

Issue 1532053002: use variadic macros/templates in IPC message implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify Created 5 years 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 // IPC messages used by the attachment broker. 5 // IPC messages used by the attachment broker.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 #include "base/process/process_handle.h" 8 #include "base/process/process_handle.h"
9 #include "ipc/brokerable_attachment.h" 9 #include "ipc/brokerable_attachment.h"
10 #include "ipc/ipc_export.h" 10 #include "ipc/ipc_export.h"
11 #include "ipc/ipc_message_macros.h" 11 #include "ipc/ipc_message_macros.h"
12 12
13 #if defined(OS_WIN) 13 #if defined(OS_WIN)
14 #include "ipc/handle_attachment_win.h" 14 #include "ipc/handle_attachment_win.h"
15 #endif // defined(OS_WIN) 15 #endif // defined(OS_WIN)
16 16
17 #if defined(OS_MACOSX) 17 #if defined(OS_MACOSX)
18 #include "ipc/mach_port_attachment_mac.h" 18 #include "ipc/mach_port_attachment_mac.h"
19 #endif // defined(OS_MACOSX) 19 #endif // defined(OS_MACOSX)
20 20
21 #undef IPC_MESSAGE_EXPORT
danakj 2015/12/19 00:15:06 Why is this moved?
mdempsky 2015/12/19 02:14:48 I was trying to fix the Windows component build an
22 #define IPC_MESSAGE_EXPORT IPC_EXPORT
23 #define IPC_MESSAGE_START AttachmentBrokerMsgStart
24
21 // ---------------------------------------------------------------------------- 25 // ----------------------------------------------------------------------------
22 // Serialization of structs. 26 // Serialization of structs.
23 // ---------------------------------------------------------------------------- 27 // ----------------------------------------------------------------------------
24 28
25 #if defined(OS_WIN) 29 #if defined(OS_WIN)
26 // Define the serialization for Permissions. 30 // Define the serialization for Permissions.
27 IPC_ENUM_TRAITS_MAX_VALUE(HandleWin::Permissions, HandleWin::MAX_PERMISSIONS); 31 IPC_ENUM_TRAITS_MAX_VALUE(HandleWin::Permissions, HandleWin::MAX_PERMISSIONS);
28 32
29 IPC_STRUCT_TRAITS_BEGIN(IPC::internal::HandleAttachmentWin::WireFormat) 33 IPC_STRUCT_TRAITS_BEGIN(IPC::internal::HandleAttachmentWin::WireFormat)
30 IPC_STRUCT_TRAITS_MEMBER(handle) 34 IPC_STRUCT_TRAITS_MEMBER(handle)
31 IPC_STRUCT_TRAITS_MEMBER(destination_process) 35 IPC_STRUCT_TRAITS_MEMBER(destination_process)
32 IPC_STRUCT_TRAITS_MEMBER(permissions) 36 IPC_STRUCT_TRAITS_MEMBER(permissions)
33 IPC_STRUCT_TRAITS_MEMBER(attachment_id) 37 IPC_STRUCT_TRAITS_MEMBER(attachment_id)
34 IPC_STRUCT_TRAITS_END() 38 IPC_STRUCT_TRAITS_END()
35 #endif // defined(OS_WIN) 39 #endif // defined(OS_WIN)
36 40
37 #if defined(OS_MACOSX) 41 #if defined(OS_MACOSX)
38 IPC_STRUCT_TRAITS_BEGIN(IPC::internal::MachPortAttachmentMac::WireFormat) 42 IPC_STRUCT_TRAITS_BEGIN(IPC::internal::MachPortAttachmentMac::WireFormat)
39 IPC_STRUCT_TRAITS_MEMBER(mach_port) 43 IPC_STRUCT_TRAITS_MEMBER(mach_port)
40 IPC_STRUCT_TRAITS_MEMBER(destination_process) 44 IPC_STRUCT_TRAITS_MEMBER(destination_process)
41 IPC_STRUCT_TRAITS_MEMBER(attachment_id) 45 IPC_STRUCT_TRAITS_MEMBER(attachment_id)
42 IPC_STRUCT_TRAITS_END() 46 IPC_STRUCT_TRAITS_END()
43 #endif // defined(OS_MACOSX) 47 #endif // defined(OS_MACOSX)
44 48
45 #undef IPC_MESSAGE_EXPORT
46 #define IPC_MESSAGE_EXPORT IPC_EXPORT
47 #define IPC_MESSAGE_START AttachmentBrokerMsgStart
48
49 // ---------------------------------------------------------------------------- 49 // ----------------------------------------------------------------------------
50 // Messages sent from the broker to a non-broker process. 50 // Messages sent from the broker to a non-broker process.
51 // ---------------------------------------------------------------------------- 51 // ----------------------------------------------------------------------------
52 52
53 #if defined(OS_WIN) 53 #if defined(OS_WIN)
54 // Sent from a broker to a non-broker to indicate that a windows HANDLE has been 54 // Sent from a broker to a non-broker to indicate that a windows HANDLE has been
55 // brokered. Contains all information necessary for the non-broker to translate 55 // brokered. Contains all information necessary for the non-broker to translate
56 // a BrokerAttachment::AttachmentId to a BrokerAttachment. 56 // a BrokerAttachment::AttachmentId to a BrokerAttachment.
57 IPC_MESSAGE_CONTROL1( 57 IPC_MESSAGE_CONTROL1(
58 AttachmentBrokerMsg_WinHandleHasBeenDuplicated, 58 AttachmentBrokerMsg_WinHandleHasBeenDuplicated,
(...skipping 24 matching lines...) Expand all
83 #endif // defined(OS_WIN) 83 #endif // defined(OS_WIN)
84 84
85 #if defined(OS_MACOSX) 85 #if defined(OS_MACOSX)
86 // Sent from a non-broker process to a broker process to request the duplication 86 // Sent from a non-broker process to a broker process to request the duplication
87 // of a Mach port into a different process (possibly the broker process, or even 87 // of a Mach port into a different process (possibly the broker process, or even
88 // the original process). 88 // the original process).
89 IPC_MESSAGE_CONTROL1( 89 IPC_MESSAGE_CONTROL1(
90 AttachmentBrokerMsg_DuplicateMachPort, 90 AttachmentBrokerMsg_DuplicateMachPort,
91 IPC::internal::MachPortAttachmentMac::WireFormat /* wire_format */) 91 IPC::internal::MachPortAttachmentMac::WireFormat /* wire_format */)
92 #endif // defined(OS_MACOSX) 92 #endif // defined(OS_MACOSX)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698