OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_BASE_NET_ERRORS_H__ | 5 #ifndef NET_BASE_NET_ERRORS_H__ |
6 #define NET_BASE_NET_ERRORS_H__ | 6 #define NET_BASE_NET_ERRORS_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... | |
29 // The value of the first certificate error code. | 29 // The value of the first certificate error code. |
30 ERR_CERT_BEGIN = ERR_CERT_COMMON_NAME_INVALID, | 30 ERR_CERT_BEGIN = ERR_CERT_COMMON_NAME_INVALID, |
31 }; | 31 }; |
32 | 32 |
33 // Returns a textual representation of the error code for logging purposes. | 33 // Returns a textual representation of the error code for logging purposes. |
34 NET_EXPORT std::string ErrorToString(int error); | 34 NET_EXPORT std::string ErrorToString(int error); |
35 | 35 |
36 // Same as above, but leaves off the leading "net::". | 36 // Same as above, but leaves off the leading "net::". |
37 NET_EXPORT std::string ErrorToShortString(int error); | 37 NET_EXPORT std::string ErrorToShortString(int error); |
38 | 38 |
39 // Returns a short string for HTTP error codes in the form of "HTTP_ERROR_123". | |
40 NET_EXPORT std::string HttpErrorCodeToString(int error); | |
mmenke
2016/02/12 17:25:54
Do we really need this in net? Any reason not to
edwardjung
2016/02/15 15:53:49
I guess not. Confirmed with rachelis to change to
| |
41 | |
39 // Returns true if |error| is a certificate error code. | 42 // Returns true if |error| is a certificate error code. |
40 NET_EXPORT bool IsCertificateError(int error); | 43 NET_EXPORT bool IsCertificateError(int error); |
41 | 44 |
42 // Returns true if |error| is a client certificate authentication error. This | 45 // Returns true if |error| is a client certificate authentication error. This |
43 // does not include ERR_SSL_PROTOCOL_ERROR which may also signal a bad client | 46 // does not include ERR_SSL_PROTOCOL_ERROR which may also signal a bad client |
44 // certificate. | 47 // certificate. |
45 NET_EXPORT bool IsClientCertificateError(int error); | 48 NET_EXPORT bool IsClientCertificateError(int error); |
46 | 49 |
47 // Map system error code to Error. | 50 // Map system error code to Error. |
48 NET_EXPORT Error MapSystemError(logging::SystemErrorCode os_error); | 51 NET_EXPORT Error MapSystemError(logging::SystemErrorCode os_error); |
49 | 52 |
50 // A convenient function to translate file error to net error code. | 53 // A convenient function to translate file error to net error code. |
51 NET_EXPORT Error FileErrorToNetError(base::File::Error file_error); | 54 NET_EXPORT Error FileErrorToNetError(base::File::Error file_error); |
52 | 55 |
53 } // namespace net | 56 } // namespace net |
54 | 57 |
55 #endif // NET_BASE_NET_ERRORS_H__ | 58 #endif // NET_BASE_NET_ERRORS_H__ |
OLD | NEW |