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

Unified Diff: net/socket/web_socket_server_socket.cc

Issue 9716020: Add base::HostToNetXX() & NetToHostXX(), and use them to replace htonX() & ntohX() in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch a few remaining call-sites. Created 8 years, 9 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: net/socket/web_socket_server_socket.cc
diff --git a/net/socket/web_socket_server_socket.cc b/net/socket/web_socket_server_socket.cc
index c3164159b916ebba31c5c9257340fc98a56c69c5..e8cb8865b2beddda69f8fe3eafd7831df1b23c19 100644
--- a/net/socket/web_socket_server_socket.cc
+++ b/net/socket/web_socket_server_socket.cc
@@ -689,8 +689,8 @@ class WebSocketServerSocketImpl : public net::WebSocketServerSocket {
}
char challenge[4 + 4 + sizeof(key3)];
- int32 part1 = htonl(key_number1 / spaces1);
- int32 part2 = htonl(key_number2 / spaces2);
+ int32 part1 = base::HostToNet32(key_number1 / spaces1);
+ int32 part2 = base::HostToNet32(key_number2 / spaces2);
memcpy(challenge, &part1, 4);
memcpy(challenge + 4, &part2, 4);
memcpy(challenge + 4 + 4, key3, sizeof(key3));

Powered by Google App Engine
This is Rietveld 408576698