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

Unified Diff: net/cert/multi_threaded_cert_verifier.h

Issue 1987113002: Introduce CertVerifier::RequestParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add NET_EXPORT Created 4 years, 7 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 | « net/cert/cert_verifier_unittest.cc ('k') | net/cert/multi_threaded_cert_verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/multi_threaded_cert_verifier.h
diff --git a/net/cert/multi_threaded_cert_verifier.h b/net/cert/multi_threaded_cert_verifier.h
index 62d68075483e675bca1a6b6e6776fe3f54b8bc04..f7d08e763e7b74f9daaed9ace50b85c0e14e0075 100644
--- a/net/cert/multi_threaded_cert_verifier.h
+++ b/net/cert/multi_threaded_cert_verifier.h
@@ -85,28 +85,6 @@ class NET_EXPORT_PRIVATE MultiThreadedCertVerifier
FRIEND_TEST_ALL_PREFIXES(MultiThreadedCertVerifierTest,
CertTrustAnchorProvider);
- // Input parameters of a certificate verification request.
- struct NET_EXPORT_PRIVATE RequestParams {
- RequestParams(const SHA1HashValue& cert_fingerprint_arg,
- const SHA1HashValue& ca_fingerprint_arg,
- const std::string& hostname_arg,
- const std::string& ocsp_response_arg,
- int flags_arg,
- const CertificateList& additional_trust_anchors);
- RequestParams(const RequestParams& other);
- ~RequestParams();
-
- bool operator<(const RequestParams& other) const;
-
- std::string hostname;
- int flags;
- std::vector<SHA1HashValue> hash_values;
- // The time when verification started.
- // Note: This uses base::Time, rather than base::TimeTicks, to
- // account for system clock changes.
- base::Time start_time;
- };
-
// CachedResult contains the result of a certificate verification.
struct NET_EXPORT_PRIVATE CachedResult {
CachedResult();
@@ -144,19 +122,23 @@ class NET_EXPORT_PRIVATE MultiThreadedCertVerifier
};
using JobSet = std::set<CertVerifierJob*, JobComparator>;
+ using CertVerifierCache = ExpiringCache<CertVerifier::RequestParams,
+ CachedResult,
+ CacheValidityPeriod,
+ CacheExpirationFunctor>;
- typedef ExpiringCache<RequestParams, CachedResult, CacheValidityPeriod,
- CacheExpirationFunctor> CertVerifierCache;
-
- // Saves |result| into the cache, keyed by |key|.
- void SaveResultToCache(const RequestParams& key, const CachedResult& result);
+ // Saves |result| into the cache, keyed by |key|, which began validation at
+ // |start_time|.
+ void SaveResultToCache(const CertVerifier::RequestParams& key,
+ const base::Time& start_time,
+ const CachedResult& result);
// CertDatabase::Observer methods:
void OnCACertChanged(const X509Certificate* cert) override;
// Returns an inflight job for |key|. If there is no such job then returns
// null.
- CertVerifierJob* FindJob(const RequestParams& key);
+ CertVerifierJob* FindJob(const CertVerifier::RequestParams& key);
// Removes |job| from the inflight set, and passes ownership back to the
// caller. |job| must already be |inflight_|.
« no previous file with comments | « net/cert/cert_verifier_unittest.cc ('k') | net/cert/multi_threaded_cert_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698