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" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 bool should_unblock() const { | 114 bool should_unblock() const { |
115 return (header()->flags & UNBLOCK_BIT) != 0; | 115 return (header()->flags & UNBLOCK_BIT) != 0; |
116 } | 116 } |
117 | 117 |
118 // Tells the receiver that the caller is pumping messages while waiting | 118 // Tells the receiver that the caller is pumping messages while waiting |
119 // for the result. | 119 // for the result. |
120 bool is_caller_pumping_messages() const { | 120 bool is_caller_pumping_messages() const { |
121 return (header()->flags & PUMPING_MSGS_BIT) != 0; | 121 return (header()->flags & PUMPING_MSGS_BIT) != 0; |
122 } | 122 } |
123 | 123 |
| 124 void set_dispatch_error() const { |
| 125 dispatch_error_ = true; |
| 126 } |
| 127 |
| 128 bool dispatch_error() const { |
| 129 return dispatch_error_; |
| 130 } |
| 131 |
124 uint32 type() const { | 132 uint32 type() const { |
125 return header()->type; | 133 return header()->type; |
126 } | 134 } |
127 | 135 |
128 int32 routing_id() const { | 136 int32 routing_id() const { |
129 return header()->routing; | 137 return header()->routing; |
130 } | 138 } |
131 | 139 |
132 void set_routing_id(int32 new_id) { | 140 void set_routing_id(int32 new_id) { |
133 header()->routing = new_id; | 141 header()->routing = new_id; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 }; | 237 }; |
230 #pragma pack(pop) | 238 #pragma pack(pop) |
231 | 239 |
232 Header* header() { | 240 Header* header() { |
233 return headerT<Header>(); | 241 return headerT<Header>(); |
234 } | 242 } |
235 const Header* header() const { | 243 const Header* header() const { |
236 return headerT<Header>(); | 244 return headerT<Header>(); |
237 } | 245 } |
238 | 246 |
239 void InitLoggingVariables(); | 247 void Init(); |
| 248 |
| 249 // Used internally to support IPC::Listener::OnBadMessageReceived. |
| 250 mutable bool dispatch_error_; |
240 | 251 |
241 #if defined(OS_POSIX) | 252 #if defined(OS_POSIX) |
242 // The set of file descriptors associated with this message. | 253 // The set of file descriptors associated with this message. |
243 scoped_refptr<FileDescriptorSet> file_descriptor_set_; | 254 scoped_refptr<FileDescriptorSet> file_descriptor_set_; |
244 | 255 |
245 // Ensure that a FileDescriptorSet is allocated | 256 // Ensure that a FileDescriptorSet is allocated |
246 void EnsureFileDescriptorSet(); | 257 void EnsureFileDescriptorSet(); |
247 | 258 |
248 FileDescriptorSet* file_descriptor_set() { | 259 FileDescriptorSet* file_descriptor_set() { |
249 EnsureFileDescriptorSet(); | 260 EnsureFileDescriptorSet(); |
(...skipping 22 matching lines...) Expand all Loading... |
272 MSG_ROUTING_NONE = -2, | 283 MSG_ROUTING_NONE = -2, |
273 | 284 |
274 // indicates a general message not sent to a particular tab. | 285 // indicates a general message not sent to a particular tab. |
275 MSG_ROUTING_CONTROL = kint32max, | 286 MSG_ROUTING_CONTROL = kint32max, |
276 }; | 287 }; |
277 | 288 |
278 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 289 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
279 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 290 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
280 | 291 |
281 #endif // IPC_IPC_MESSAGE_H_ | 292 #endif // IPC_IPC_MESSAGE_H_ |
OLD | NEW |