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 #include "chrome/browser/certificate_manager_model.h" | 5 #include "chrome/browser/certificate_manager_model.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 extension_certificate_provider)), | 108 extension_certificate_provider)), |
109 weak_ptr_factory_(this) { | 109 weak_ptr_factory_(this) { |
110 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 110 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
111 } | 111 } |
112 | 112 |
113 CertificateManagerModel::~CertificateManagerModel() { | 113 CertificateManagerModel::~CertificateManagerModel() { |
114 } | 114 } |
115 | 115 |
116 void CertificateManagerModel::Refresh() { | 116 void CertificateManagerModel::Refresh() { |
117 DVLOG(1) << "refresh started"; | 117 DVLOG(1) << "refresh started"; |
118 net::CryptoModuleList modules; | 118 std::vector<crypto::ScopedPK11Slot> modules; |
119 cert_db_->ListModules(&modules, false); | 119 cert_db_->ListModules(&modules, false); |
120 DVLOG(1) << "refresh waiting for unlocking..."; | 120 DVLOG(1) << "refresh waiting for unlocking..."; |
121 chrome::UnlockSlotsIfNecessary( | 121 chrome::UnlockSlotsIfNecessary( |
122 modules, | 122 modules, |
123 chrome::kCryptoModulePasswordListCerts, | 123 chrome::kCryptoModulePasswordListCerts, |
124 net::HostPortPair(), // unused. | 124 net::HostPortPair(), // unused. |
125 NULL, // TODO(mattm): supply parent window. | 125 NULL, // TODO(mattm): supply parent window. |
126 base::Bind(&CertificateManagerModel::RefreshSlotsUnlocked, | 126 base::Bind(&CertificateManagerModel::RefreshSlotsUnlocked, |
127 base::Unretained(this))); | 127 base::Unretained(this))); |
128 | 128 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( | 329 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( |
330 context, did_get_cert_db_callback); | 330 context, did_get_cert_db_callback); |
331 | 331 |
332 // The callback is run here instead of the actual function call because of | 332 // The callback is run here instead of the actual function call because of |
333 // extension_certificate_provider ownership semantics, ie. ownership can only | 333 // extension_certificate_provider ownership semantics, ie. ownership can only |
334 // be released once. The callback will only be run once (either inside the | 334 // be released once. The callback will only be run once (either inside the |
335 // function above or here). | 335 // function above or here). |
336 if (cert_db) | 336 if (cert_db) |
337 did_get_cert_db_callback.Run(cert_db); | 337 did_get_cert_db_callback.Run(cert_db); |
338 } | 338 } |
OLD | NEW |