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 #Messages
Total messages: 64 (43 generated)
|