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