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

Side by Side Diff: net/cert/nss_cert_database.cc

Issue 76653003: Don't use nss_util in CertificateManagerModel::IsHardwareBacked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: hyphenate Created 7 years, 1 month 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 | « net/cert/nss_cert_database.h ('k') | no next file » | 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 "net/cert/nss_cert_database.h" 5 #include "net/cert/nss_cert_database.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <certdb.h> 8 #include <certdb.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <pk11pub.h> 10 #include <pk11pub.h>
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 NotifyObserversOfCertRemoved(cert); 311 NotifyObserversOfCertRemoved(cert);
312 312
313 return true; 313 return true;
314 } 314 }
315 315
316 bool NSSCertDatabase::IsReadOnly(const X509Certificate* cert) const { 316 bool NSSCertDatabase::IsReadOnly(const X509Certificate* cert) const {
317 PK11SlotInfo* slot = cert->os_cert_handle()->slot; 317 PK11SlotInfo* slot = cert->os_cert_handle()->slot;
318 return slot && PK11_IsReadOnly(slot); 318 return slot && PK11_IsReadOnly(slot);
319 } 319 }
320 320
321 bool NSSCertDatabase::IsHardwareBacked(const X509Certificate* cert) const {
322 PK11SlotInfo* slot = cert->os_cert_handle()->slot;
323 return slot && PK11_IsHW(slot);
324 }
325
321 void NSSCertDatabase::AddObserver(Observer* observer) { 326 void NSSCertDatabase::AddObserver(Observer* observer) {
322 observer_list_->AddObserver(observer); 327 observer_list_->AddObserver(observer);
323 } 328 }
324 329
325 void NSSCertDatabase::RemoveObserver(Observer* observer) { 330 void NSSCertDatabase::RemoveObserver(Observer* observer) {
326 observer_list_->RemoveObserver(observer); 331 observer_list_->RemoveObserver(observer);
327 } 332 }
328 333
329 void NSSCertDatabase::NotifyObserversOfCertAdded(const X509Certificate* cert) { 334 void NSSCertDatabase::NotifyObserversOfCertAdded(const X509Certificate* cert) {
330 observer_list_->Notify(&Observer::OnCertAdded, make_scoped_refptr(cert)); 335 observer_list_->Notify(&Observer::OnCertAdded, make_scoped_refptr(cert));
331 } 336 }
332 337
333 void NSSCertDatabase::NotifyObserversOfCertRemoved( 338 void NSSCertDatabase::NotifyObserversOfCertRemoved(
334 const X509Certificate* cert) { 339 const X509Certificate* cert) {
335 observer_list_->Notify(&Observer::OnCertRemoved, make_scoped_refptr(cert)); 340 observer_list_->Notify(&Observer::OnCertRemoved, make_scoped_refptr(cert));
336 } 341 }
337 342
338 void NSSCertDatabase::NotifyObserversOfCACertChanged( 343 void NSSCertDatabase::NotifyObserversOfCACertChanged(
339 const X509Certificate* cert) { 344 const X509Certificate* cert) {
340 observer_list_->Notify( 345 observer_list_->Notify(
341 &Observer::OnCACertChanged, make_scoped_refptr(cert)); 346 &Observer::OnCACertChanged, make_scoped_refptr(cert));
342 } 347 }
343 348
344 } // namespace net 349 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/nss_cert_database.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698