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

Unified Diff: net/cert/cert_verifier.h

Issue 1115903002: Refactor the API for CertVerifier::Verify() and the implementation of MultiThreadedCertVerifier::Ver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 5 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 | « google_apis/gcm/tools/mcs_probe.cc ('k') | net/cert/mock_cert_verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_verifier.h
diff --git a/net/cert/cert_verifier.h b/net/cert/cert_verifier.h
index 71a347854272cf537f2e6bc4104d4fdf83556cce..aaab36c83c2daaaf416904bf91a6e2f5e5782be3 100644
--- a/net/cert/cert_verifier.h
+++ b/net/cert/cert_verifier.h
@@ -20,14 +20,14 @@ class X509Certificate;
// CertVerifier represents a service for verifying certificates.
//
-// CertVerifiers can handle multiple requests at a time. A simpler alternative
-// for consumers that only have 1 outstanding request at a time is to create a
-// SingleRequestCertVerifier wrapper around CertVerifier (which will
-// automatically cancel the single request when it goes out of scope).
+// CertVerifiers can handle multiple requests at a time.
class NET_EXPORT CertVerifier {
public:
- // Opaque pointer type used to cancel outstanding requests.
- typedef void* RequestHandle;
+ class Request {
pneubeck (no reviews) 2015/05/13 10:13:07 another thing that I stumbled over: it's not docu
pneubeck (no reviews) 2015/05/13 12:01:20 and, since the copy is not allowed anymore, I find
+ public:
+ // Destruction of the Request cancels it.
+ virtual ~Request() {}
+ };
enum VerifyFlags {
// If set, enables online revocation checking via CRLs and OCSP for the
@@ -99,8 +99,8 @@ class NET_EXPORT CertVerifier {
// could not be completed synchronously, in which case the result code will
// be passed to the callback when available.
//
- // |*out_req| will be filled with a handle to the async request.
- // This handle is not valid after the request has completed.
+ // |*out_req| will be filled with a pointer to the asynchronous request.
pneubeck (no reviews) 2015/05/12 09:20:16 It seems that it is not guaranteed that out_req wi
eroman 2015/05/12 14:22:11 Thanks Phillip! I will address that in a follow-up
+ // Freeing this pointer before the request has completed will cancel it.
//
// TODO(rsleevi): Move CRLSet* out of the CertVerifier signature.
virtual int Verify(X509Certificate* cert,
@@ -110,13 +110,9 @@ class NET_EXPORT CertVerifier {
CRLSet* crl_set,
CertVerifyResult* verify_result,
const CompletionCallback& callback,
- RequestHandle* out_req,
+ scoped_ptr<Request>* out_req,
const BoundNetLog& net_log) = 0;
- // Cancels the specified request. |req| is the handle returned by Verify().
- // After a request is canceled, its completion callback will not be called.
- virtual void CancelRequest(RequestHandle req) = 0;
-
// Returns true if this CertVerifier supports stapled OCSP responses.
virtual bool SupportsOCSPStapling();
« no previous file with comments | « google_apis/gcm/tools/mcs_probe.cc ('k') | net/cert/mock_cert_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698