Index: chrome/browser/renderer_host/resource_dispatcher_host.cc |
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc |
index 7e53a5e75a7fb4fe0b45dc8ea47a4243e9099053..92e851422a3aacf3c8f52cabf648163b63c5631a 100644 |
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc |
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc |
@@ -125,6 +125,10 @@ bool ShouldServiceRequest(ChildProcessInfo::ProcessType process_type, |
if (process_type == ChildProcessInfo::PLUGIN_PROCESS) |
return true; |
+ if (request_data.resource_type == ResourceType::PREFETCH && |
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisablePrefetch)) |
+ return false; |
+ |
ChildProcessSecurityPolicy* policy = |
ChildProcessSecurityPolicy::GetInstance(); |
@@ -1837,12 +1841,17 @@ net::RequestPriority ResourceDispatcherHost::DetermineRequestPriority( |
case ResourceType::SHARED_WORKER: |
return net::LOW; |
- // Images are the lowest priority because they typically do not block |
+ // Images are the "lowest" priority because they typically do not block |
// downloads or rendering and most pages have some useful content without |
// them. |
case ResourceType::IMAGE: |
return net::LOWEST; |
+ // Prefetches are at a lower priority than even LOWEST, since they |
+ // are not even required for rendering of the current page. |
+ case ResourceType::PREFETCH: |
+ return net::IDLE; |
+ |
default: |
// When new resource types are added, their priority must be considered. |
NOTREACHED(); |