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

Unified Diff: components/html_viewer/web_socket_handle_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 | « components/html_viewer/html_frame_properties.cc ('k') | components/mus/public/cpp/window_property.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/web_socket_handle_impl.cc
diff --git a/components/html_viewer/web_socket_handle_impl.cc b/components/html_viewer/web_socket_handle_impl.cc
index 969b7f366ecd75baf53fd9bf555227170f994039..155dad2fbf56ceabd8bf9860f7a4d5c5b797f094 100644
--- a/components/html_viewer/web_socket_handle_impl.cc
+++ b/components/html_viewer/web_socket_handle_impl.cc
@@ -40,18 +40,17 @@ struct TypeConverter<WebSocket::MessageType, WebSocketHandle::MessageType> {
type == WebSocketHandle::MessageTypeText ||
type == WebSocketHandle::MessageTypeBinary);
typedef WebSocket::MessageType MessageType;
- COMPILE_ASSERT(
+ static_assert(
static_cast<MessageType>(WebSocketHandle::MessageTypeContinuation) ==
WebSocket::MESSAGE_TYPE_CONTINUATION,
- enum_values_must_match_for_message_type);
- COMPILE_ASSERT(
- static_cast<MessageType>(WebSocketHandle::MessageTypeText) ==
- WebSocket::MESSAGE_TYPE_TEXT,
- enum_values_must_match_for_message_type);
- COMPILE_ASSERT(
+ "WebSocket and WebSocketHandle enum values must match");
+ static_assert(static_cast<MessageType>(WebSocketHandle::MessageTypeText) ==
+ WebSocket::MESSAGE_TYPE_TEXT,
+ "WebSocket and WebSocketHandle enum values must match");
+ static_assert(
static_cast<MessageType>(WebSocketHandle::MessageTypeBinary) ==
WebSocket::MESSAGE_TYPE_BINARY,
- enum_values_must_match_for_message_type);
+ "WebSocket and WebSocketHandle enum values must match");
return static_cast<WebSocket::MessageType>(type);
}
};
« no previous file with comments | « components/html_viewer/html_frame_properties.cc ('k') | components/mus/public/cpp/window_property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698