Index: content/browser/loader/resource_loader.cc |
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc |
index 0aa9ceee65bad8ab380f66e9ba04b604e949868f..8c11b808682f9122471843a9104a72e6badc5878 100644 |
--- a/content/browser/loader/resource_loader.cc |
+++ b/content/browser/loader/resource_loader.cc |
@@ -97,8 +97,7 @@ |
ResourceLoader::~ResourceLoader() { |
if (login_delegate_.get()) |
login_delegate_->OnRequestCancelled(); |
- if (ssl_client_auth_handler_.get()) |
- ssl_client_auth_handler_->OnRequestCancelled(); |
+ ssl_client_auth_handler_.reset(); |
// Run ResourceHandler destructor before we tear-down the rest of our state |
// as the ResourceHandler may want to inspect the URLRequest and other state. |
@@ -211,10 +210,6 @@ |
login_delegate_ = NULL; |
} |
-void ResourceLoader::ClearSSLClientAuthHandler() { |
- ssl_client_auth_handler_ = NULL; |
-} |
- |
void ResourceLoader::OnUploadProgressACK() { |
waiting_for_upload_progress_ack_ = false; |
} |
@@ -292,12 +287,14 @@ |
return; |
} |
- DCHECK(!ssl_client_auth_handler_.get()) |
+ DCHECK(!ssl_client_auth_handler_) |
<< "OnCertificateRequested called with ssl_client_auth_handler pending"; |
- ssl_client_auth_handler_ = new SSLClientAuthHandler( |
+ ssl_client_auth_handler_.reset(new SSLClientAuthHandler( |
GetRequestInfo()->GetContext()->CreateClientCertStore(), |
request_.get(), |
- cert_info); |
+ cert_info, |
+ base::Bind(&ResourceLoader::ContinueWithCertificate, |
+ weak_ptr_factory_.GetWeakPtr()))); |
ssl_client_auth_handler_->SelectCertificate(); |
} |
@@ -529,10 +526,7 @@ |
login_delegate_->OnRequestCancelled(); |
login_delegate_ = NULL; |
} |
- if (ssl_client_auth_handler_.get()) { |
- ssl_client_auth_handler_->OnRequestCancelled(); |
- ssl_client_auth_handler_ = NULL; |
- } |
+ ssl_client_auth_handler_.reset(); |
request_->CancelWithError(error); |
@@ -770,4 +764,9 @@ |
} |
} |
+void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert) { |
+ ssl_client_auth_handler_.reset(); |
+ request_->ContinueWithCertificate(cert); |
+} |
+ |
} // namespace content |