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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/pickle.h" | 13 #include "base/pickle.h" |
14 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
15 #include "ipc/attachment_broker.h" | |
16 #include "ipc/brokerable_attachment.h" | 15 #include "ipc/brokerable_attachment.h" |
17 #include "ipc/ipc_export.h" | 16 #include "ipc/ipc_export.h" |
18 | 17 |
19 #if !defined(NDEBUG) | 18 #if !defined(NDEBUG) |
20 #define IPC_MESSAGE_LOG_ENABLED | 19 #define IPC_MESSAGE_LOG_ENABLED |
21 #endif | 20 #endif |
22 | 21 |
23 namespace IPC { | 22 namespace IPC { |
24 | 23 |
25 namespace internal { | 24 namespace internal { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 friend class ChannelWin; | 244 friend class ChannelWin; |
246 friend class internal::ChannelReader; | 245 friend class internal::ChannelReader; |
247 friend class MessageReplyDeserializer; | 246 friend class MessageReplyDeserializer; |
248 friend class SyncMessage; | 247 friend class SyncMessage; |
249 | 248 |
250 #pragma pack(push, 4) | 249 #pragma pack(push, 4) |
251 struct Header : base::Pickle::Header { | 250 struct Header : base::Pickle::Header { |
252 int32_t routing; // ID of the view that this message is destined for | 251 int32_t routing; // ID of the view that this message is destined for |
253 uint32_t type; // specifies the user-defined message type | 252 uint32_t type; // specifies the user-defined message type |
254 uint32_t flags; // specifies control flags for the message | 253 uint32_t flags; // specifies control flags for the message |
255 #if USE_ATTACHMENT_BROKER | |
256 // The number of brokered attachments included with this message. The | |
257 // ids of the brokered attachment ids are sent immediately after the pickled | |
258 // message, before the next pickled message is sent. | |
259 uint32_t num_brokered_attachments; | |
260 #endif | |
261 #if defined(OS_POSIX) | 254 #if defined(OS_POSIX) |
262 uint16_t num_fds; // the number of descriptors included with this message | 255 uint16_t num_fds; // the number of descriptors included with this message |
263 uint16_t pad; // explicitly initialize this to appease valgrind | 256 uint16_t pad; // explicitly initialize this to appease valgrind |
264 #endif | 257 #endif |
265 }; | 258 }; |
266 #pragma pack(pop) | 259 #pragma pack(pop) |
267 | 260 |
268 Header* header() { | 261 Header* header() { |
269 return headerT<Header>(); | 262 return headerT<Header>(); |
270 } | 263 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 MSG_ROUTING_NONE = -2, | 306 MSG_ROUTING_NONE = -2, |
314 | 307 |
315 // indicates a general message not sent to a particular tab. | 308 // indicates a general message not sent to a particular tab. |
316 MSG_ROUTING_CONTROL = INT32_MAX, | 309 MSG_ROUTING_CONTROL = INT32_MAX, |
317 }; | 310 }; |
318 | 311 |
319 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 312 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
320 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 313 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
321 | 314 |
322 #endif // IPC_IPC_MESSAGE_H_ | 315 #endif // IPC_IPC_MESSAGE_H_ |
OLD | NEW |