Chromium Code Reviews| Index: content/browser/loader/resource_dispatcher_host_impl.cc |
| diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc |
| index 9d02adfea06c8e5d0cbf7d655970d56b7bd54a47..15fbe7fee9f08fb4066d50541912e89be1a13f7a 100644 |
| --- a/content/browser/loader/resource_dispatcher_host_impl.cc |
| +++ b/content/browser/loader/resource_dispatcher_host_impl.cc |
| @@ -851,9 +851,24 @@ bool ResourceDispatcherHostImpl::HandleExternalProtocol(ResourceLoader* loader, |
| if (job_factory->IsHandledURL(url)) |
| return false; |
| + net::URLRequest* req = loader->request(); |
|
Thiemo Nagel
2016/03/08 18:44:35
Can you make this const?
|
| + net::NetworkDelegate* network_delegate = req->network_delegate(); |
|
Thiemo Nagel
2016/03/08 18:44:35
Can you make this const?
|
| + // get the state, if url is in blacklist, whitelist or in none of those. |
|
Thiemo Nagel
2016/03/08 18:44:35
Please start comment with capital letter.
|
| + net::NetworkDelegate::URLBlacklistState urlState = |
|
Thiemo Nagel
2016/03/08 18:44:35
const
|
| + network_delegate->GetURLBlacklistState(url); |
| + |
| + if(urlState == net::NetworkDelegate::URLBlacklistState::URL_IN_BLACKLIST) { |
|
Thiemo Nagel
2016/03/08 18:44:35
Please add a blank between "if" and "(".
|
| + // It's a link with custom scheme and it's blacklisted. |
|
Thiemo Nagel
2016/03/08 18:44:35
Please wrap comment lines at 80 characters to save
|
| + // We return false here and let it process as a normal URL. |
| + // Eventually chrome_network_delegate will see it's in the blackist and |
|
Thiemo Nagel
2016/03/08 18:44:35
blackist --> blacklist
|
| + // the user will be shown the blocked content page. |
| + return false; |
| + } |
| + |
| return delegate_->HandleExternalProtocol( |
| url, info->GetChildID(), info->GetWebContentsGetterForRequest(), |
| - info->IsMainFrame(), info->GetPageTransition(), info->HasUserGesture()); |
| + info->IsMainFrame(), info->GetPageTransition(), info->HasUserGesture(), |
| + urlState == net::NetworkDelegate::URLBlacklistState::URL_IN_WHITELIST); |
| } |
| void ResourceDispatcherHostImpl::DidStartRequest(ResourceLoader* loader) { |