Chromium Code Reviews| 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 7d1e4e361ca2511b9fb0fa9f07646c08c0617e71..5f2f3d976cdc91d7a9199f4b81e8e7fb111cae3a 100644 |
| --- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
| +++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
| @@ -1478,7 +1478,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) { |
| @@ -1933,6 +1942,38 @@ void ResourceDispatcherHostImpl::CallResponseCompleted(int child_id, |
| ResponseCompleted(i->second); |
| } |
| +// SSLErrorHandler::Delegate --------------------------------------------------- |
|
darin (slow to review)
2012/03/12 22:10:16
nit: add a new line below here
Takashi Toyoshima
2012/03/12 22:13:18
Done.
|
| +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(); |
| } |