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

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

Issue 9406001: Factor out ResourceDispatcherHost dependent code around SSLManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reflects darin's review Created 8 years, 10 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: content/browser/renderer_host/resource_dispatcher_host.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index 10b3bf8f436d836715ef83692298d49a7c0e4a43..566d9005a3f3e2bac5aa5a9e88bb620cc8514721 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -380,6 +380,35 @@ ResourceDispatcherHost::CreateResourceHandlerForDownload(
return handler;
}
+void ResourceDispatcherHost::CancelSSLRequest(
+ const GlobalRequestID& id,
+ int error,
+ const net::SSLInfo* ssl_info) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ net::URLRequest* request = GetURLRequest(id);
+ // The request can be NULL if it was cancelled by the renderer (as the
+ // request of the user navigating to a new page from the location bar).
+ if (!request || !request->is_pending())
+ return;
+ DVLOG(1) << "CancelRequestForInstance() url: " << request->url().spec();
darin (slow to review) 2012/03/09 20:49:03 nit: the log comment seems to implicate a function
Takashi Toyoshima 2012/03/10 00:24:44 Oops, sorry for mistakes. Fixed.
+ if (ssl_info)
+ request->SimulateSSLError(error, *ssl_info);
darin (slow to review) 2012/03/09 20:49:03 the ResourceDispatcherHost has so many other Cance
Takashi Toyoshima 2012/03/10 00:24:44 I'm looking into url_request.h. It has Start(), Ca
+ else
+ request->SimulateError(error);
+}
+
+void ResourceDispatcherHost::ContinueSSLRequest(
+ const GlobalRequestID& id) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ net::URLRequest* request = GetURLRequest(id);
+ // The request can be NULL if it was cancelled by the renderer (as the
+ // request of the user navigating to a new page from the location bar).
+ if (!request)
+ return;
+ DVLOG(1) << "ContinueRequestForInstance() url: " << request->url().spec();
Takashi Toyoshima 2012/03/10 00:24:44 Same mistake here. Done.
+ request->ContinueDespiteLastError();
+}
+
void ResourceDispatcherHost::SetRequestInfo(
net::URLRequest* request,
ResourceDispatcherHostRequestInfo* info) {
@@ -1420,7 +1449,16 @@ void ResourceDispatcherHost::OnSSLCertificateError(
const net::SSLInfo& ssl_info,
bool is_hsts_host) {
DCHECK(request);
- SSLManager::OnSSLCertificateError(this, request, ssl_info, is_hsts_host);
+ ResourceDispatcherHostRequestInfo* info = InfoForRequest(request);
+ DCHECK(info);
+ GlobalRequestID request_id(info->child_id(), info->request_id());
+ int render_process_id;
+ int render_view_id;
+ if(!RenderViewForRequest(request, &render_process_id, &render_view_id))
darin (slow to review) 2012/03/09 20:49:03 since you already have |info|, please just use the
Takashi Toyoshima 2012/03/10 00:24:44 Applied with rebase. Done.
+ NOTREACHED();
+ SSLManager::OnSSLCertificateError(this, request_id, info->resource_type(),
+ request->url(), render_process_id, render_view_id, ssl_info,
+ is_hsts_host);
}
bool ResourceDispatcherHost::CanGetCookies(

Powered by Google App Engine
This is Rietveld 408576698