Index: chromeos/cert_loader.h |
diff --git a/chromeos/cert_loader.h b/chromeos/cert_loader.h |
index 7243c6ddab009804ae2f695c0d4abaf6e87034b7..5398ba2eb9a8d4cd63ee18028b70c3a7a36349c9 100644 |
--- a/chromeos/cert_loader.h |
+++ b/chromeos/cert_loader.h |
@@ -35,10 +35,10 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer { |
public: |
class Observer { |
public: |
- // Called when the certificates, passed for convenience as |cert_list|, |
+ // Called when the certificates, passed for convenience as |all_certs|, |
// have completed loading. |initial_load| is true the first time this |
// is called. |
- virtual void OnCertificatesLoaded(const net::CertificateList& cert_list, |
+ virtual void OnCertificatesLoaded(const net::CertificateList& all_certs, |
bool initial_load) = 0; |
protected: |
@@ -83,8 +83,13 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer { |
bool certificates_loaded() const { return certificates_loaded_; } |
- // This will be empty until certificates_loaded() is true. |
- const net::CertificateList& cert_list() const { return *cert_list_; } |
+ // Returns all certificates. This will be empty until certificates_loaded() is |
+ // true. |
+ const net::CertificateList& all_certs() const { return *all_certs_; } |
fdoray
2017/04/26 13:11:36
DCHECK(thread_checker_.CalledOnValidThread());
pmarko
2017/04/27 08:51:56
Done.
|
+ |
+ // Returns certificates from the system token. This will be empty until |
+ // certificates_loaded() is true. |
+ const net::CertificateList& system_certs() const { return *system_certs_; } |
fdoray
2017/04/26 13:11:36
DCHECK(thread_checker_.CalledOnValidThread());
pmarko
2017/04/27 08:51:56
Done.
|
// Called in tests if |IsCertificateHardwareBacked()| should always return |
// true. |
@@ -98,8 +103,12 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer { |
// progress, will start a reload once the current task is finished. |
void LoadCertificates(); |
+ // Called when the underlying NSS database finished loading certificates. |
+ void CertificatesLoaded(std::unique_ptr<net::CertificateList> all_certs); |
+ |
// Called if a certificate load task is finished. |
- void UpdateCertificates(std::unique_ptr<net::CertificateList> cert_list); |
+ void UpdateCertificates(std::unique_ptr<net::CertificateList> all_certs, |
+ std::unique_ptr<net::CertificateList> system_certs); |
void NotifyCertificatesLoaded(bool initial_load); |
@@ -117,8 +126,12 @@ class CHROMEOS_EXPORT CertLoader : public net::CertDatabase::Observer { |
// should be loaded. |
net::NSSCertDatabase* database_; |
- // Cached Certificates loaded from the database. |
- std::unique_ptr<net::CertificateList> cert_list_; |
+ // Cached certificates loaded from the database. |
+ std::unique_ptr<net::CertificateList> all_certs_; |
+ |
+ // Cached certificates from system token. Currently this is a sublist of |
+ // |all_certs_|. |
+ std::unique_ptr<net::CertificateList> system_certs_; |
base::ThreadChecker thread_checker_; |