| 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 #include "ipc/ipc_message.h" | 5 #include "ipc/ipc_message.h" |
| 6 | 6 |
| 7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ipc/ipc_message_attachment.h" | 10 #include "ipc/ipc_message_attachment.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 Init(); | 71 Init(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 Message::Message(const Message& other) : base::Pickle(other) { | 74 Message::Message(const Message& other) : base::Pickle(other) { |
| 75 Init(); | 75 Init(); |
| 76 attachment_set_ = other.attachment_set_; | 76 attachment_set_ = other.attachment_set_; |
| 77 } | 77 } |
| 78 | 78 |
| 79 void Message::Init() { | 79 void Message::Init() { |
| 80 dispatch_error_ = false; | 80 dispatch_error_ = false; |
| 81 sender_pid_ = base::kNullProcessId; |
| 81 #ifdef IPC_MESSAGE_LOG_ENABLED | 82 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 82 received_time_ = 0; | 83 received_time_ = 0; |
| 83 dont_log_ = false; | 84 dont_log_ = false; |
| 84 log_data_ = NULL; | 85 log_data_ = NULL; |
| 85 #endif | 86 #endif |
| 86 } | 87 } |
| 87 | 88 |
| 88 Message& Message::operator=(const Message& other) { | 89 Message& Message::operator=(const Message& other) { |
| 89 *static_cast<base::Pickle*>(this) = other; | 90 *static_cast<base::Pickle*>(this) = other; |
| 90 attachment_set_ = other.attachment_set_; | 91 attachment_set_ = other.attachment_set_; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 bool Message::HasMojoHandles() const { | 156 bool Message::HasMojoHandles() const { |
| 156 return attachment_set_.get() && attachment_set_->num_mojo_handles() > 0; | 157 return attachment_set_.get() && attachment_set_->num_mojo_handles() > 0; |
| 157 } | 158 } |
| 158 | 159 |
| 159 bool Message::HasBrokerableAttachments() const { | 160 bool Message::HasBrokerableAttachments() const { |
| 160 return attachment_set_.get() && | 161 return attachment_set_.get() && |
| 161 attachment_set_->num_brokerable_attachments() > 0; | 162 attachment_set_->num_brokerable_attachments() > 0; |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace IPC | 165 } // namespace IPC |
| OLD | NEW |