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/ipc_export.h" | 14 #include "ipc/ipc_export.h" |
15 | 15 |
16 #if !defined(NDEBUG) | 16 #if !defined(NDEBUG) |
17 #define IPC_MESSAGE_LOG_ENABLED | 17 #define IPC_MESSAGE_LOG_ENABLED |
18 #endif | 18 #endif |
19 | 19 |
20 namespace IPC { | 20 namespace IPC { |
21 | 21 |
| 22 namespace internal { |
| 23 class ChannelReader; |
| 24 } // namespace internal |
| 25 |
22 //------------------------------------------------------------------------------ | 26 //------------------------------------------------------------------------------ |
23 | 27 |
24 struct LogData; | 28 struct LogData; |
25 class MessageAttachment; | 29 class MessageAttachment; |
26 class MessageAttachmentSet; | 30 class MessageAttachmentSet; |
27 | 31 |
28 class IPC_EXPORT Message : public base::Pickle { | 32 class IPC_EXPORT Message : public base::Pickle { |
29 public: | 33 public: |
30 enum PriorityValue { | 34 enum PriorityValue { |
31 PRIORITY_LOW = 1, | 35 PRIORITY_LOW = 1, |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 TRACE_EVENT_FLOW_END_BIND_TO_ENCLOSING0( | 214 TRACE_EVENT_FLOW_END_BIND_TO_ENCLOSING0( |
211 TRACE_DISABLED_BY_DEFAULT("ipc.flow"), "IPC", header()->flags); | 215 TRACE_DISABLED_BY_DEFAULT("ipc.flow"), "IPC", header()->flags); |
212 } | 216 } |
213 | 217 |
214 protected: | 218 protected: |
215 friend class Channel; | 219 friend class Channel; |
216 friend class ChannelMojo; | 220 friend class ChannelMojo; |
217 friend class ChannelNacl; | 221 friend class ChannelNacl; |
218 friend class ChannelPosix; | 222 friend class ChannelPosix; |
219 friend class ChannelWin; | 223 friend class ChannelWin; |
| 224 friend class internal::ChannelReader; |
220 friend class MessageReplyDeserializer; | 225 friend class MessageReplyDeserializer; |
221 friend class SyncMessage; | 226 friend class SyncMessage; |
222 | 227 |
223 #pragma pack(push, 4) | 228 #pragma pack(push, 4) |
224 struct Header : base::Pickle::Header { | 229 struct Header : base::Pickle::Header { |
225 int32 routing; // ID of the view that this message is destined for | 230 int32 routing; // ID of the view that this message is destined for |
226 uint32 type; // specifies the user-defined message type | 231 uint32 type; // specifies the user-defined message type |
227 uint32 flags; // specifies control flags for the message | 232 uint32 flags; // specifies control flags for the message |
228 #if defined(OS_POSIX) | 233 #if defined(OS_POSIX) |
229 uint16 num_fds; // the number of descriptors included with this message | 234 uint16 num_fds; // the number of descriptors included with this message |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 MSG_ROUTING_NONE = -2, | 281 MSG_ROUTING_NONE = -2, |
277 | 282 |
278 // indicates a general message not sent to a particular tab. | 283 // indicates a general message not sent to a particular tab. |
279 MSG_ROUTING_CONTROL = kint32max, | 284 MSG_ROUTING_CONTROL = kint32max, |
280 }; | 285 }; |
281 | 286 |
282 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 287 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
283 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 288 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
284 | 289 |
285 #endif // IPC_IPC_MESSAGE_H_ | 290 #endif // IPC_IPC_MESSAGE_H_ |
OLD | NEW |