Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc |
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc |
index e56c24f6fe5572997b93a6427739c0eb68c48df7..8a640016c4fcd532e3d740916e98aa8cc5e41ac0 100644 |
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc |
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc |
@@ -722,6 +722,22 @@ bool ChromeResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream( |
return false; |
} |
+bool ChromeResourceDispatcherHostDelegate::ShouldSinkResponse( |
+ net::URLRequest* request, |
+ ResourceType resource_type) { |
+ if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) |
+ return false; |
+ |
+ const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
+ if (info->GetVisibilityState() != blink::WebPageVisibilityStatePrerender) |
+ return false; |
+ |
+ // TODO: Use this when implemented. Could there be a race condition though? |
+ // return prerender::PrerenderManager::GetMode() == |
+ // prerender::PRERENDER_MODE_NOSTATE_PREFETCH; |
+ return true; |
+} |
+ |
void ChromeResourceDispatcherHostDelegate::OnStreamCreated( |
net::URLRequest* request, |
std::unique_ptr<content::StreamInfo> stream) { |