summaryrefslogtreecommitdiffstats
path: root/jingle/notifier/base/chrome_async_socket_unittest.cc
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-28 20:19:31 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-28 20:19:31 +0000
commit9eb7b11b614e987d7608678d0396873f37ca817e (patch)
tree7f222f4ae73bd3c3edc33d39f3bf7050d10f4254 /jingle/notifier/base/chrome_async_socket_unittest.cc
parent97f37d558f60a245190b17ce14d3d9039fc83767 (diff)
downloadchromium_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 'jingle/notifier/base/chrome_async_socket_unittest.cc')
-rw-r--r--jingle/notifier/base/chrome_async_socket_unittest.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/jingle/notifier/base/chrome_async_socket_unittest.cc b/jingle/notifier/base/chrome_async_socket_unittest.cc
index 08dbf301..a64e03f 100644
--- a/jingle/notifier/base/chrome_async_socket_unittest.cc
+++ b/jingle/notifier/base/chrome_async_socket_unittest.cc
@@ -101,7 +101,7 @@ class AsyncSocketDataProvider : public net::SocketDataProvider {
// Takes a 32-bit integer in host byte order and converts it to a
// net::IPAddressNumber.
net::IPAddressNumber Uint32ToIPAddressNumber(uint32 ip) {
- uint32 ip_nbo = htonl(ip);
+ uint32 ip_nbo = base::HostToNet32(ip);
const unsigned char* const ip_start =
reinterpret_cast<const unsigned char*>(&ip_nbo);
return net::IPAddressNumber(ip_start, ip_start + (sizeof ip_nbo));