Chromium Code Reviews| 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..f11f48d57445fde866fb24991c32e6f3c29e6a75 100644 |
| --- a/content/browser/renderer_host/resource_dispatcher_host.cc |
| +++ b/content/browser/renderer_host/resource_dispatcher_host.cc |
| @@ -380,6 +380,62 @@ ResourceDispatcherHost::CreateResourceHandlerForDownload( |
| return handler; |
| } |
| +ResourceType::Type ResourceDispatcherHost::ResourceTypeForSSLRequest( |
| + const GlobalRequestID& id) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| + net::URLRequest* request = GetURLRequest(id); |
| + DCHECK(request); |
| + ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); |
| + DCHECK(info); |
| + return info->resource_type(); |
| +} |
| + |
| +const GURL& ResourceDispatcherHost::URLForSSLRequest( |
| + const GlobalRequestID& id) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| + net::URLRequest* request = GetURLRequest(id); |
| + DCHECK(request); |
| + return request->url(); |
| +} |
| + |
| +bool ResourceDispatcherHost::RenderViewForSSLRequest( |
| + const GlobalRequestID& id, |
| + int* render_process_host_id, |
| + int* render_view_host_id) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| + return RenderViewForRequest( |
| + GetURLRequest(id), render_process_host_id, render_view_host_id); |
| +} |
| + |
| +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()) |
|
darin (slow to review)
2012/02/28 23:36:44
NOTE: The request switches to no longer being pen
Takashi Toyoshima
2012/02/29 00:15:24
Can I keep this as is for now?
Do you mean pending
|
| + return; |
| + DVLOG(1) << "CancelRequestForInstance() url: " << request->url().spec(); |
| + if (ssl_info) |
| + request->SimulateSSLError(error, *ssl_info); |
| + 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(); |
| + request->ContinueDespiteLastError(); |
| +} |
| + |
| void ResourceDispatcherHost::SetRequestInfo( |
| net::URLRequest* request, |
| ResourceDispatcherHostRequestInfo* info) { |
| @@ -1420,7 +1476,10 @@ 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()); |
| + SSLManager::OnSSLCertificateError(this, request_id, ssl_info, is_hsts_host); |
| } |
| bool ResourceDispatcherHost::CanGetCookies( |