Index: net/base/net_util.cc |
diff --git a/net/base/net_util.cc b/net/base/net_util.cc |
index 5ecf74042bf250a4b164cb1aeeafa50b6d534aaa..2ba3b4688f1dc3718c58f0d03aa52ba211edebb3 100644 |
--- a/net/base/net_util.cc |
+++ b/net/base/net_util.cc |
@@ -48,6 +48,7 @@ |
#include "base/stringprintf.h" |
#include "base/synchronization/lock.h" |
#include "base/sys_string_conversions.h" |
+#include "base/sys_byteorder.h" |
#include "base/time.h" |
#include "base/utf_offset_string_conversions.h" |
#include "base/utf_string_conversions.h" |
@@ -75,6 +76,14 @@ |
using base::Time; |
+#if defined(OS_WIN) |
+// Allow htons/ntohs to be called without requiring ws2_32.dll to be loaded, |
+// which isn't available in Chrome's sandbox. See crbug.com/116591. |
+// TODO(wez): Replace these calls with base::htons() etc when available. |
+#define ntohs(x) _byteswap_ushort(x) |
+#define htons(x) _byteswap_ushort(x) |
+#endif // OS_WIN |
+ |
namespace net { |
namespace { |