summaryrefslogtreecommitdiffstats
path: root/net/base
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 08:09:52 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 08:09:52 +0000
commita91f9edc2e8e13e7e05cbeeb4a3a9fa5b028714a (patch)
tree873a3d7bbbb150dc6e6450cd7c4533385b4f86fe /net/base
parent2102dfca368947f67ca224accc9868447b3da2a0 (diff)
downloadchromium_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/base')
-rw-r--r--net/base/wininet_util.cc70
-rw-r--r--net/base/wininet_util.h25
-rw-r--r--net/base/wininet_util_unittest.cc39
3 files changed, 0 insertions, 134 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));
- }
-}