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

Unified Diff: content/browser/loader/resource_loader.cc

Issue 859213006: Cancel client auth requests when not promptable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client-auth-cancel-1
Patch Set: worker_common.js was missing a license header (also a rebase) Created 5 years, 9 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 | « content/browser/loader/resource_loader.h ('k') | content/browser/loader/resource_loader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_loader.cc
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc
index b462a68d038aa69ba606ff06d2fd902ae829310b..7bb55f1a32dfba4d2aa0f8a02a9e595f2620dd39 100644
--- a/content/browser/loader/resource_loader.cc
+++ b/content/browser/loader/resource_loader.cc
@@ -311,8 +311,7 @@ void ResourceLoader::OnCertificateRequested(
<< "OnCertificateRequested called with ssl_client_auth_handler pending";
ssl_client_auth_handler_.reset(new SSLClientAuthHandler(
GetRequestInfo()->GetContext()->CreateClientCertStore(), request_.get(),
- cert_info, base::Bind(&ResourceLoader::ContinueWithCertificate,
- weak_ptr_factory_.GetWeakPtr())));
+ cert_info, this));
ssl_client_auth_handler_->SelectCertificate();
}
@@ -503,6 +502,18 @@ void ResourceLoader::ContinueSSLRequest() {
request_->ContinueDespiteLastError();
}
+void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert) {
+ DCHECK(ssl_client_auth_handler_);
+ ssl_client_auth_handler_.reset();
+ request_->ContinueWithCertificate(cert);
+}
+
+void ResourceLoader::CancelCertificateSelection() {
+ DCHECK(ssl_client_auth_handler_);
+ ssl_client_auth_handler_.reset();
+ request_->CancelWithError(net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED);
+}
+
void ResourceLoader::Resume() {
DCHECK(!is_transferring_);
@@ -851,9 +862,4 @@ void ResourceLoader::RecordHistograms() {
}
}
-void ResourceLoader::ContinueWithCertificate(net::X509Certificate* cert) {
- ssl_client_auth_handler_.reset();
- request_->ContinueWithCertificate(cert);
-}
-
} // namespace content
« no previous file with comments | « content/browser/loader/resource_loader.h ('k') | content/browser/loader/resource_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698