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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: mojo/edk/system/message_in_transit.h
diff --git a/mojo/edk/system/message_in_transit.h b/mojo/edk/system/message_in_transit.h
index 946308cd3df2f98a1d6c9b7376b7fc40b7bb523d..7e79c48f91b2dfa8d576d83d3e4d74a6cf6ccabe 100644
--- a/mojo/edk/system/message_in_transit.h
+++ b/mojo/edk/system/message_in_transit.h
@@ -8,7 +8,7 @@
#include <stddef.h>
#include <stdint.h>
-#include <iosfwd>
+#include <ostream>
#include <vector>
#include "base/macros.h"
@@ -284,10 +284,19 @@ class MOJO_SYSTEM_IMPL_EXPORT MessageInTransit {
DISALLOW_COPY_AND_ASSIGN(MessageInTransit);
};
-// Stream operator for |MessageInTransit::Type| and |Subtype| so we can use
-// |CHECK_EQ()|, |EXPECT_EQ()|, etc.
-std::ostream& operator<<(std::ostream& out, MessageInTransit::Type type);
-std::ostream& operator<<(std::ostream& out, MessageInTransit::Subtype subtype);
+// So logging macros and |DCHECK_EQ()|, etc. work.
+MOJO_SYSTEM_IMPL_EXPORT inline std::ostream& operator<<(
+ std::ostream& out,
+ MessageInTransit::Type type) {
+ return out << static_cast<uint16_t>(type);
+}
+
+// So logging macros and |DCHECK_EQ()|, etc. work.
+MOJO_SYSTEM_IMPL_EXPORT inline std::ostream& operator<<(
+ std::ostream& out,
+ MessageInTransit::Subtype subtype) {
+ return out << static_cast<uint16_t>(subtype);
+}
} // namespace system
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698