diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-28 20:19:31 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-28 20:19:31 +0000 |
commit | 9eb7b11b614e987d7608678d0396873f37ca817e (patch) | |
tree | 7f222f4ae73bd3c3edc33d39f3bf7050d10f4254 /net/server/web_socket.cc | |
parent | 97f37d558f60a245190b17ce14d3d9039fc83767 (diff) | |
download | chromium_src-9eb7b11b614e987d7608678d0396873f37ca817e.zip chromium_src-9eb7b11b614e987d7608678d0396873f37ca817e.tar.gz chromium_src-9eb7b11b614e987d7608678d0396873f37ca817e.tar.bz2 |
Add base::HostToNetXX() & NetToHostXX(), and use them to replace htonX() & ntohX() in Chrome.
This primarily addresses issues with code using the OS-provided htonX() & ntohX() functions from within the Chrome sandbox. Under Windows these functions are provided by ws2_32.dll, which is no longer available within Chrome's sandbox.
The new base::HostToNetXX() and NetToHostXX() functions are safe for use by sandboxed code on Windows, and provide a single place where future fixes for other platforms can be made.
BUG=117252
Review URL: http://codereview.chromium.org/9716020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/server/web_socket.cc')
-rw-r--r-- | net/server/web_socket.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/server/web_socket.cc b/net/server/web_socket.cc index 0abbcf7..774c4d6 100644 --- a/net/server/web_socket.cc +++ b/net/server/web_socket.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -37,7 +37,7 @@ static uint32 WebSocketKeyFingerprint(const std::string& str) { int64 number = 0; if (!base::StringToInt64(result, &number)) return 0; - return htonl(static_cast<uint32>(number / spaces)); + return base::HostToNet32(static_cast<uint32>(number / spaces)); } class WebSocketHixie76 : public net::WebSocket { |