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(); |
} |