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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/pickle.h" | 15 #include "base/pickle.h" |
16 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "ipc/brokerable_attachment.h" |
18 #include "ipc/ipc_export.h" | 19 #include "ipc/ipc_export.h" |
19 | 20 |
20 #if !defined(NDEBUG) | 21 #if !defined(NDEBUG) |
21 #define IPC_MESSAGE_LOG_ENABLED | 22 #define IPC_MESSAGE_LOG_ENABLED |
22 #endif | 23 #endif |
23 | 24 |
24 namespace IPC { | 25 namespace IPC { |
25 | 26 |
26 namespace internal { | 27 namespace internal { |
27 class ChannelReader; | 28 class ChannelReader; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // false iff the set is full. | 201 // false iff the set is full. |
201 bool WriteAttachment( | 202 bool WriteAttachment( |
202 scoped_refptr<base::Pickle::Attachment> attachment) override; | 203 scoped_refptr<base::Pickle::Attachment> attachment) override; |
203 // ReadAttachment parses an attachment given the parsing state |iter| and | 204 // ReadAttachment parses an attachment given the parsing state |iter| and |
204 // writes it to |*attachment|. It returns true on success. | 205 // writes it to |*attachment|. It returns true on success. |
205 bool ReadAttachment( | 206 bool ReadAttachment( |
206 base::PickleIterator* iter, | 207 base::PickleIterator* iter, |
207 scoped_refptr<base::Pickle::Attachment>* attachment) const override; | 208 scoped_refptr<base::Pickle::Attachment>* attachment) const override; |
208 // Returns true if there are any attachment in this message. | 209 // Returns true if there are any attachment in this message. |
209 bool HasAttachments() const override; | 210 bool HasAttachments() const override; |
| 211 // Returns true if there are any MojoHandleAttachments in this message. |
| 212 bool HasMojoHandles() const; |
| 213 // Whether the message has any brokerable attachments. |
| 214 bool HasBrokerableAttachments() const; |
210 | 215 |
211 #ifdef IPC_MESSAGE_LOG_ENABLED | 216 #ifdef IPC_MESSAGE_LOG_ENABLED |
212 // Adds the outgoing time from Time::Now() at the end of the message and sets | 217 // Adds the outgoing time from Time::Now() at the end of the message and sets |
213 // a bit to indicate that it's been added. | 218 // a bit to indicate that it's been added. |
214 void set_sent_time(int64_t time); | 219 void set_sent_time(int64_t time); |
215 int64_t sent_time() const; | 220 int64_t sent_time() const; |
216 | 221 |
217 void set_received_time(int64_t time) const; | 222 void set_received_time(int64_t time) const; |
218 int64_t received_time() const { return received_time_; } | 223 int64_t received_time() const { return received_time_; } |
219 void set_output_params(const std::string& op) const { output_params_ = op; } | 224 void set_output_params(const std::string& op) const { output_params_ = op; } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 MSG_ROUTING_NONE = -2, | 302 MSG_ROUTING_NONE = -2, |
298 | 303 |
299 // indicates a general message not sent to a particular tab. | 304 // indicates a general message not sent to a particular tab. |
300 MSG_ROUTING_CONTROL = INT32_MAX, | 305 MSG_ROUTING_CONTROL = INT32_MAX, |
301 }; | 306 }; |
302 | 307 |
303 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 308 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
304 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 309 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
305 | 310 |
306 #endif // IPC_IPC_MESSAGE_H_ | 311 #endif // IPC_IPC_MESSAGE_H_ |
OLD | NEW |