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

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

Issue 131090: Add a temporary command-line switch --auto-ssl-client-auth for... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Warn about privacy issues 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
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/resource_dispatcher_host.cc
===================================================================
--- chrome/browser/renderer_host/resource_dispatcher_host.cc (revision 18735)
+++ chrome/browser/renderer_host/resource_dispatcher_host.cc (working copy)
@@ -8,6 +8,7 @@
#include <vector>
+#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/stl_util-inl.h"
@@ -33,6 +34,7 @@
#include "chrome/browser/renderer_host/sync_resource_handler.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/render_messages.h"
#include "net/base/auth.h"
@@ -40,6 +42,7 @@
#include "net/base/load_flags.h"
#include "net/base/mime_util.h"
#include "net/base/net_errors.h"
+#include "net/base/ssl_cert_request_info.h"
#include "net/url_request/url_request.h"
#include "webkit/glue/webappcachecontext.h"
@@ -108,7 +111,8 @@
if (process_type == ChildProcessInfo::PLUGIN_PROCESS)
return true;
- ChildProcessSecurityPolicy* policy = ChildProcessSecurityPolicy::GetInstance();
+ ChildProcessSecurityPolicy* policy =
+ ChildProcessSecurityPolicy::GetInstance();
// Check if the renderer is permitted to request the requested URL.
if (!policy->CanRequestURL(process_id, request_data.url)) {
@@ -620,9 +624,9 @@
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.
- // TODO: removing the request in this manner means we're not notifying
- // anyone. We need make sure the event handlers and others are notified
- // so that everything is cleaned up properly.
+ // TODO(sky): removing the request in this manner means we're not
+ // notifying anyone. We need make sure the event handlers and others are
+ // notified so that everything is cleaned up properly.
RemovePendingRequest(info->process_id, info->request_id);
} else {
i->second->Cancel();
@@ -846,6 +850,19 @@
info->login_handler = CreateLoginPrompt(auth_info, request, ui_loop_);
}
+void ResourceDispatcherHost::OnCertificateRequested(
+ URLRequest* request,
+ 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);
+}
+
void ResourceDispatcherHost::OnSSLCertificateError(
URLRequest* request,
int cert_error,
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698