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

Unified Diff: net/cert/caching_cert_verifier.h

Issue 1999733002: Add support for walking and modifying the CachingCertVerifier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_cache
Patch Set: 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 | « no previous file | net/cert/caching_cert_verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/caching_cert_verifier.h
diff --git a/net/cert/caching_cert_verifier.h b/net/cert/caching_cert_verifier.h
index 74d81a0ef62e6de2beff793f09858ed7c1a89a64..21d14aae17d9cbf20583a8dc63d9c467ed4bcd8c 100644
--- a/net/cert/caching_cert_verifier.h
+++ b/net/cert/caching_cert_verifier.h
@@ -20,6 +20,28 @@ class CertTrustAnchorProvider;
class NET_EXPORT CachingCertVerifier : public CertVerifier,
public CertDatabase::Observer {
public:
+ // Provides a read-only iterator over items in the cache.
+ //
+ // This iterator is invalidated by any modifications to the cache, such
+ // as by a call to Verify() or to AddEntry().
+ class NET_EXPORT Iterator {
+ public:
+ explicit Iterator(const CachingCertVerifier& verifier);
eroman 2016/06/13 22:49:35 I would have said this is clearer as a pointer rat
+ ~Iterator();
+
+ bool HasNext() const;
eroman 2016/06/13 22:49:35 Iteration currently exposes expired entries right?
+ void Advance();
+
+ const RequestParams& params() const;
+ int error() const;
+ const CertVerifyResult& verify_result() const;
+ base::Time verification_time() const;
+ base::Time expiration_time() const;
+
+ private:
+ void* iter_;
+ };
eroman 2016/06/13 22:49:35 Disallow copy and assign.
+
explicit CachingCertVerifier(std::unique_ptr<CertVerifier> verifier);
~CachingCertVerifier() override;
@@ -40,7 +62,19 @@ class NET_EXPORT CachingCertVerifier : public CertVerifier,
const BoundNetLog& net_log) override;
bool SupportsOCSPStapling() override;
+ // Opportunistically attempt to add |error| and |verify_result| as the
eroman 2016/06/13 22:49:35 style nit: use descriptive rather than imperative
+ // result for |params|, which was obtained at |verification_time| and
+ // expires at |expiration_time|.
+ // This is opportunistic because it is not guaranteed that the entry
+ // will be added (such as if the cache is full or an entry already
+ // exists).
eroman 2016/06/13 22:49:35 nit: Mention how how this relates to the return va
eroman 2016/06/16 00:25:04 ping? (My request was to comment that returns true
+ bool AddEntry(const RequestParams& params,
+ int error,
+ const CertVerifyResult& verify_result,
+ base::Time verification_time);
+
private:
+ friend class Iterator;
FRIEND_TEST_ALL_PREFIXES(CachingCertVerifierTest, CacheHit);
FRIEND_TEST_ALL_PREFIXES(CachingCertVerifierTest, DifferentCACerts);
FRIEND_TEST_ALL_PREFIXES(CachingCertVerifierTest, CertTrustAnchorProvider);
« no previous file with comments | « no previous file | net/cert/caching_cert_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698