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

Unified Diff: content/browser/ssl/ssl_client_auth_handler.cc

Issue 596873002: Remove SSLClientAuthHandler's RDH dependency. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: content/browser/ssl/ssl_client_auth_handler.cc
diff --git a/content/browser/ssl/ssl_client_auth_handler.cc b/content/browser/ssl/ssl_client_auth_handler.cc
index b7fe9f0a7fa4857c90074bcd7a04b07f69da8261..74f6c1b999ff1f27ff83768697a68a2a5f40ab4f 100644
--- a/content/browser/ssl/ssl_client_auth_handler.cc
+++ b/content/browser/ssl/ssl_client_auth_handler.cc
@@ -5,7 +5,7 @@
#include "content/browser/ssl/ssl_client_auth_handler.h"
#include "base/bind.h"
-#include "content/browser/loader/resource_dispatcher_host_impl.h"
+#include "base/callback_helpers.h"
#include "content/browser/loader/resource_request_info_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -20,12 +20,14 @@ namespace content {
SSLClientAuthHandler::SSLClientAuthHandler(
scoped_ptr<net::ClientCertStore> client_cert_store,
net::URLRequest* request,
- net::SSLCertRequestInfo* cert_request_info)
+ net::SSLCertRequestInfo* cert_request_info,
+ const SSLClientAuthHandler::CertificateCallback& callback)
: request_(request),
http_network_session_(
request_->context()->http_transaction_factory()->GetSession()),
cert_request_info_(cert_request_info),
- client_cert_store_(client_cert_store.Pass()) {
+ client_cert_store_(client_cert_store.Pass()),
+ callback_(callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
@@ -36,6 +38,7 @@ SSLClientAuthHandler::~SSLClientAuthHandler() {
void SSLClientAuthHandler::OnRequestCancelled() {
request_ = NULL;
+ callback_.Reset();
}
void SSLClientAuthHandler::SelectCertificate() {
@@ -104,10 +107,8 @@ void SSLClientAuthHandler::DoCertificateSelected(net::X509Certificate* cert) {
// user was choosing a cert, or because we have already responded to the
// certificate.
if (request_) {
- request_->ContinueWithCertificate(cert);
-
- ResourceDispatcherHostImpl::Get()->
- ClearSSLClientAuthHandlerForRequest(request_);
+ DCHECK(!callback_.is_null());
+ base::ResetAndReturn(&callback_).Run(cert);
request_ = NULL;
mmenke 2014/09/23 19:24:23 Should we clear request_ first? If the ResetAndRe
davidben 2014/09/23 21:22:02 No longer relevant.
}
}
« content/browser/loader/resource_loader.cc ('K') | « content/browser/ssl/ssl_client_auth_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698