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

Issue 2807163002: [Prerender] Restore request priorities when swapped in (Closed)

Created:
3 years, 8 months ago by droger
Modified:
3 years, 8 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, tburkard+watch_chromium.org, jam, Randy Smith (Not in Mondays), gavinp+prer_chromium.org, darin-cc_chromium.org, loading-reviews_chromium.org, mmenke
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Prerender] Restore request priorities when swapped in Requests from prerendered contents have a IDLE priority, in order not to slow down visible pages. However, when the prerendered contents become visible, the request priorities were not reset back to their correct values, leading to bad prerendering performance. In this CL, the priority management for prerender requests is moved to the PrerenderResourceThrottle/PrerendereContents. The original priorities are stored in the throttle, and restored when the prerender contents swaps in. A new public function is added to ResourceDispatcherHost to update a request priority, and its implementation reuses the existing code that updates the image priorities. The prerender contents keeps a list of all the network resources that were started while the prerender is hidden. If this proves to be too large, pruning the list when responses are received should be doable. BUG=705955 Review-Url: https://codereview.chromium.org/2807163002 Cr-Commit-Position: refs/heads/master@{#464728} Committed: https://chromium.googlesource.com/chromium/src/+/d3bc6148c7f0d2695ec2ca74652d996e2c4f5a6e

Patch Set 1 #

Patch Set 2 : cleanup #

Patch Set 3 : comments #

Patch Set 4 : Rebase #

Total comments: 9

Patch Set 5 : review comments #

Patch Set 6 : Move to constructor #

Patch Set 7 : fix unittests #

Patch Set 8 : More comments #

Total comments: 8

Patch Set 9 : Matt's comments and rebase #

Patch Set 10 : Fix test: default image priority can be LOWEST or MEDIUM #

Unified diffs Side-by-side diffs Delta from patch set Stats (+294 lines, -85 lines) Patch
M chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc View 1 2 3 1 chunk +0 lines, -21 lines 0 comments Download
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 6 7 8 9 14 chunks +151 lines, -30 lines 0 comments Download
M chrome/browser/prerender/prerender_contents.h View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_contents.cc View 3 chunks +14 lines, -4 lines 0 comments Download
M chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/browser/prerender/prerender_resource_throttle.h View 1 2 3 4 3 chunks +10 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_resource_throttle.cc View 1 2 3 4 5 6 7 5 chunks +42 lines, -1 line 0 comments Download
M chrome/browser/prerender/prerender_test_utils.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/browser/prerender/prerender_test_utils.cc View 1 2 3 4 5 6 7 8 5 chunks +27 lines, -18 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/loader/resource_scheduler.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -1 line 0 comments Download
M content/browser/loader/resource_scheduler.cc View 1 2 3 4 5 2 chunks +14 lines, -2 lines 0 comments Download
M content/public/browser/resource_dispatcher_host.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 64 (43 generated)
droger
3 years, 8 months ago (2017-04-11 13:43:19 UTC) #12
Randy Smith (Not in Mondays)
I'm trying to keep my plate clear for servicification, so lateralling to csharrison@ (who probably ...
3 years, 8 months ago (2017-04-11 19:47:08 UTC) #16
Charlie Harrison
The CL looks good, but it would be nice to have this behavior covered by ...
3 years, 8 months ago (2017-04-12 12:37:26 UTC) #17
Charlie Harrison
Also note that since this throttle is after the ScheduledResourceRequest throttle, any decisions made by ...
3 years, 8 months ago (2017-04-12 12:50:33 UTC) #18
Charlie Harrison
On 2017/04/12 12:50:33, Charlie Harrison wrote: > Also note that since this throttle is after ...
3 years, 8 months ago (2017-04-12 13:02:45 UTC) #19
droger
Thanks! Addressed most comments except: - tests - moving the SetPriority to the constructor. I'll ...
3 years, 8 months ago (2017-04-12 13:20:55 UTC) #22
Charlie Harrison
https://codereview.chromium.org/2807163002/diff/60001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/2807163002/diff/60001/content/browser/loader/resource_scheduler.cc#newcode1083 content/browser/loader/resource_scheduler.cc:1083: void ResourceScheduler::ReprioritizeRequest(net::URLRequest* request, On 2017/04/12 13:20:54, droger wrote: > ...
3 years, 8 months ago (2017-04-12 13:37:04 UTC) #23
droger
Added browser tests and now changing the priority in the constructor. This required changing a ...
3 years, 8 months ago (2017-04-13 14:46:12 UTC) #33
droger
+mattcary for prerender code, in particular the browser test which is not trivial.
3 years, 8 months ago (2017-04-13 14:53:56 UTC) #35
Charlie Harrison
Hm, now I am confused how this works. PrerenderResourceThrottle gets added before the resource scheduler. ...
3 years, 8 months ago (2017-04-13 15:50:26 UTC) #38
droger
On 2017/04/13 15:50:26, Charlie Harrison wrote: > Hm, now I am confused how this works. ...
3 years, 8 months ago (2017-04-13 15:54:22 UTC) #39
Charlie Harrison
On 2017/04/13 15:54:22, droger wrote: > On 2017/04/13 15:50:26, Charlie Harrison wrote: > > Hm, ...
3 years, 8 months ago (2017-04-13 15:58:21 UTC) #40
Charlie Harrison
c/b/l LGTM but you'll need someone else for content/public.
3 years, 8 months ago (2017-04-14 00:00:26 UTC) #41
droger
On 2017/04/13 15:58:21, Charlie Harrison wrote: > On 2017/04/13 15:54:22, droger wrote: > > On ...
3 years, 8 months ago (2017-04-14 08:48:06 UTC) #42
droger
+clamy for the new public method in content/public/browser/resource_dispatcher_host.h
3 years, 8 months ago (2017-04-14 09:06:10 UTC) #43
droger
+clamy for real for new function in content/public/browser/resource_dispatcher_host.h
3 years, 8 months ago (2017-04-14 09:06:39 UTC) #45
mattcary
lgtm https://codereview.chromium.org/2807163002/diff/160001/chrome/browser/prerender/prerender_browsertest.cc File chrome/browser/prerender/prerender_browsertest.cc (right): https://codereview.chromium.org/2807163002/diff/160001/chrome/browser/prerender/prerender_browsertest.cc#newcode3305 chrome/browser/prerender/prerender_browsertest.cc:3305: GURL after_swap_url = embedded_test_server()->GetURL("/prerender/image.png"); nit: if this gets ...
3 years, 8 months ago (2017-04-14 09:28:46 UTC) #46
droger
https://codereview.chromium.org/2807163002/diff/160001/chrome/browser/prerender/prerender_browsertest.cc File chrome/browser/prerender/prerender_browsertest.cc (right): https://codereview.chromium.org/2807163002/diff/160001/chrome/browser/prerender/prerender_browsertest.cc#newcode3305 chrome/browser/prerender/prerender_browsertest.cc:3305: GURL after_swap_url = embedded_test_server()->GetURL("/prerender/image.png"); On 2017/04/14 09:28:46, mattcary wrote: ...
3 years, 8 months ago (2017-04-14 11:38:36 UTC) #49
clamy
Thanks! content/public lgtm.
3 years, 8 months ago (2017-04-14 13:46:37 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2807163002/240001
3 years, 8 months ago (2017-04-14 14:51:02 UTC) #61
commit-bot: I haz the power
3 years, 8 months ago (2017-04-14 14:57:04 UTC) #64
Message was sent while issue was closed.
Committed patchset #10 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/d3bc6148c7f0d2695ec2ca74652d...

Powered by Google App Engine
This is Rietveld 408576698