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

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

Issue 9406001: Factor out ResourceDispatcherHost dependent code around SSLManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase for retry Created 8 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
Index: content/browser/renderer_host/resource_dispatcher_host_impl.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.cc b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
index 562d1419db6dd9c6b77105aceef46784ff04a510..f25227b7c136b412410ea573031defc2bd1129e6 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
@@ -1492,7 +1492,16 @@ void ResourceDispatcherHostImpl::OnSSLCertificateError(
const net::SSLInfo& ssl_info,
bool is_hsts_host) {
DCHECK(request);
- SSLManager::OnSSLCertificateError(request, ssl_info, is_hsts_host);
+ ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request);
+ DCHECK(info);
+ GlobalRequestID request_id(info->GetChildID(), info->GetRequestID());
+ int render_process_id;
+ int render_view_id;
+ if(!info->GetAssociatedRenderView(&render_process_id, &render_view_id))
+ NOTREACHED();
+ SSLManager::OnSSLCertificateError(this, request_id, info->GetResourceType(),
+ request->url(), render_process_id, render_view_id, ssl_info,
+ is_hsts_host);
}
void ResourceDispatcherHostImpl::OnResponseStarted(net::URLRequest* request) {
@@ -1947,6 +1956,39 @@ void ResourceDispatcherHostImpl::CallResponseCompleted(int child_id,
ResponseCompleted(i->second);
}
+// SSLErrorHandler::Delegate ---------------------------------------------------
+
+void ResourceDispatcherHostImpl::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) << "CancelSSLRequest() url: " << request->url().spec();
+ // TODO(toyoshim): Following method names SimulateSSLError() and
+ // SimulateError() looks inconsistent with other Cancel methods.
+ if (ssl_info)
+ request->SimulateSSLError(error, *ssl_info);
+ else
+ request->SimulateError(error);
+}
+
+void ResourceDispatcherHostImpl::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) << "ContinueSSLRequest() url: " << request->url().spec();
+ request->ContinueDespiteLastError();
+}
+
void ResourceDispatcherHostImpl::OnUserGesture(TabContents* tab) {
last_user_gesture_time_ = TimeTicks::Now();
}
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host_impl.h ('k') | content/browser/ssl/ssl_cert_error_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698