diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-06 08:09:52 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-06 08:09:52 +0000 |
commit | a91f9edc2e8e13e7e05cbeeb4a3a9fa5b028714a (patch) | |
tree | 873a3d7bbbb150dc6e6450cd7c4533385b4f86fe /net | |
parent | 2102dfca368947f67ca224accc9868447b3da2a0 (diff) | |
download | chromium_src-a91f9edc2e8e13e7e05cbeeb4a3a9fa5b028714a.zip chromium_src-a91f9edc2e8e13e7e05cbeeb4a3a9fa5b028714a.tar.gz chromium_src-a91f9edc2e8e13e7e05cbeeb4a3a9fa5b028714a.tar.bz2 |
Remove more WinInet stuff.
BUG=25520
TEST=none
Review URL: http://codereview.chromium.org/525026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/wininet_util.cc | 70 | ||||
-rw-r--r-- | net/base/wininet_util.h | 25 | ||||
-rw-r--r-- | net/base/wininet_util_unittest.cc | 39 | ||||
-rw-r--r-- | net/net.gyp | 10 |
4 files changed, 0 insertions, 144 deletions
diff --git a/net/base/wininet_util.cc b/net/base/wininet_util.cc index 4e3a889..e69de29 100644 --- a/net/base/wininet_util.cc +++ b/net/base/wininet_util.cc @@ -1,70 +0,0 @@ -// Copyright (c) 2006-2008 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. - -#include "net/base/wininet_util.h" - -#include "base/logging.h" -#include "net/base/net_errors.h" - -namespace net { - -// static -int WinInetUtil::OSErrorToNetError(DWORD os_error) { - // Optimize the common case. - if (os_error == ERROR_IO_PENDING) - return net::ERR_IO_PENDING; - - switch (os_error) { - case ERROR_SUCCESS: - return net::OK; - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - return net::ERR_FILE_NOT_FOUND; - case ERROR_HANDLE_EOF: // TODO(wtc): return net::OK? - return net::ERR_CONNECTION_CLOSED; - case ERROR_INVALID_HANDLE: - return net::ERR_INVALID_HANDLE; - case ERROR_INVALID_PARAMETER: - return net::ERR_INVALID_ARGUMENT; - - case ERROR_INTERNET_CANNOT_CONNECT: - return net::ERR_CONNECTION_FAILED; - case ERROR_INTERNET_CONNECTION_RESET: - return net::ERR_CONNECTION_RESET; - case ERROR_INTERNET_DISCONNECTED: - return net::ERR_INTERNET_DISCONNECTED; - case ERROR_INTERNET_INVALID_URL: - return net::ERR_INVALID_URL; - case ERROR_INTERNET_NAME_NOT_RESOLVED: - return net::ERR_NAME_NOT_RESOLVED; - case ERROR_INTERNET_OPERATION_CANCELLED: - return net::ERR_ABORTED; - case ERROR_INTERNET_UNRECOGNIZED_SCHEME: - return net::ERR_UNKNOWN_URL_SCHEME; - - // SSL certificate errors - case ERROR_INTERNET_SEC_CERT_CN_INVALID: - return net::ERR_CERT_COMMON_NAME_INVALID; - case ERROR_INTERNET_SEC_CERT_DATE_INVALID: - return net::ERR_CERT_DATE_INVALID; - case ERROR_INTERNET_INVALID_CA: - return net::ERR_CERT_AUTHORITY_INVALID; - case ERROR_INTERNET_SEC_CERT_NO_REV: - return net::ERR_CERT_NO_REVOCATION_MECHANISM; - case ERROR_INTERNET_SEC_CERT_REV_FAILED: - return net::ERR_CERT_UNABLE_TO_CHECK_REVOCATION; - case ERROR_INTERNET_SEC_CERT_REVOKED: - return net::ERR_CERT_REVOKED; - case ERROR_INTERNET_SEC_CERT_ERRORS: - return net::ERR_CERT_CONTAINS_ERRORS; - case ERROR_INTERNET_SEC_INVALID_CERT: - return net::ERR_CERT_INVALID; - - case ERROR_INTERNET_EXTENDED_ERROR: - default: - return net::ERR_FAILED; - } -} - -} // namespace net diff --git a/net/base/wininet_util.h b/net/base/wininet_util.h index 17160be..e69de29 100644 --- a/net/base/wininet_util.h +++ b/net/base/wininet_util.h @@ -1,25 +0,0 @@ -// Copyright (c) 2006-2008 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. - -#ifndef NET_BASE_WININET_UTIL_H__ -#define NET_BASE_WININET_UTIL_H__ - -#include <windows.h> -#include <wininet.h> - -#include <string> - -namespace net { - -// Global functions and variables for using WinInet. -class WinInetUtil { - public: - // Maps Windows error codes (returned by GetLastError()) to net::ERR_xxx - // error codes. - static int OSErrorToNetError(DWORD os_error); -}; - -} // namespace net - -#endif // NET_BASE_WININET_UTIL_H__ diff --git a/net/base/wininet_util_unittest.cc b/net/base/wininet_util_unittest.cc index 8f79d1a..e69de29 100644 --- a/net/base/wininet_util_unittest.cc +++ b/net/base/wininet_util_unittest.cc @@ -1,39 +0,0 @@ -// Copyright (c) 2006-2008 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. - -#include <windows.h> -#include <wininet.h> - -#include "net/base/net_errors.h" -#include "net/base/wininet_util.h" -#include "testing/gtest/include/gtest/gtest.h" - -using net::WinInetUtil; - -namespace { - class WinInetUtilTest : public testing::Test { - }; -} - -TEST(WinInetUtilTest, ErrorCodeConversion) { - // a list of Windows error codes and the corresponding - // net::ERR_xxx error codes - static const struct { - DWORD os_error; - int net_error; - } error_cases[] = { - {ERROR_SUCCESS, net::OK}, - {ERROR_IO_PENDING, net::ERR_IO_PENDING}, - {ERROR_INTERNET_OPERATION_CANCELLED, net::ERR_ABORTED}, - {ERROR_INTERNET_CANNOT_CONNECT, net::ERR_CONNECTION_FAILED}, - {ERROR_INTERNET_NAME_NOT_RESOLVED, net::ERR_NAME_NOT_RESOLVED}, - {ERROR_INTERNET_INVALID_CA, net::ERR_CERT_AUTHORITY_INVALID}, - {999999, net::ERR_FAILED}, - }; - - for (int i = 0; i < arraysize(error_cases); i++) { - EXPECT_EQ(error_cases[i].net_error, - WinInetUtil::OSErrorToNetError(error_cases[i].os_error)); - } -} diff --git a/net/net.gyp b/net/net.gyp index 5c69c1a..1b54efb 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -151,8 +151,6 @@ 'base/upload_data.h', 'base/upload_data_stream.cc', 'base/upload_data_stream.h', - 'base/wininet_util.cc', - 'base/wininet_util.h', 'base/winsock_init.cc', 'base/winsock_init.h', 'base/x509_certificate.cc', @@ -180,7 +178,6 @@ }, { # else: OS != "win" 'sources!': [ - 'base/wininet_util.cc', 'base/winsock_init.cc', ], }, @@ -608,7 +605,6 @@ 'base/telnet_server_unittest.cc', 'base/test_certificate_data.h', 'base/test_completion_callback_unittest.cc', - 'base/wininet_util_unittest.cc', 'base/x509_certificate_unittest.cc', 'disk_cache/addr_unittest.cc', 'disk_cache/backend_unittest.cc', @@ -681,12 +677,6 @@ 'sources/': [ ['exclude', '_(mac|linux|posix)_unittest\\.cc$'] ], }, ], - [ 'OS != "win"', { - 'sources!': [ - 'base/wininet_util_unittest.cc', - ], - }, - ], [ 'OS == "linux"', { 'sources/': [ ['exclude', '_(mac|win)_unittest\\.cc$'] ], 'dependencies': [ |