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/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/pickle.h" | 14 #include "base/pickle.h" |
15 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
16 #include "ipc/attachment_broker.h" | |
17 #include "ipc/brokerable_attachment.h" | 16 #include "ipc/brokerable_attachment.h" |
18 #include "ipc/ipc_export.h" | 17 #include "ipc/ipc_export.h" |
19 | 18 |
20 #if !defined(NDEBUG) | 19 #if !defined(NDEBUG) |
21 #define IPC_MESSAGE_LOG_ENABLED | 20 #define IPC_MESSAGE_LOG_ENABLED |
22 #endif | 21 #endif |
23 | 22 |
24 namespace IPC { | 23 namespace IPC { |
25 | 24 |
26 namespace internal { | 25 namespace internal { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 friend class ChannelWin; | 261 friend class ChannelWin; |
263 friend class internal::ChannelReader; | 262 friend class internal::ChannelReader; |
264 friend class MessageReplyDeserializer; | 263 friend class MessageReplyDeserializer; |
265 friend class SyncMessage; | 264 friend class SyncMessage; |
266 | 265 |
267 #pragma pack(push, 4) | 266 #pragma pack(push, 4) |
268 struct Header : base::Pickle::Header { | 267 struct Header : base::Pickle::Header { |
269 int32_t routing; // ID of the view that this message is destined for | 268 int32_t routing; // ID of the view that this message is destined for |
270 uint32_t type; // specifies the user-defined message type | 269 uint32_t type; // specifies the user-defined message type |
271 uint32_t flags; // specifies control flags for the message | 270 uint32_t flags; // specifies control flags for the message |
272 #if USE_ATTACHMENT_BROKER | 271 #if defined(OS_MACOSX) |
273 // The number of brokered attachments included with this message. The | 272 // The number of brokered attachments included with this message. The |
274 // ids of the brokered attachment ids are sent immediately after the pickled | 273 // ids of the brokered attachment ids are sent immediately after the pickled |
275 // message, before the next pickled message is sent. | 274 // message, before the next pickled message is sent. |
276 uint32_t num_brokered_attachments; | 275 uint32_t num_brokered_attachments; |
277 #endif | 276 #endif |
278 #if defined(OS_POSIX) | 277 #if defined(OS_POSIX) |
279 uint16_t num_fds; // the number of descriptors included with this message | 278 uint16_t num_fds; // the number of descriptors included with this message |
280 uint16_t pad; // explicitly initialize this to appease valgrind | 279 uint16_t pad; // explicitly initialize this to appease valgrind |
281 #endif | 280 #endif |
282 }; | 281 }; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 MSG_ROUTING_NONE = -2, | 332 MSG_ROUTING_NONE = -2, |
334 | 333 |
335 // indicates a general message not sent to a particular tab. | 334 // indicates a general message not sent to a particular tab. |
336 MSG_ROUTING_CONTROL = INT32_MAX, | 335 MSG_ROUTING_CONTROL = INT32_MAX, |
337 }; | 336 }; |
338 | 337 |
339 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 338 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
340 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 339 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
341 | 340 |
342 #endif // IPC_IPC_MESSAGE_H_ | 341 #endif // IPC_IPC_MESSAGE_H_ |
OLD | NEW |