Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2262183002: [NoStatePrefetch] Do not send responses to renderer in prefetch mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefetchProto
Patch Set: comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 847f0fd5f9d82e6dd5d54a4e4db3d75360c35fde..32d18ef8250622c129fe8fb58b8917f7318255a3 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1638,12 +1638,16 @@ ResourceDispatcherHostImpl::CreateResourceHandler(
}
}
+ const bool detached =
mmenke 2016/08/22 14:08:23 style: const is generally not used for stack vari
+ delegate()->ShouldSinkResponse(request, request_data.resource_type);
mmenke 2016/08/22 14:08:23 sink / detach: Should use consistent naming.
+
// Prefetches and <a ping> requests outlive their child process.
- if (!sync_result && IsDetachableResourceType(request_data.resource_type)) {
+ if (detached ||
+ (!sync_result && IsDetachableResourceType(request_data.resource_type))) {
mmenke 2016/08/22 14:08:22 Should we instead introduce a resource type for th
mmenke 2016/08/22 14:08:23 BUG: The sync_result check should cover the case
mmenke 2016/08/22 14:11:00 Moreover, do we really want the embedder controlli
handler.reset(new DetachableResourceHandler(
request,
base::TimeDelta::FromMilliseconds(kDefaultDetachableCancelDelayMs),
- std::move(handler)));
+ detached ? nullptr : std::move(handler)));
}
// PlzNavigate: If using --enable-browser-side-navigation, the

Powered by Google App Engine
This is Rietveld 408576698