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

Issue 25772002: Allows prefetch requests to live beyond the renderer by delaying (Closed)

Created:
7 years, 2 months ago by jkarlin2
Modified:
7 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, cbentzel, tonyg
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Allows prefetch and other detachable requests to live beyond the renderer by delaying LinkLoader::Cancel requests by a few seconds and through the use of a new DetachedResourceHandler. The general concept of a detachable resource should be useful for <a ping> as well. BUG=286186 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=231910

Patch Set 1 #

Patch Set 2 : Added a delay-prefetch-cancellation flag so that the delay is default off. #

Patch Set 3 : Change delay from 3s to 60s for initial timing. Obey the browser process when it wants to cancel. #

Patch Set 4 : Change delay from 3s to 60s for initial timing. Obey the browser process when it wants to cancel. #

Total comments: 11

Patch Set 5 : Addressed mmenke's comments. Fixed a unit test breakage caused by not delaying cancel when not cal… #

Patch Set 6 : Cancellation delay now settable at command line #

Total comments: 11

Patch Set 7 : Remove unnecessary timer check. #

Total comments: 2

Patch Set 8 : Rebase. Sorry! #

Patch Set 9 : Adds a DetachedResourceHandler. #

Patch Set 10 : Added DetachableType function for generality. #

Total comments: 38

Patch Set 11 : Addressing great comments from mmenke. #

Total comments: 18

Patch Set 12 : Asanka fixes. Made more general for future <a ping> support. #

Total comments: 3

Patch Set 13 : Possible AsyncResourceHandler support for detached resources. #

Total comments: 29

Patch Set 14 : Addressed all comments. Lots of tests. Using AsyncResourceHandler. #

Total comments: 22

Patch Set 15 : Addressed mmenke's comments #

Total comments: 7

Patch Set 16 : Created a detached state. Data is sent to renderer until detached. Fixed up tests. #

Total comments: 4

Patch Set 17 : Addressed simonjam's comments. #

Patch Set 18 : Rebased. Changed from 60 second timeout to 30 seconds. #

Patch Set 19 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+620 lines, -168 lines) Patch
M content/browser/loader/async_resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +24 lines, -9 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 8 chunks +38 lines, -20 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 40 chunks +458 lines, -137 lines 0 comments Download
M content/browser/loader/resource_loader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +12 lines, -0 lines 0 comments Download
M content/browser/loader/resource_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +27 lines, -0 lines 0 comments Download
M content/browser/loader/resource_request_info_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +19 lines, -0 lines 0 comments Download
M content/browser/loader/resource_request_info_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +4 lines, -0 lines 0 comments Download
M content/browser/loader/resource_scheduler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M net/url_request/url_request_test_job.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +8 lines, -2 lines 0 comments Download
M net/url_request/url_request_test_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +25 lines, -0 lines 0 comments Download

Messages

Total messages: 58 (0 generated)
jkarlin2
7 years, 2 months ago (2013-10-02 18:42:19 UTC) #1
jkarlin2
Ping?
7 years, 2 months ago (2013-10-03 20:44:28 UTC) #2
mmenke
Drive-by comments. https://codereview.chromium.org/25772002/diff/12001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/12001/content/browser/loader/async_resource_handler.cc#newcode395 content/browser/loader/async_resource_handler.cc:395: CHECK(!(detached_reads_ && detached_reads)); Unless there's some reason ...
7 years, 2 months ago (2013-10-07 19:16:23 UTC) #3
mmenke
https://codereview.chromium.org/25772002/diff/12001/content/browser/loader/resource_dispatcher_host_unittest.cc File content/browser/loader/resource_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/25772002/diff/12001/content/browser/loader/resource_dispatcher_host_unittest.cc#newcode617 content/browser/loader/resource_dispatcher_host_unittest.cc:617: const GURL& url); On 2013/10/07 19:16:24, mmenke wrote: > ...
7 years, 2 months ago (2013-10-07 19:28:28 UTC) #4
jkarlin2
https://codereview.chromium.org/25772002/diff/12001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/12001/content/browser/loader/async_resource_handler.cc#newcode395 content/browser/loader/async_resource_handler.cc:395: CHECK(!(detached_reads_ && detached_reads)); On 2013/10/07 19:16:24, mmenke wrote: > ...
7 years, 2 months ago (2013-10-08 11:53:01 UTC) #5
mmenke
https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc#newcode182 content/browser/loader/async_resource_handler.cc:182: return false; So we still cancel prefetches if the ...
7 years, 2 months ago (2013-10-08 14:50:53 UTC) #6
jkarlin2
https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc#newcode182 content/browser/loader/async_resource_handler.cc:182: return false; On 2013/10/08 14:50:54, mmenke wrote: > So ...
7 years, 2 months ago (2013-10-09 14:44:33 UTC) #7
mmenke
https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc#newcode182 content/browser/loader/async_resource_handler.cc:182: return false; On 2013/10/09 14:44:33, jkarlin wrote: > On ...
7 years, 2 months ago (2013-10-09 14:59:07 UTC) #8
cbentzel
[Sorry if I'm bringing up a design discussion we've already had...] How is <a ping> ...
7 years, 2 months ago (2013-10-09 15:46:23 UTC) #9
mmenke
On 2013/10/09 15:46:23, cbentzel wrote: > [Sorry if I'm bringing up a design discussion we've ...
7 years, 2 months ago (2013-10-09 15:52:41 UTC) #10
gavinp
On 2013/10/09 15:52:41, mmenke wrote: > On 2013/10/09 15:46:23, cbentzel wrote: > > [Sorry if ...
7 years, 2 months ago (2013-10-09 16:16:22 UTC) #11
mmenke
On 2013/10/09 16:16:22, gavinp wrote: > On 2013/10/09 15:52:41, mmenke wrote: > > On 2013/10/09 ...
7 years, 2 months ago (2013-10-09 16:22:22 UTC) #12
jkarlin2
Yes, as noted in the bug, we need the ResourceScheduler. On Wed, Oct 9, 2013 ...
7 years, 2 months ago (2013-10-09 16:55:39 UTC) #13
jkarlin2
https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc#newcode182 content/browser/loader/async_resource_handler.cc:182: return false; On 2013/10/09 14:59:08, mmenke wrote: > On ...
7 years, 2 months ago (2013-10-09 17:28:29 UTC) #14
gavinp
Flushing nits, as it sounds like a refactoring is in the pipe. https://codereview.chromium.org/25772002/diff/33001/content/browser/loader/async_resource_handler.h File content/browser/loader/async_resource_handler.h ...
7 years, 2 months ago (2013-10-09 18:05:41 UTC) #15
mmenke
On 2013/10/09 17:28:29, jkarlin wrote: > https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc > File content/browser/loader/async_resource_handler.cc (right): > > https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc#newcode182 > ...
7 years, 2 months ago (2013-10-09 19:38:44 UTC) #16
jkarlin2
On 2013/10/09 19:38:44, mmenke wrote: > On 2013/10/09 17:28:29, jkarlin wrote: > > > https://codereview.chromium.org/25772002/diff/23001/content/browser/loader/async_resource_handler.cc ...
7 years, 2 months ago (2013-10-10 17:16:11 UTC) #17
mmenke
On 2013/10/10 17:16:11, jkarlin wrote: > On 2013/10/09 19:38:44, mmenke wrote: > > On 2013/10/09 ...
7 years, 2 months ago (2013-10-10 17:18:05 UTC) #18
mmenke
Did you look into how downloads handle this case? My main concerns are the potential ...
7 years, 2 months ago (2013-10-11 16:39:07 UTC) #19
jkarlin2
+asanka as reviewer. https://codereview.chromium.org/25772002/diff/54001/content/browser/loader/async_resource_handler.h File content/browser/loader/async_resource_handler.h (right): https://codereview.chromium.org/25772002/diff/54001/content/browser/loader/async_resource_handler.h#newcode69 content/browser/loader/async_resource_handler.h:69: void DetachReads(); On 2013/10/11 16:39:07, mmenke ...
7 years, 2 months ago (2013-10-11 18:37:04 UTC) #20
asanka
How close would we be to DetachedResourceHandler if AsyncResourceHandler just didn't send data back for ...
7 years, 2 months ago (2013-10-11 21:01:20 UTC) #21
jkarlin2
On Fri, Oct 11, 2013 at 5:01 PM, <asanka@chromium.org> wrote: > How close would we ...
7 years, 2 months ago (2013-10-11 22:46:36 UTC) #22
cbentzel
Just one little nit (didn't do full review): I'd prefer not to add a command ...
7 years, 2 months ago (2013-10-13 13:06:14 UTC) #23
cbentzel
Just one little nit (didn't do full review): I'd prefer not to add a command ...
7 years, 2 months ago (2013-10-13 13:06:16 UTC) #24
jkarlin2
cbentzel: In terms of the flag, it'll be useful for field trials to determine a ...
7 years, 2 months ago (2013-10-14 14:30:00 UTC) #25
asanka
Nits only. However, I'm a bit apprehensive about the new resource handler due to code ...
7 years, 2 months ago (2013-10-14 21:06:49 UTC) #26
mmenke
On 2013/10/14 21:06:49, asanka wrote: > Nits only. > > However, I'm a bit apprehensive ...
7 years, 2 months ago (2013-10-14 21:22:32 UTC) #27
mmenke
On 2013/10/14 21:22:32, mmenke wrote: > On 2013/10/14 21:06:49, asanka wrote: > > Nits only. ...
7 years, 2 months ago (2013-10-14 21:24:23 UTC) #28
jkarlin2
I can go either way in terms of the new handler vs sprinkling in changes ...
7 years, 2 months ago (2013-10-15 21:38:45 UTC) #29
asanka
On 2013/10/15 21:38:45, jkarlin wrote: > I can go either way in terms of the ...
7 years, 2 months ago (2013-10-15 22:16:43 UTC) #30
jkarlin2
I've uploaded a new AsyncResourceHandler with 4 minor changes that supports detached resources. What do ...
7 years, 2 months ago (2013-10-16 01:53:58 UTC) #31
asanka
Matt: WDYT? The code is okay, but I see the problem with maintenance overhead: any ...
7 years, 2 months ago (2013-10-16 20:42:36 UTC) #32
mmenke
On 2013/10/16 20:42:36, asanka wrote: > Matt: WDYT? The code is okay, but I see ...
7 years, 2 months ago (2013-10-16 21:04:06 UTC) #33
mmenke
Meant to get these to you earlier. https://codereview.chromium.org/25772002/diff/99001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/99001/content/browser/loader/async_resource_handler.cc#newcode141 content/browser/loader/async_resource_handler.cc:141: return false; ...
7 years, 2 months ago (2013-10-17 18:33:47 UTC) #34
jkarlin2
Okay, I'm going to go with the AsyncResourceHandler updates, add some tests, and clean everything ...
7 years, 2 months ago (2013-10-17 18:37:29 UTC) #35
jkarlin2
https://codereview.chromium.org/25772002/diff/99001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/99001/content/browser/loader/async_resource_handler.cc#newcode141 content/browser/loader/async_resource_handler.cc:141: return false; On 2013/10/16 20:42:37, asanka wrote: > Should ...
7 years, 2 months ago (2013-10-24 15:33:11 UTC) #36
mmenke
https://codereview.chromium.org/25772002/diff/99001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/25772002/diff/99001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode427 content/browser/loader/resource_dispatcher_host_impl.cc:427: (*i)->GetRequestInfo()->is_detachable() || On 2013/10/24 15:33:11, jkarlin wrote: > I ...
7 years, 2 months ago (2013-10-24 20:27:20 UTC) #37
jkarlin2
https://codereview.chromium.org/25772002/diff/99001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/25772002/diff/99001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode427 content/browser/loader/resource_dispatcher_host_impl.cc:427: (*i)->GetRequestInfo()->is_detachable() || At this point the renderers (and their ...
7 years, 1 month ago (2013-10-25 14:10:20 UTC) #38
mmenke
LGTM. Make sure you get the signoff of someone more familiar with this stuff than ...
7 years, 1 month ago (2013-10-25 14:57:50 UTC) #39
mmenke
https://codereview.chromium.org/25772002/diff/112001/content/browser/loader/resource_dispatcher_host_unittest.cc File content/browser/loader/resource_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/25772002/diff/112001/content/browser/loader/resource_dispatcher_host_unittest.cc#newcode1305 content/browser/loader/resource_dispatcher_host_unittest.cc:1305: TEST_F(ResourceDispatcherHostTest, TestProcessCancelDetachableTimesOut) { On 2013/10/25 14:57:51, mmenke wrote: > ...
7 years, 1 month ago (2013-10-25 15:17:54 UTC) #40
jkarlin2
https://codereview.chromium.org/25772002/diff/112001/content/browser/loader/resource_loader.cc File content/browser/loader/resource_loader.cc (right): https://codereview.chromium.org/25772002/diff/112001/content/browser/loader/resource_loader.cc#newcode215 content/browser/loader/resource_loader.cc:215: detachable_delay_ms_ = 60000; I originally had it at seconds. ...
7 years, 1 month ago (2013-10-25 18:24:53 UTC) #41
jkarlin2
https://codereview.chromium.org/25772002/diff/112001/content/browser/loader/resource_loader.cc File content/browser/loader/resource_loader.cc (right): https://codereview.chromium.org/25772002/diff/112001/content/browser/loader/resource_loader.cc#newcode215 content/browser/loader/resource_loader.cc:215: detachable_delay_ms_ = 60000; I meant to say that I ...
7 years, 1 month ago (2013-10-25 18:28:21 UTC) #42
James Simonsen
https://codereview.chromium.org/25772002/diff/192001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/25772002/diff/192001/content/browser/loader/async_resource_handler.cc#newcode255 content/browser/loader/async_resource_handler.cc:255: // Don't send any data for detachable requests. On ...
7 years, 1 month ago (2013-10-26 02:24:59 UTC) #43
jkarlin2
There is now a distinct "detached" state and the AsyncResourceHandler acts normally for detachable resources ...
7 years, 1 month ago (2013-10-28 19:25:40 UTC) #44
James Simonsen
lgtm https://codereview.chromium.org/25772002/diff/372001/content/browser/loader/resource_dispatcher_host_unittest.cc File content/browser/loader/resource_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/25772002/diff/372001/content/browser/loader/resource_dispatcher_host_unittest.cc#newcode2388 content/browser/loader/resource_dispatcher_host_unittest.cc:2388: ASSERT_LT(0, data_length); These should probably be EXPECTs. Basically, ...
7 years, 1 month ago (2013-10-28 21:16:40 UTC) #45
jkarlin2
https://codereview.chromium.org/25772002/diff/372001/content/browser/loader/resource_dispatcher_host_unittest.cc File content/browser/loader/resource_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/25772002/diff/372001/content/browser/loader/resource_dispatcher_host_unittest.cc#newcode2388 content/browser/loader/resource_dispatcher_host_unittest.cc:2388: ASSERT_LT(0, data_length); On 2013/10/28 21:16:40, James Simonsen wrote: > ...
7 years, 1 month ago (2013-10-29 11:48:58 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@google.com/25772002/552001
7 years, 1 month ago (2013-10-29 15:08:46 UTC) #47
commit-bot: I haz the power
Failed to apply patch for content/browser/loader/async_resource_handler.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 1 month ago (2013-10-29 15:08:50 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@google.com/25772002/592001
7 years, 1 month ago (2013-10-29 17:43:26 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@google.com/25772002/592001
7 years, 1 month ago (2013-10-30 11:02:42 UTC) #50
commit-bot: I haz the power
Failed to apply patch for content/browser/loader/resource_loader.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 1 month ago (2013-10-30 11:02:46 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@google.com/25772002/652001
7 years, 1 month ago (2013-10-30 12:22:23 UTC) #52
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 1 month ago (2013-10-30 12:44:33 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@google.com/25772002/652001
7 years, 1 month ago (2013-10-30 12:58:41 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@google.com/25772002/652001
7 years, 1 month ago (2013-10-30 13:15:28 UTC) #55
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=215738
7 years, 1 month ago (2013-10-30 17:42:08 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jkarlin@google.com/25772002/652001
7 years, 1 month ago (2013-10-30 17:48:33 UTC) #57
commit-bot: I haz the power
7 years, 1 month ago (2013-10-30 20:31:57 UTC) #58
Message was sent while issue was closed.
Change committed as 231910

Powered by Google App Engine
This is Rietveld 408576698