| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/edk/system/message_in_transit.h" | 5 #include "mojo/edk/system/message_in_transit.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 | 10 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 void MessageInTransit::UpdateTotalSize() { | 199 void MessageInTransit::UpdateTotalSize() { |
| 200 DCHECK_EQ(main_buffer_size_ % kMessageAlignment, 0u); | 200 DCHECK_EQ(main_buffer_size_ % kMessageAlignment, 0u); |
| 201 header()->total_size = static_cast<uint32_t>(main_buffer_size_); | 201 header()->total_size = static_cast<uint32_t>(main_buffer_size_); |
| 202 if (transport_data_) { | 202 if (transport_data_) { |
| 203 header()->total_size += | 203 header()->total_size += |
| 204 static_cast<uint32_t>(transport_data_->buffer_size()); | 204 static_cast<uint32_t>(transport_data_->buffer_size()); |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 std::ostream& operator<<(std::ostream& out, MessageInTransit::Type type) { | |
| 209 return out << static_cast<uint16_t>(type); | |
| 210 } | |
| 211 | |
| 212 std::ostream& operator<<(std::ostream& out, MessageInTransit::Subtype subtype) { | |
| 213 return out << static_cast<uint16_t>(subtype); | |
| 214 } | |
| 215 | |
| 216 } // namespace system | 208 } // namespace system |
| 217 } // namespace mojo | 209 } // namespace mojo |
| OLD | NEW |