| 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 97cb50e63cb009c469b17f04e21d99a5de1ca62e..e4589d63e23a7ad3ff07783bdf450e2cebb5beba 100644
|
| --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
|
| @@ -253,9 +253,15 @@ void LaunchURL(
|
| #if !defined(DISABLE_NACL)
|
| void AppendComponentUpdaterThrottles(
|
| net::URLRequest* request,
|
| + const ResourceRequestInfo& info,
|
| content::ResourceContext* resource_context,
|
| ResourceType resource_type,
|
| ScopedVector<content::ResourceThrottle>* throttles) {
|
| + bool is_prerendering =
|
| + info.GetVisibilityState() == blink::WebPageVisibilityStatePrerender;
|
| + if (is_prerendering)
|
| + return;
|
| +
|
| const char* crx_id = NULL;
|
| component_updater::ComponentUpdateService* cus =
|
| g_browser_process->component_updater();
|
| @@ -422,6 +428,14 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
|
| safe_browsing_->OnResourceRequest(request);
|
|
|
| const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request);
|
| +
|
| +// The lowering of request priority causes issues with scheduling, since
|
| +// content::ResourceScheduler uses it to delay and throttle requests. This is
|
| +// disabled only on Android, as the prerenders are not likely to compete with
|
| +// page loads there.
|
| +// See https://crbug.com/652746 for details.
|
| +// TODO(lizeb,droger): Fix the issue on all platforms.
|
| +#if !defined(OS_ANDROID)
|
| bool is_prerendering =
|
| info->GetVisibilityState() == blink::WebPageVisibilityStatePrerender;
|
| if (is_prerendering) {
|
| @@ -433,6 +447,7 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
|
| request->SetPriority(net::IDLE);
|
| }
|
| }
|
| +#endif // OS_ANDROID
|
|
|
| ProfileIOData* io_data = ProfileIOData::FromResourceContext(
|
| resource_context);
|
| @@ -482,13 +497,9 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
|
| resource_type,
|
| throttles);
|
| #if !defined(DISABLE_NACL)
|
| - if (!is_prerendering) {
|
| - AppendComponentUpdaterThrottles(request,
|
| - resource_context,
|
| - resource_type,
|
| - throttles);
|
| - }
|
| -#endif
|
| + AppendComponentUpdaterThrottles(request, *info, resource_context,
|
| + resource_type, throttles);
|
| +#endif // !defined(DISABLE_NACL)
|
|
|
| if (io_data->resource_prefetch_predictor_observer()) {
|
| io_data->resource_prefetch_predictor_observer()->OnRequestStarted(
|
|
|