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

Unified Diff: net/base/multi_threaded_cert_verifier.cc

Issue 9584041: Create stubs for system certificate validation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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: net/base/multi_threaded_cert_verifier.cc
diff --git a/net/base/multi_threaded_cert_verifier.cc b/net/base/multi_threaded_cert_verifier.cc
index 6a3037bd073e7dbdceb42be1c1c7352f3d1506f8..232fedf883894c76156469a0030daf09ee6b24af 100644
--- a/net/base/multi_threaded_cert_verifier.cc
+++ b/net/base/multi_threaded_cert_verifier.cc
@@ -130,12 +130,14 @@ class CertVerifierRequest {
// eventually if Start() succeeds.
class CertVerifierWorker {
public:
- CertVerifierWorker(X509Certificate* cert,
+ CertVerifierWorker(MultiThreadedCertVerifier::VerifyProc* verify_proc,
+ X509Certificate* cert,
const std::string& hostname,
int flags,
CRLSet* crl_set,
MultiThreadedCertVerifier* cert_verifier)
- : cert_(cert),
+ : verify_proc_(verify_proc),
+ cert_(cert),
hostname_(hostname),
flags_(flags),
crl_set_(crl_set),
@@ -168,7 +170,8 @@ class CertVerifierWorker {
private:
void Run() {
// Runs on a worker thread.
- error_ = cert_->Verify(hostname_, flags_, crl_set_, &verify_result_);
+ error_ = verify_proc_->Verify(cert_, hostname_, flags_, crl_set_,
+ &verify_result_);
#if defined(USE_NSS)
// Detach the thread from NSPR.
// Calling NSS functions attaches the thread to NSPR, which stores
@@ -226,6 +229,7 @@ class CertVerifierWorker {
delete this;
}
+ scoped_refptr<MultiThreadedCertVerifier::VerifyProc> verify_proc_;
scoped_refptr<X509Certificate> cert_;
const std::string hostname_;
const int flags_;
@@ -320,8 +324,9 @@ class CertVerifierJob {
const BoundNetLog net_log_;
};
-MultiThreadedCertVerifier::MultiThreadedCertVerifier()
+MultiThreadedCertVerifier::MultiThreadedCertVerifier(VerifyProc* verifier)
: cache_(kMaxCacheEntries),
+ verifier_(verifier),
requests_(0),
cache_hits_(0),
inflight_joins_(0) {
@@ -373,8 +378,8 @@ int MultiThreadedCertVerifier::Verify(X509Certificate* cert,
job = j->second;
} else {
// Need to make a new request.
- CertVerifierWorker* worker = new CertVerifierWorker(cert, hostname, flags,
- crl_set, this);
+ CertVerifierWorker* worker = new CertVerifierWorker(
+ verifier_, cert, hostname, flags, crl_set, this);
job = new CertVerifierJob(
worker,
BoundNetLog::Make(net_log.net_log(), NetLog::SOURCE_CERT_VERIFIER_JOB));

Powered by Google App Engine
This is Rietveld 408576698