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

Unified Diff: mojo/services/network/web_socket_impl.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup Created 5 years, 1 month 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
« no previous file with comments | « mojo/environment/default_logger_impl.cc ('k') | sandbox/linux/services/namespace_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/web_socket_impl.cc
diff --git a/mojo/services/network/web_socket_impl.cc b/mojo/services/network/web_socket_impl.cc
index fb64815b21f4d7955e2bc7315a5995c6e202890d..a9eab49f5d40d2de5e796b2b69f9d95191f4fab4 100644
--- a/mojo/services/network/web_socket_impl.cc
+++ b/mojo/services/network/web_socket_impl.cc
@@ -31,15 +31,15 @@ struct TypeConverter<net::WebSocketFrameHeader::OpCode,
typedef net::WebSocketFrameHeader::OpCode OpCode;
// These compile asserts verify that the same underlying values are used for
// both types, so we can simply cast between them.
- COMPILE_ASSERT(static_cast<OpCode>(WebSocket::MESSAGE_TYPE_CONTINUATION) ==
- net::WebSocketFrameHeader::kOpCodeContinuation,
- enum_values_must_match_for_opcode_continuation);
- COMPILE_ASSERT(static_cast<OpCode>(WebSocket::MESSAGE_TYPE_TEXT) ==
- net::WebSocketFrameHeader::kOpCodeText,
- enum_values_must_match_for_opcode_text);
- COMPILE_ASSERT(static_cast<OpCode>(WebSocket::MESSAGE_TYPE_BINARY) ==
- net::WebSocketFrameHeader::kOpCodeBinary,
- enum_values_must_match_for_opcode_binary);
+ static_assert(static_cast<OpCode>(WebSocket::MESSAGE_TYPE_CONTINUATION) ==
+ net::WebSocketFrameHeader::kOpCodeContinuation,
+ "enum values must match for opcode continuation");
+ static_assert(static_cast<OpCode>(WebSocket::MESSAGE_TYPE_TEXT) ==
+ net::WebSocketFrameHeader::kOpCodeText,
+ "enum values must match for opcode text");
+ static_assert(static_cast<OpCode>(WebSocket::MESSAGE_TYPE_BINARY) ==
+ net::WebSocketFrameHeader::kOpCodeBinary,
+ "enum values must match for opcode binary");
return static_cast<OpCode>(type);
}
};
« no previous file with comments | « mojo/environment/default_logger_impl.cc ('k') | sandbox/linux/services/namespace_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698