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

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: Fix tests Created 6 years, 5 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
Index: net/base/net_errors.h
diff --git a/net/base/net_errors.h b/net/base/net_errors.h
index 2c513612209f7c2eb08dc6c249160da506664b6f..3fe53e172e2b8c2a4457e4d45820eada1969c76e 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"
@@ -29,18 +30,14 @@ enum Error {
ERR_CERT_BEGIN = ERR_CERT_COMMON_NAME_INVALID,
};
+// Same as above, but leaves off the leading "net::".
eroman 2014/08/05 22:54:51 "Same as below", or move this down ;)
mmenke 2014/08/06 16:40:56 Moved it down (And its definition as well), "same
+NET_EXPORT std::string ErrorToShortString(int 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);
// 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);

Powered by Google App Engine
This is Rietveld 408576698