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