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

Side by Side Diff: chrome/browser/certificate_manager_model.cc

Issue 144423007: Make NSSCertDatabase::ListCerts work async on a worker thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chromeos/cert_loader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/i18n/time_formatting.h" 8 #include "base/i18n/time_formatting.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 modules, 84 modules,
85 chrome::kCryptoModulePasswordListCerts, 85 chrome::kCryptoModulePasswordListCerts,
86 net::HostPortPair(), // unused. 86 net::HostPortPair(), // unused.
87 NULL, // TODO(mattm): supply parent window. 87 NULL, // TODO(mattm): supply parent window.
88 base::Bind(&CertificateManagerModel::RefreshSlotsUnlocked, 88 base::Bind(&CertificateManagerModel::RefreshSlotsUnlocked,
89 base::Unretained(this))); 89 base::Unretained(this)));
90 } 90 }
91 91
92 void CertificateManagerModel::RefreshSlotsUnlocked() { 92 void CertificateManagerModel::RefreshSlotsUnlocked() {
93 DVLOG(1) << "refresh listing certs..."; 93 DVLOG(1) << "refresh listing certs...";
94 cert_db_->ListCerts(&cert_list_); 94 // TODO(tbarzic): Use async |ListCerts|.
95 cert_db_->ListCertsSync(&cert_list_);
95 observer_->CertificatesRefreshed(); 96 observer_->CertificatesRefreshed();
96 DVLOG(1) << "refresh finished"; 97 DVLOG(1) << "refresh finished";
97 } 98 }
98 99
99 void CertificateManagerModel::FilterAndBuildOrgGroupingMap( 100 void CertificateManagerModel::FilterAndBuildOrgGroupingMap(
100 net::CertType filter_type, 101 net::CertType filter_type,
101 CertificateManagerModel::OrgGroupingMap* map) const { 102 CertificateManagerModel::OrgGroupingMap* map) const {
102 for (net::CertificateList::const_iterator i = cert_list_.begin(); 103 for (net::CertificateList::const_iterator i = cert_list_.begin();
103 i != cert_list_.end(); ++i) { 104 i != cert_list_.end(); ++i) {
104 net::X509Certificate* cert = i->get(); 105 net::X509Certificate* cert = i->get();
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 const CreationCallback& callback) { 245 const CreationCallback& callback) {
245 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 246 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
246 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( 247 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext(
247 context, 248 context,
248 base::Bind(&CertificateManagerModel::DidGetCertDBOnIOThread, 249 base::Bind(&CertificateManagerModel::DidGetCertDBOnIOThread,
249 observer, 250 observer,
250 callback)); 251 callback));
251 if (cert_db) 252 if (cert_db)
252 DidGetCertDBOnIOThread(observer, callback, cert_db); 253 DidGetCertDBOnIOThread(observer, callback, cert_db);
253 } 254 }
OLDNEW
« no previous file with comments | « no previous file | chromeos/cert_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698