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

Unified Diff: net/websockets/websocket_channel.cc

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply fixups Created 5 years, 11 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
« no previous file with comments | « net/websockets/websocket_basic_handshake_stream.cc ('k') | net/websockets/websocket_frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_channel.cc
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index 30abb2db90fe8eb8c67fa3dc898d26a5a6003b61..8e48c1e8ab623f039968d182f292de35a87ed746 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -1066,8 +1066,8 @@ ChannelState WebSocketChannel::SendClose(uint16 code,
body = new IOBuffer(payload_length);
size = payload_length;
base::WriteBigEndian(body->data(), code);
- COMPILE_ASSERT(sizeof(code) == kWebSocketCloseCodeLength,
- they_should_both_be_two);
+ static_assert(sizeof(code) == kWebSocketCloseCodeLength,
+ "they should both be two");
std::copy(
reason.begin(), reason.end(), body->data() + kWebSocketCloseCodeLength);
}
@@ -1102,8 +1102,8 @@ bool WebSocketChannel::ParseClose(const scoped_refptr<IOBuffer>& buffer,
const char* data = buffer->data();
uint16 unchecked_code = 0;
base::ReadBigEndian(data, &unchecked_code);
- COMPILE_ASSERT(sizeof(unchecked_code) == kWebSocketCloseCodeLength,
- they_should_both_be_two_bytes);
+ static_assert(sizeof(unchecked_code) == kWebSocketCloseCodeLength,
+ "they should both be two bytes");
switch (unchecked_code) {
case kWebSocketErrorNoStatusReceived:
« no previous file with comments | « net/websockets/websocket_basic_handshake_stream.cc ('k') | net/websockets/websocket_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698