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

Unified Diff: chrome/browser/renderer_host/resource_dispatcher_host.cc

Issue 147233: Basic implentation of the client auth UI (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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: chrome/browser/renderer_host/resource_dispatcher_host.cc
===================================================================
--- chrome/browser/renderer_host/resource_dispatcher_host.cc (revision 19366)
+++ chrome/browser/renderer_host/resource_dispatcher_host.cc (working copy)
@@ -33,6 +33,7 @@
#include "chrome/browser/renderer_host/safe_browsing_resource_handler.h"
#include "chrome/browser/renderer_host/save_file_resource_handler.h"
#include "chrome/browser/renderer_host/sync_resource_handler.h"
+#include "chrome/browser/ssl/ssl_client_auth_handler.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/chrome_switches.h"
@@ -645,6 +646,10 @@
info->login_handler->OnRequestCancelled();
info->login_handler = NULL;
}
+ if (info->ssl_client_auth_handler) {
+ info->ssl_client_auth_handler->OnRequestCancelled();
+ info->ssl_client_auth_handler = NULL;
+ }
if (!i->second->is_pending() && allow_delete) {
// No io is pending, canceling the request won't notify us of anything,
// so we explicitly remove it.
@@ -879,12 +884,18 @@
net::SSLCertRequestInfo* cert_request_info) {
DCHECK(request);
- bool select_first_cert = CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kAutoSSLClientAuth);
- net::X509Certificate* cert =
- select_first_cert && !cert_request_info->client_certs.empty() ?
- cert_request_info->client_certs[0] : NULL;
- request->ContinueWithCertificate(cert);
+ if (cert_request_info->client_certs.empty()) {
+ // No need to query the user if there are no certs to choose from.
+ request->ContinueWithCertificate(NULL);
+ return;
+ }
+
+ ExtraRequestInfo* info = ExtraInfoForRequest(request);
+ DCHECK(!info->ssl_client_auth_handler) <<
+ "OnCertificateRequested called with ssl_client_auth_handler pending";
+ info->ssl_client_auth_handler =
+ new SSLClientAuthHandler(request, cert_request_info, io_loop_, ui_loop_);
+ info->ssl_client_auth_handler->SelectCertificate();
}
void ResourceDispatcherHost::OnSSLCertificateError(

Powered by Google App Engine
This is Rietveld 408576698