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

Unified Diff: net/base/net_errors.h

Issue 432553003: Remove redundant mapping of net errors to strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to comments Created 6 years, 4 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 | « device/bluetooth/bluetooth_socket_win.cc ('k') | net/base/net_errors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/net_errors.h
diff --git a/net/base/net_errors.h b/net/base/net_errors.h
index 2c513612209f7c2eb08dc6c249160da506664b6f..4dc6042b65eb9abb8c1bf64268e29d30fb2d420f 100644
--- a/net/base/net_errors.h
+++ b/net/base/net_errors.h
@@ -5,6 +5,7 @@
#ifndef NET_BASE_NET_ERRORS_H__
#define NET_BASE_NET_ERRORS_H__
+#include <string>
#include <vector>
#include "base/basictypes.h"
@@ -30,17 +31,13 @@ enum Error {
};
// Returns a textual representation of the error code for logging purposes.
-NET_EXPORT const char* ErrorToString(int error);
+NET_EXPORT std::string ErrorToString(int error);
+
+// Same as above, but leaves off the leading "net::".
+NET_EXPORT std::string ErrorToShortString(int error);
// Returns true if |error| is a certificate error code.
-inline 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);
-}
+NET_EXPORT bool IsCertificateError(int error);
// Map system error code to Error.
NET_EXPORT Error MapSystemError(int os_error);
« no previous file with comments | « device/bluetooth/bluetooth_socket_win.cc ('k') | net/base/net_errors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698