| 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 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 bool ReadAttachment( | 206 bool ReadAttachment( |
| 207 base::PickleIterator* iter, | 207 base::PickleIterator* iter, |
| 208 scoped_refptr<base::Pickle::Attachment>* attachment) const override; | 208 scoped_refptr<base::Pickle::Attachment>* attachment) const override; |
| 209 // Returns true if there are any attachment in this message. | 209 // Returns true if there are any attachment in this message. |
| 210 bool HasAttachments() const override; | 210 bool HasAttachments() const override; |
| 211 // Returns true if there are any MojoHandleAttachments in this message. | 211 // Returns true if there are any MojoHandleAttachments in this message. |
| 212 bool HasMojoHandles() const; | 212 bool HasMojoHandles() const; |
| 213 // Whether the message has any brokerable attachments. | 213 // Whether the message has any brokerable attachments. |
| 214 bool HasBrokerableAttachments() const; | 214 bool HasBrokerableAttachments() const; |
| 215 | 215 |
| 216 void set_sender_pid(base::ProcessId id) { sender_pid_ = id; } | |
| 217 base::ProcessId get_sender_pid() const { return sender_pid_; } | |
| 218 | |
| 219 #ifdef IPC_MESSAGE_LOG_ENABLED | 216 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 220 // 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 |
| 221 // a bit to indicate that it's been added. | 218 // a bit to indicate that it's been added. |
| 222 void set_sent_time(int64_t time); | 219 void set_sent_time(int64_t time); |
| 223 int64_t sent_time() const; | 220 int64_t sent_time() const; |
| 224 | 221 |
| 225 void set_received_time(int64_t time) const; | 222 void set_received_time(int64_t time) const; |
| 226 int64_t received_time() const { return received_time_; } | 223 int64_t received_time() const { return received_time_; } |
| 227 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; } |
| 228 const std::string& output_params() const { return output_params_; } | 225 const std::string& output_params() const { return output_params_; } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 void EnsureMessageAttachmentSet(); | 274 void EnsureMessageAttachmentSet(); |
| 278 | 275 |
| 279 MessageAttachmentSet* attachment_set() { | 276 MessageAttachmentSet* attachment_set() { |
| 280 EnsureMessageAttachmentSet(); | 277 EnsureMessageAttachmentSet(); |
| 281 return attachment_set_.get(); | 278 return attachment_set_.get(); |
| 282 } | 279 } |
| 283 const MessageAttachmentSet* attachment_set() const { | 280 const MessageAttachmentSet* attachment_set() const { |
| 284 return attachment_set_.get(); | 281 return attachment_set_.get(); |
| 285 } | 282 } |
| 286 | 283 |
| 287 // The process id of the sender of the message. This member is populated with | |
| 288 // a valid value for every message dispatched to listeners. | |
| 289 base::ProcessId sender_pid_; | |
| 290 | |
| 291 #ifdef IPC_MESSAGE_LOG_ENABLED | 284 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 292 // Used for logging. | 285 // Used for logging. |
| 293 mutable int64_t received_time_; | 286 mutable int64_t received_time_; |
| 294 mutable std::string output_params_; | 287 mutable std::string output_params_; |
| 295 mutable LogData* log_data_; | 288 mutable LogData* log_data_; |
| 296 mutable bool dont_log_; | 289 mutable bool dont_log_; |
| 297 #endif | 290 #endif |
| 298 | 291 |
| 299 FRIEND_TEST_ALL_PREFIXES(IPCMessageTest, FindNext); | 292 FRIEND_TEST_ALL_PREFIXES(IPCMessageTest, FindNext); |
| 300 FRIEND_TEST_ALL_PREFIXES(IPCMessageTest, FindNextOverflow); | 293 FRIEND_TEST_ALL_PREFIXES(IPCMessageTest, FindNextOverflow); |
| 301 }; | 294 }; |
| 302 | 295 |
| 303 //------------------------------------------------------------------------------ | 296 //------------------------------------------------------------------------------ |
| 304 | 297 |
| 305 } // namespace IPC | 298 } // namespace IPC |
| 306 | 299 |
| 307 enum SpecialRoutingIDs { | 300 enum SpecialRoutingIDs { |
| 308 // indicates that we don't have a routing ID yet. | 301 // indicates that we don't have a routing ID yet. |
| 309 MSG_ROUTING_NONE = -2, | 302 MSG_ROUTING_NONE = -2, |
| 310 | 303 |
| 311 // indicates a general message not sent to a particular tab. | 304 // indicates a general message not sent to a particular tab. |
| 312 MSG_ROUTING_CONTROL = INT32_MAX, | 305 MSG_ROUTING_CONTROL = INT32_MAX, |
| 313 }; | 306 }; |
| 314 | 307 |
| 315 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 308 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
| 316 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 309 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
| 317 | 310 |
| 318 #endif // IPC_IPC_MESSAGE_H_ | 311 #endif // IPC_IPC_MESSAGE_H_ |
| OLD | NEW |