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

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

Issue 25772002: Allows prefetch requests to live beyond the renderer by delaying (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Possible AsyncResourceHandler support for detached resources. Created 7 years, 2 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/async_resource_handler.cc
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
index f007a417fb8ffe997e20c439506d9f8a6834c367..4f196d9484ccaa9a6e2e5c98226a591569dddc7a 100644
--- a/content/browser/loader/async_resource_handler.cc
+++ b/content/browser/loader/async_resource_handler.cc
@@ -150,7 +150,7 @@ bool AsyncResourceHandler::OnRequestRedirected(int request_id,
const ResourceRequestInfoImpl* info =
ResourceRequestInfoImpl::ForRequest(request_);
if (!info->filter())
- return false;
+ return info->is_detachable();
mmenke 2013/10/17 18:33:48 I think all of these need a comment along the line
jkarlin2 2013/10/24 15:33:11 Done.
*defer = did_defer_ = true;
@@ -178,7 +178,7 @@ bool AsyncResourceHandler::OnResponseStarted(int request_id,
const ResourceRequestInfoImpl* info =
ResourceRequestInfoImpl::ForRequest(request_);
if (!info->filter())
- return false;
+ return info->is_detachable();
if (rdh_->delegate()) {
rdh_->delegate()->OnResponseStarted(
@@ -249,6 +249,10 @@ bool AsyncResourceHandler::OnReadCompleted(int request_id, int bytes_read,
const ResourceRequestInfoImpl* info =
ResourceRequestInfoImpl::ForRequest(request_);
+ if (info->is_detachable()) {
mmenke 2013/10/17 18:33:48 Again, comment that renderers don't care about rea
jkarlin2 2013/10/24 15:33:11 Done.
+ buffer_->RecycleLeastRecentlyAllocated();
+ return true;
+ }
if (!info->filter())
return false;
@@ -312,7 +316,7 @@ bool AsyncResourceHandler::OnResponseCompleted(
const ResourceRequestInfoImpl* info =
ResourceRequestInfoImpl::ForRequest(request_);
if (!info->filter())
- return false;
+ return info->is_detachable();
mmenke 2013/10/17 18:33:48 Hmm....Wonder about returning false in this case i
jkarlin2 2013/10/24 15:33:11 Noted. It's unclear to me. The loader seems to in
// If we crash here, figure out what URL the renderer was requesting.
// http://crbug.com/107692
« no previous file with comments | « no previous file | content/browser/loader/detached_resource_handler.h » ('j') | content/browser/loader/detached_resource_handler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698