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

Unified Diff: net/socket/ssl_host_info.cc

Issue 5386001: Cache certificate verification results in memory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Add unit tests. Ready for review. Created 10 years 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/socket/ssl_host_info.cc
===================================================================
--- net/socket/ssl_host_info.cc (revision 68922)
+++ net/socket/ssl_host_info.cc (working copy)
@@ -6,7 +6,6 @@
#include "base/metrics/histogram.h"
#include "base/string_piece.h"
-#include "net/base/cert_verifier.h"
#include "net/base/ssl_config_service.h"
#include "net/base/x509_certificate.h"
#include "net/socket/ssl_client_socket.h"
@@ -23,7 +22,8 @@
SSLHostInfo::SSLHostInfo(
const std::string& hostname,
- const SSLConfig& ssl_config)
+ const SSLConfig& ssl_config,
+ CertVerifier* cert_verifier)
: cert_verification_complete_(false),
cert_verification_error_(ERR_CERT_INVALID),
hostname_(hostname),
@@ -31,6 +31,7 @@
cert_verification_callback_(NULL),
rev_checking_enabled_(ssl_config.rev_checking_enabled),
verify_ev_cert_(ssl_config.verify_ev_cert),
+ verifier_(cert_verifier),
callback_(new CancelableCompletionCallback<SSLHostInfo>(
ALLOW_THIS_IN_INITIALIZER_LIST(this),
&SSLHostInfo::VerifyCallback)) {
@@ -110,11 +111,10 @@
flags |= X509Certificate::VERIFY_EV_CERT;
if (rev_checking_enabled_)
flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED;
- verifier_.reset(new CertVerifier);
VLOG(1) << "Kicking off verification for " << hostname_;
verification_start_time_ = base::TimeTicks::Now();
- if (verifier_->Verify(cert_.get(), hostname_, flags,
- &cert_verify_result_, callback_) == OK) {
+ if (verifier_.Verify(cert_.get(), hostname_, flags,
+ &cert_verify_result_, callback_) == OK) {
VerifyCallback(OK);
}
} else {

Powered by Google App Engine
This is Rietveld 408576698