| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/ssl/ssl_error_info.h" | 5 #include "chrome/browser/ssl/ssl_error_info.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/cert_store.h" | 9 #include "chrome/browser/cert_store.h" |
| 10 #include "chrome/common/time_format.h" | 10 #include "chrome/common/time_format.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 CERT_WEAK_SIGNATURE_ALGORITHM | 246 CERT_WEAK_SIGNATURE_ALGORITHM |
| 247 }; | 247 }; |
| 248 DCHECK(arraysize(kErrorFlags) == arraysize(kErrorTypes)); | 248 DCHECK(arraysize(kErrorFlags) == arraysize(kErrorTypes)); |
| 249 | 249 |
| 250 scoped_refptr<net::X509Certificate> cert = NULL; | 250 scoped_refptr<net::X509Certificate> cert = NULL; |
| 251 int count = 0; | 251 int count = 0; |
| 252 for (size_t i = 0; i < arraysize(kErrorFlags); ++i) { | 252 for (size_t i = 0; i < arraysize(kErrorFlags); ++i) { |
| 253 if (cert_status & kErrorFlags[i]) { | 253 if (cert_status & kErrorFlags[i]) { |
| 254 count++; | 254 count++; |
| 255 if (!cert.get()) { | 255 if (!cert.get()) { |
| 256 bool r = CertStore::GetSharedInstance()->RetrieveCert(cert_id, &cert); | 256 bool r = CertStore::GetInstance()->RetrieveCert(cert_id, &cert); |
| 257 DCHECK(r); | 257 DCHECK(r); |
| 258 } | 258 } |
| 259 if (errors) | 259 if (errors) |
| 260 errors->push_back(SSLErrorInfo::CreateError(kErrorTypes[i], cert, url)); | 260 errors->push_back(SSLErrorInfo::CreateError(kErrorTypes[i], cert, url)); |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 return count; | 263 return count; |
| 264 } | 264 } |
| OLD | NEW |