Index: mojo/edk/system/dispatcher.h |
diff --git a/mojo/edk/system/dispatcher.h b/mojo/edk/system/dispatcher.h |
index 8d7e1cb665c3034a5cac585b0bc958f8224d7d98..d7b7780ccf198ffe102331c241b77d372ba58b68 100644 |
--- a/mojo/edk/system/dispatcher.h |
+++ b/mojo/edk/system/dispatcher.h |
@@ -8,6 +8,7 @@ |
#include <stddef.h> |
#include <stdint.h> |
+#include <ostream> |
#include <vector> |
#include "base/macros.h" |
@@ -59,15 +60,15 @@ DispatcherTryStartTransport(Dispatcher* dispatcher); |
class MOJO_SYSTEM_IMPL_EXPORT Dispatcher |
: public base::RefCountedThreadSafe<Dispatcher> { |
public: |
- enum Type { |
- kTypeUnknown = 0, |
- kTypeMessagePipe, |
- kTypeDataPipeProducer, |
- kTypeDataPipeConsumer, |
- kTypeSharedBuffer, |
+ enum class Type { |
+ UNKNOWN = 0, |
+ MESSAGE_PIPE, |
+ DATA_PIPE_PRODUCER, |
+ DATA_PIPE_CONSUMER, |
+ SHARED_BUFFER, |
// "Private" types (not exposed via the public interface): |
- kTypePlatformHandle = -1 |
+ PLATFORM_HANDLE = -1 |
}; |
virtual Type GetType() const = 0; |
@@ -399,6 +400,12 @@ class MOJO_SYSTEM_IMPL_EXPORT DispatcherTransport { |
// Copy and assign allowed. |
}; |
+// So logging macros and |DCHECK_EQ()|, etc. work. |
+MOJO_SYSTEM_IMPL_EXPORT inline std::ostream& operator<<(std::ostream& out, |
+ Dispatcher::Type type) { |
+ return out << static_cast<int>(type); |
+} |
+ |
} // namespace system |
} // namespace mojo |