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

Unified Diff: chromeos/cert_loader.h

Issue 2828713002: Enable client certificate patterns in device ONC policy (Closed)
Patch Set: Use BindOnce, PostTaskWithTraitsAndReplyWithResult. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698