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

Unified Diff: net/base/host_resolver_proc.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: Rebase. 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/base/host_resolver_proc.cc
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index e88fa2cef3a0b716d16cc11fa510a2c581e9f654..9360e87f6335d1b4166da2879e29d840a27ddce1 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -7,6 +7,7 @@
#include "build/build_config.h"
#include "base/logging.h"
+#include "base/sys_byteorder.h"
#include "net/base/address_list.h"
#include "net/base/dns_reloader.h"
#include "net/base/net_errors.h"
@@ -28,7 +29,8 @@ bool IsAllLocalhostOfOneFamily(const struct addrinfo* ai) {
case AF_INET: {
const struct sockaddr_in* addr_in =
reinterpret_cast<struct sockaddr_in*>(ai->ai_addr);
- if ((ntohl(addr_in->sin_addr.s_addr) & 0xff000000) == 0x7f000000)
+ if ((base::NetToHost32(addr_in->sin_addr.s_addr) & 0xff000000) ==
+ 0x7f000000)
saw_v4_localhost = true;
else
return false;
« no previous file with comments | « native_client_sdk/src/build_tools/debug_server/debug_stub/transport_common.cc ('k') | net/base/ip_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698