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

Unified Diff: net/base/cert_verifier.cc

Issue 14915: Move certificate verification off the IO thread.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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/base/cert_verifier.h ('k') | net/base/cert_verify_result.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/cert_verifier.cc
===================================================================
--- net/base/cert_verifier.cc (revision 9082)
+++ net/base/cert_verifier.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/message_loop.h"
#include "base/worker_pool.h"
+#include "net/base/cert_verify_result.h"
#include "net/base/net_errors.h"
#include "net/base/x509_certificate.h"
@@ -18,17 +19,16 @@
X509Certificate* cert,
const std::string& hostname,
bool rev_checking_enabled,
- int* cert_status,
+ CertVerifyResult* verify_result,
CompletionCallback* callback)
: cert_(cert),
hostname_(hostname),
rev_checking_enabled_(rev_checking_enabled),
verifier_(verifier),
- cert_status_(cert_status),
+ verify_result_(verify_result),
callback_(callback),
origin_loop_(MessageLoop::current()),
- error_(OK),
- result_(0) {
+ error_(OK) {
}
~Request() {}
@@ -55,13 +55,12 @@
void DoCallback() {
// Running on the origin thread.
- DCHECK(error_ || result_);
// We may have been cancelled!
if (!verifier_)
return;
- *cert_status_ = result_;
+ *verify_result_ = result_;
// Drop the verifier's reference to us. Do this before running the
// callback since the callback might result in the verifier being
@@ -86,7 +85,7 @@
// Only used on the origin thread (where Verify was called).
CertVerifier* verifier_;
- int* cert_status_;
+ CertVerifyResult* verify_result_;
CompletionCallback* callback_;
// Used to post ourselves onto the origin thread.
@@ -95,7 +94,7 @@
// Assigned on the worker thread, read on the origin thread.
int error_;
- int result_;
+ CertVerifyResult result_;
};
//-----------------------------------------------------------------------------
@@ -111,20 +110,20 @@
int CertVerifier::Verify(X509Certificate* cert,
const std::string& hostname,
bool rev_checking_enabled,
- int* cert_status,
+ CertVerifyResult* verify_result,
CompletionCallback* callback) {
DCHECK(!request_) << "verifier already in use";
// Do a synchronous verification.
if (!callback) {
- int result;
+ CertVerifyResult result;
int rv = cert->Verify(hostname, rev_checking_enabled, &result);
- *cert_status = result;
+ *verify_result = result;
return rv;
}
request_ = new Request(this, cert, hostname, rev_checking_enabled,
- cert_status, callback);
+ verify_result, callback);
// Dispatch to worker thread...
if (!WorkerPool::PostTask(FROM_HERE,
« no previous file with comments | « net/base/cert_verifier.h ('k') | net/base/cert_verify_result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698