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