OLD | NEW |
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 #ifndef IPC_IPC_MESSAGE_H_ | 5 #ifndef IPC_IPC_MESSAGE_H_ |
6 #define IPC_IPC_MESSAGE_H_ | 6 #define IPC_IPC_MESSAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/pickle.h" | 12 #include "base/pickle.h" |
13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
14 #include "ipc/attachment_broker.h" | |
15 #include "ipc/ipc_export.h" | 14 #include "ipc/ipc_export.h" |
16 | 15 |
17 #if !defined(NDEBUG) | 16 #if !defined(NDEBUG) |
18 #define IPC_MESSAGE_LOG_ENABLED | 17 #define IPC_MESSAGE_LOG_ENABLED |
19 #endif | 18 #endif |
20 | 19 |
21 namespace IPC { | 20 namespace IPC { |
22 | 21 |
23 namespace internal { | 22 namespace internal { |
24 class ChannelReader; | 23 class ChannelReader; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 friend class ChannelWin; | 215 friend class ChannelWin; |
217 friend class internal::ChannelReader; | 216 friend class internal::ChannelReader; |
218 friend class MessageReplyDeserializer; | 217 friend class MessageReplyDeserializer; |
219 friend class SyncMessage; | 218 friend class SyncMessage; |
220 | 219 |
221 #pragma pack(push, 4) | 220 #pragma pack(push, 4) |
222 struct Header : base::Pickle::Header { | 221 struct Header : base::Pickle::Header { |
223 int32 routing; // ID of the view that this message is destined for | 222 int32 routing; // ID of the view that this message is destined for |
224 uint32 type; // specifies the user-defined message type | 223 uint32 type; // specifies the user-defined message type |
225 uint32 flags; // specifies control flags for the message | 224 uint32 flags; // specifies control flags for the message |
226 #if USE_ATTACHMENT_BROKER | |
227 // The number of brokered attachments included with this message. The | |
228 // ids of the brokered attachment ids are sent immediately after the pickled | |
229 // message, before the next pickled message is sent. | |
230 uint32 num_brokered_attachments; | |
231 #endif | |
232 #if defined(OS_POSIX) | 225 #if defined(OS_POSIX) |
233 uint16 num_fds; // the number of descriptors included with this message | 226 uint16 num_fds; // the number of descriptors included with this message |
234 uint16 pad; // explicitly initialize this to appease valgrind | 227 uint16 pad; // explicitly initialize this to appease valgrind |
235 #endif | 228 #endif |
236 }; | 229 }; |
237 #pragma pack(pop) | 230 #pragma pack(pop) |
238 | 231 |
239 Header* header() { | 232 Header* header() { |
240 return headerT<Header>(); | 233 return headerT<Header>(); |
241 } | 234 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 MSG_ROUTING_NONE = -2, | 277 MSG_ROUTING_NONE = -2, |
285 | 278 |
286 // indicates a general message not sent to a particular tab. | 279 // indicates a general message not sent to a particular tab. |
287 MSG_ROUTING_CONTROL = kint32max, | 280 MSG_ROUTING_CONTROL = kint32max, |
288 }; | 281 }; |
289 | 282 |
290 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 283 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
291 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 284 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
292 | 285 |
293 #endif // IPC_IPC_MESSAGE_H_ | 286 #endif // IPC_IPC_MESSAGE_H_ |
OLD | NEW |