Chromium Code Reviews| Index: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc |
| diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc |
| index e5a36cc6d8ca2e66af63e593511b455b1402a60d..f24882ee0d12f33ba62f12b5c70d5c9b5b317a23 100644 |
| --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc |
| +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc |
| @@ -220,7 +220,6 @@ void SendExecuteMimeTypeHandlerEvent( |
| void LaunchURL( |
| const GURL& url, |
| - int render_process_id, |
| const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter, |
| ui::PageTransition page_transition, |
| bool has_user_gesture, |
| @@ -243,15 +242,11 @@ void LaunchURL( |
| // If the URL is in whitelist, we launch it without asking the user and |
| // without any additional security checks. Since the URL is whitelisted, |
| // we assume it can be executed. |
| - // TODO(davidsac): External protocol handling needs to be |
| - // fixed for OOPIFs. See https://crbug.com/668289. |
| if (is_whitelisted) { |
| - ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck( |
| - url, render_process_id, |
| - web_contents->GetRenderViewHost()->GetRoutingID()); |
| + ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url, web_contents); |
| } else { |
| ExternalProtocolHandler::LaunchUrlWithDelegate( |
| - url, render_process_id, |
| + url, web_contents->GetRenderViewHost()->GetProcess()->GetID(), |
|
mmenke
2016/12/15 20:54:54
How can we be sure the process associated with the
Charlie Reis
2016/12/15 21:55:06
Good point. Maybe we should be passing both the p
davidsac (gone - try alexmos)
2016/12/15 22:40:23
Yes, we could keep passing the process_id to Launc
mmenke
2016/12/16 16:24:17
Why do we need the process ID for either of those
alexmos
2016/12/16 21:11:38
The process ID and routing ID are just used to get
|
| web_contents->GetRenderViewHost()->GetRoutingID(), page_transition, |
| has_user_gesture, g_external_protocol_handler_delegate); |
| } |
| @@ -566,11 +561,12 @@ bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol( |
| // content page. |
| return false; |
| } |
| - int child_id = info->GetChildID(); |
| + |
| #if BUILDFLAG(ENABLE_EXTENSIONS) |
| // External protocols are disabled for guests. An exception is made for the |
| // "mailto" protocol, so that pages that utilize it work properly in a |
| // WebView. |
| + int child_id = info->GetChildID(); |
| ChromeNavigationUIData* navigation_data = |
| static_cast<ChromeNavigationUIData*>(info->GetNavigationUIData()); |
| if ((extensions::WebViewRendererState::GetInstance()->IsGuest(child_id) || |
| @@ -592,8 +588,7 @@ bool ChromeResourceDispatcherHostDelegate::HandleExternalProtocol( |
| url_state == policy::URLBlacklist::URLBlacklistState::URL_IN_WHITELIST; |
| BrowserThread::PostTask( |
| BrowserThread::UI, FROM_HERE, |
| - base::Bind(&LaunchURL, url, child_id, |
| - info->GetWebContentsGetterForRequest(), |
| + base::Bind(&LaunchURL, url, info->GetWebContentsGetterForRequest(), |
| info->GetPageTransition(), info->HasUserGesture(), |
| is_whitelisted)); |
| return true; |