OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ |
6 #define CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ | 6 #define CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 static ErrorType NetErrorToErrorType(int net_error); | 46 static ErrorType NetErrorToErrorType(int net_error); |
47 | 47 |
48 static SSLErrorInfo CreateError(ErrorType error_type, | 48 static SSLErrorInfo CreateError(ErrorType error_type, |
49 net::X509Certificate* cert, | 49 net::X509Certificate* cert, |
50 const GURL& request_url); | 50 const GURL& request_url); |
51 | 51 |
52 // Populates the specified |errors| vector with the errors contained in | 52 // Populates the specified |errors| vector with the errors contained in |
53 // |cert_status|. Returns the number of errors found. | 53 // |cert_status|. Returns the number of errors found. |
54 // Callers only interested in the error count can pass NULL for |errors|. | 54 // Callers only interested in the error count can pass NULL for |errors|. |
55 // TODO(wtc): Document |cert_id| and |url| arguments. | 55 // TODO(wtc): Document |cert_id| and |url| arguments. |
56 static int GetErrorsForCertStatus(int cert_id, | 56 static size_t GetErrorsForCertStatus(int cert_id, |
meacer
2015/03/23 21:54:30
I was going to suggest renaming this to GetNumErro
| |
57 net::CertStatus cert_status, | 57 net::CertStatus cert_status, |
58 const GURL& url, | 58 const GURL& url, |
59 std::vector<SSLErrorInfo>* errors); | 59 std::vector<SSLErrorInfo>* errors); |
60 | 60 |
61 // A description of the error. | 61 // A description of the error. |
62 const base::string16& details() const { return details_; } | 62 const base::string16& details() const { return details_; } |
63 | 63 |
64 // A short message describing the error (1 line). | 64 // A short message describing the error (1 line). |
65 const base::string16& short_description() const { return short_description_; } | 65 const base::string16& short_description() const { return short_description_; } |
66 | 66 |
67 private: | 67 private: |
68 SSLErrorInfo(const base::string16& details, | 68 SSLErrorInfo(const base::string16& details, |
69 const base::string16& short_description); | 69 const base::string16& short_description); |
70 | 70 |
71 base::string16 details_; | 71 base::string16 details_; |
72 base::string16 short_description_; | 72 base::string16 short_description_; |
73 }; | 73 }; |
74 | 74 |
75 #endif // CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ | 75 #endif // CHROME_BROWSER_SSL_SSL_ERROR_INFO_H_ |
OLD | NEW |