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

Unified Diff: net/base/net_errors.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « net/base/net_errors.h ('k') | net/base/net_errors_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_errors.cc
diff --git a/net/base/net_errors.cc b/net/base/net_errors.cc
deleted file mode 100644
index 55cdebb1ac5eebe235d19b0c85527ed14738ef4f..0000000000000000000000000000000000000000
--- a/net/base/net_errors.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2012 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/net_errors.h"
-
-#include "base/basictypes.h"
-#include "base/metrics/histogram.h"
-#include "base/strings/stringize_macros.h"
-
-namespace {
-
-// Get all valid error codes into an array as positive numbers, for use in the
-// |GetAllErrorCodesForUma| function below.
-#define NET_ERROR(label, value) -(value),
-const int kAllErrorCodes[] = {
-#include "net/base/net_error_list.h"
-};
-#undef NET_ERROR
-
-} // namespace
-
-namespace net {
-
-const char kErrorDomain[] = "net";
-
-std::string ErrorToString(int error) {
- return "net::" + ErrorToShortString(error);
-}
-
-std::string ErrorToShortString(int error) {
- if (error == 0)
- return "OK";
-
- const char* error_string;
- switch (error) {
-#define NET_ERROR(label, value) \
- case ERR_ ## label: \
- error_string = # label; \
- break;
-#include "net/base/net_error_list.h"
-#undef NET_ERROR
- default:
- NOTREACHED();
- error_string = "<unknown>";
- }
- return std::string("ERR_") + error_string;
-}
-
-bool IsCertificateError(int error) {
- // Certificate errors are negative integers from net::ERR_CERT_BEGIN
- // (inclusive) to net::ERR_CERT_END (exclusive) in *decreasing* order.
- // ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN is currently an exception to this
- // rule.
- return (error <= ERR_CERT_BEGIN && error > ERR_CERT_END) ||
- (error == ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN);
-}
-
-bool IsClientCertificateError(int error) {
- switch (error) {
- case ERR_BAD_SSL_CLIENT_AUTH_CERT:
- case ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED:
- case ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY:
- case ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED:
- return true;
- default:
- return false;
- }
-}
-
-std::vector<int> GetAllErrorCodesForUma() {
- return base::CustomHistogram::ArrayToCustomRanges(
- kAllErrorCodes, arraysize(kAllErrorCodes));
-}
-
-Error FileErrorToNetError(base::File::Error file_error) {
- switch (file_error) {
- case base::File::FILE_OK:
- return net::OK;
- case base::File::FILE_ERROR_ACCESS_DENIED:
- return net::ERR_ACCESS_DENIED;
- case base::File::FILE_ERROR_INVALID_URL:
- return net::ERR_INVALID_URL;
- case base::File::FILE_ERROR_NOT_FOUND:
- return net::ERR_FILE_NOT_FOUND;
- default:
- return net::ERR_FAILED;
- }
-}
-
-} // namespace net
« no previous file with comments | « net/base/net_errors.h ('k') | net/base/net_errors_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698