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

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

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 #ifndef MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_H_ 5 #ifndef MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_H_
6 #define MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_H_ 6 #define MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <iosfwd> 11 #include <ostream>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/aligned_memory.h" 15 #include "base/memory/aligned_memory.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "mojo/edk/system/channel_endpoint_id.h" 17 #include "mojo/edk/system/channel_endpoint_id.h"
18 #include "mojo/edk/system/dispatcher.h" 18 #include "mojo/edk/system/dispatcher.h"
19 #include "mojo/edk/system/memory.h" 19 #include "mojo/edk/system/memory.h"
20 #include "mojo/edk/system/system_impl_export.h" 20 #include "mojo/edk/system/system_impl_export.h"
21 21
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 277
278 // Any dispatchers that may be attached to this message. These dispatchers 278 // Any dispatchers that may be attached to this message. These dispatchers
279 // should be "owned" by this message, i.e., have a ref count of exactly 1. (We 279 // should be "owned" by this message, i.e., have a ref count of exactly 1. (We
280 // allow a dispatcher entry to be null, in case it couldn't be duplicated for 280 // allow a dispatcher entry to be null, in case it couldn't be duplicated for
281 // some reason.) 281 // some reason.)
282 scoped_ptr<DispatcherVector> dispatchers_; 282 scoped_ptr<DispatcherVector> dispatchers_;
283 283
284 DISALLOW_COPY_AND_ASSIGN(MessageInTransit); 284 DISALLOW_COPY_AND_ASSIGN(MessageInTransit);
285 }; 285 };
286 286
287 // Stream operator for |MessageInTransit::Type| and |Subtype| so we can use 287 // So logging macros and |DCHECK_EQ()|, etc. work.
288 // |CHECK_EQ()|, |EXPECT_EQ()|, etc. 288 MOJO_SYSTEM_IMPL_EXPORT inline std::ostream& operator<<(
289 std::ostream& operator<<(std::ostream& out, MessageInTransit::Type type); 289 std::ostream& out,
290 std::ostream& operator<<(std::ostream& out, MessageInTransit::Subtype subtype); 290 MessageInTransit::Type type) {
291 return out << static_cast<uint16_t>(type);
292 }
293
294 // So logging macros and |DCHECK_EQ()|, etc. work.
295 MOJO_SYSTEM_IMPL_EXPORT inline std::ostream& operator<<(
296 std::ostream& out,
297 MessageInTransit::Subtype subtype) {
298 return out << static_cast<uint16_t>(subtype);
299 }
291 300
292 } // namespace system 301 } // namespace system
293 } // namespace mojo 302 } // namespace mojo
294 303
295 #endif // MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_H_ 304 #endif // MOJO_EDK_SYSTEM_MESSAGE_IN_TRANSIT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698