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

Unified Diff: chrome/browser/chromeos/certificate_provider/certificate_provider_service.h

Issue 1330003002: CertificateProviderService: Expose certificate lookup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoped_ptr_map
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/certificate_provider/certificate_provider_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/certificate_provider/certificate_provider_service.h
diff --git a/chrome/browser/chromeos/certificate_provider/certificate_provider_service.h b/chrome/browser/chromeos/certificate_provider/certificate_provider_service.h
index 5fc84ea0f77cb7606bdd0d96b19c7873f99e6911..d45794c272bf44f9e0e9bbd3d371d39119cd4430 100644
--- a/chrome/browser/chromeos/certificate_provider/certificate_provider_service.h
+++ b/chrome/browser/chromeos/certificate_provider/certificate_provider_service.h
@@ -127,6 +127,16 @@ class CertificateProviderService : public KeyedService {
int sign_request_id,
const std::vector<uint8_t>& signature);
+ // Returns whether this certificate was provided by any extension during the
+ // lifetime of this service. If this certificate is currently provided by an
+ // extension, sets |is_currently_provided| to true and |extension_id| to that
+ // extension's id. If this certificate was provided before but not anymore,
+ // |is_currently_provided| will be set to false and |extension_id| will not be
+ // modified.
+ bool LookUpCertificate(const net::X509Certificate& cert,
+ bool* is_currently_provided,
+ std::string* extension_id);
+
// Returns a CertificateProvider that always returns the latest list of
// certificates that are provided by all registered extensions. Therefore, it
// is sufficient to create the CertificateProvider once and then repeatedly
@@ -187,8 +197,14 @@ class CertificateProviderService : public KeyedService {
// Contains all pending certificate requests.
certificate_provider::CertificateRequests certificate_requests_;
- // Contains all certificates that the extensions returned in response to the
- // most recent certificate request.
+ // Contains all certificates that the extensions returned during the lifetime
+ // of this service. Each certificate is associated with the extension that
+ // reported the certificate in response to the most recent certificate
+ // request. If a certificate was reported previously but in the most recent
+ // responses, it is still cached but not loses it's association with any
+ // extension. This ensures that a certificate can't magically appear as
+ // platform certificate (e.g. in the client certificate selection dialog)
+ // after an extension doesn't report it anymore.
certificate_provider::ThreadSafeCertificateMap certificate_map_;
base::ThreadChecker thread_checker_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/certificate_provider/certificate_provider_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698