diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-28 23:18:21 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-28 23:18:21 +0000 |
commit | 0e6f619c41f85776a963a2bfb587ad64675554c4 (patch) | |
tree | dff81415834875ce943e6e4af882d676497d971b /net | |
parent | dfa08b04cf8ee5a34972379f254061647313e2f0 (diff) | |
download | chromium_src-0e6f619c41f85776a963a2bfb587ad64675554c4.zip chromium_src-0e6f619c41f85776a963a2bfb587ad64675554c4.tar.gz chromium_src-0e6f619c41f85776a963a2bfb587ad64675554c4.tar.bz2 |
Move net/base/sys_byteorder.h to base/sys_byteorder.h
Two motivations:
(1) There are currently clients in src/crypto that need the same logic.
(2) There is soon to be a client in src/chrome/common that needs the 64-bit version of this logic, which is currently inlined in a src/crypto implementation file.
BUG=103480
TEST=compiles
Review URL: http://codereview.chromium.org/8949026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/sys_byteorder.h | 22 | ||||
-rw-r--r-- | net/dns/dns_config_service_posix_unittest.cc | 2 | ||||
-rw-r--r-- | net/dns/dns_query.cc | 2 | ||||
-rw-r--r-- | net/dns/dns_response.cc | 2 | ||||
-rw-r--r-- | net/net.gyp | 1 | ||||
-rw-r--r-- | net/server/http_server.cc | 7 | ||||
-rw-r--r-- | net/server/web_socket.cc | 11 | ||||
-rw-r--r-- | net/socket/web_socket_server_socket.cc | 7 | ||||
-rw-r--r-- | net/spdy/spdy_frame_builder.h | 2 | ||||
-rw-r--r-- | net/spdy/spdy_framer.h | 2 | ||||
-rw-r--r-- | net/spdy/spdy_protocol.h | 2 |
11 files changed, 11 insertions, 49 deletions
diff --git a/net/base/sys_byteorder.h b/net/base/sys_byteorder.h deleted file mode 100644 index bde3151..0000000 --- a/net/base/sys_byteorder.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2011 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. - -// This is a convenience header to pull in the platform-specific -// headers that define functions for byte-order conversion, -// particularly: ntohs(), htons(), ntohl(), htonl(). Prefer including -// this file instead of directly writing the #if / #else, since it -// avoids duplicating the platform-specific selections. - -#ifndef NET_BASE_SYS_BYTEORDER_H_ -#define NET_BASE_SYS_BYTEORDER_H_ - -#include "build/build_config.h" - -#if defined(OS_WIN) -#include <winsock2.h> -#else -#include <arpa/inet.h> -#endif - -#endif // NET_BASE_SYS_BYTEORDER_H_ diff --git a/net/dns/dns_config_service_posix_unittest.cc b/net/dns/dns_config_service_posix_unittest.cc index a3f90aa..ab9e56d 100644 --- a/net/dns/dns_config_service_posix_unittest.cc +++ b/net/dns/dns_config_service_posix_unittest.cc @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <arpa/inet.h> #include <resolv.h> +#include "base/sys_byteorder.h" #include "net/dns/dns_config_service_posix.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/net/dns/dns_query.cc b/net/dns/dns_query.cc index 3cfb5cd..408b302 100644 --- a/net/dns/dns_query.cc +++ b/net/dns/dns_query.cc @@ -6,10 +6,10 @@ #include <limits> +#include "base/sys_byteorder.h" #include "net/base/big_endian.h" #include "net/base/dns_util.h" #include "net/base/io_buffer.h" -#include "net/base/sys_byteorder.h" #include "net/dns/dns_protocol.h" namespace net { diff --git a/net/dns/dns_response.cc b/net/dns/dns_response.cc index 9e6db79..dabfc6a 100644 --- a/net/dns/dns_response.cc +++ b/net/dns/dns_response.cc @@ -4,10 +4,10 @@ #include "net/dns/dns_response.h" +#include "base/sys_byteorder.h" #include "net/base/big_endian.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" -#include "net/base/sys_byteorder.h" #include "net/dns/dns_protocol.h" #include "net/dns/dns_query.h" diff --git a/net/net.gyp b/net/net.gyp index d6c510c..54aee3e 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -228,7 +228,6 @@ 'base/static_cookie_policy.cc', 'base/static_cookie_policy.h', 'base/sys_addrinfo.h', - 'base/sys_byteorder.h', 'base/test_data_stream.cc', 'base/test_data_stream.h', 'base/test_root_certs.cc', diff --git a/net/server/http_server.cc b/net/server/http_server.cc index 6f2a46b..f56ff96 100644 --- a/net/server/http_server.cc +++ b/net/server/http_server.cc @@ -8,17 +8,12 @@ #include "base/logging.h" #include "base/string_util.h" #include "base/stringprintf.h" +#include "base/sys_byteorder.h" #include "build/build_config.h" #include "net/server/http_connection.h" #include "net/server/http_server_request_info.h" #include "net/server/web_socket.h" -#if defined(OS_WIN) -#include <winsock2.h> -#else -#include <arpa/inet.h> -#endif - namespace net { HttpServer::HttpServer(const std::string& host, diff --git a/net/server/web_socket.cc b/net/server/web_socket.cc index 7360c25..0abbcf7 100644 --- a/net/server/web_socket.cc +++ b/net/server/web_socket.cc @@ -4,6 +4,8 @@ #include "net/server/web_socket.h" +#include <limits> + #include "base/base64.h" #include "base/rand_util.h" #include "base/logging.h" @@ -11,17 +13,10 @@ #include "base/sha1.h" #include "base/string_number_conversions.h" #include "base/stringprintf.h" +#include "base/sys_byteorder.h" #include "net/server/http_connection.h" #include "net/server/http_server_request_info.h" -#if defined(OS_WIN) -#include <winsock2.h> -#else -#include <arpa/inet.h> -#endif - -#include <limits> - namespace net { namespace { diff --git a/net/socket/web_socket_server_socket.cc b/net/socket/web_socket_server_socket.cc index b86ac32..add4a55 100644 --- a/net/socket/web_socket_server_socket.cc +++ b/net/socket/web_socket_server_socket.cc @@ -10,12 +10,6 @@ #include <map> #include <vector> -#if defined(OS_WIN) -#include <winsock2.h> // for htonl -#else -#include <arpa/inet.h> -#endif - #include "base/basictypes.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -26,6 +20,7 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop.h" #include "base/string_util.h" +#include "base/sys_byteorder.h" #include "googleurl/src/gurl.h" #include "net/base/completion_callback.h" #include "net/base/io_buffer.h" diff --git a/net/spdy/spdy_frame_builder.h b/net/spdy/spdy_frame_builder.h index e828a88..403e819 100644 --- a/net/spdy/spdy_frame_builder.h +++ b/net/spdy/spdy_frame_builder.h @@ -9,8 +9,8 @@ #include <string> #include "base/basictypes.h" +#include "base/sys_byteorder.h" #include "net/base/net_export.h" -#include "net/base/sys_byteorder.h" #include "net/spdy/spdy_protocol.h" namespace spdy { diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h index 1d4b000e..3e16502 100644 --- a/net/spdy/spdy_framer.h +++ b/net/spdy/spdy_framer.h @@ -15,8 +15,8 @@ #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" +#include "base/sys_byteorder.h" #include "net/base/net_export.h" -#include "net/base/sys_byteorder.h" #include "net/spdy/spdy_protocol.h" typedef struct z_stream_s z_stream; // Forward declaration for zlib. diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h index 21c1d97..fa489b8 100644 --- a/net/spdy/spdy_protocol.h +++ b/net/spdy/spdy_protocol.h @@ -12,7 +12,7 @@ #include "base/basictypes.h" #include "base/logging.h" -#include "net/base/sys_byteorder.h" +#include "base/sys_byteorder.h" #include "net/spdy/spdy_bitmasks.h" // Data Frame Format |