Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: mojo/edk/system/message_in_transit.cc

Issue 1160203002: Make Dispatcher::Type an enum class. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698