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

Issue 11270027: Add a ResourceScheduler to ResourceDispatcherHost. (Closed)

Created:
8 years, 2 months ago by James Simonsen
Modified:
7 years, 10 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

Add a ResourceScheduler to ResourceDispatcherHost. For this CL, ResourceScheduler mimicks WebKit's ResourceLoadScheduler. That means only JS and CSS are loaded before first paint. Eventually, we will improve it to do things like: - Lower priority of background tabs. - Preconnect for low priority resources. - Dynamically adapt scheduling to the user's connection. - Experiment with other scheduling ideas. BUG=157763 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=183382

Patch Set 1 #

Total comments: 10

Patch Set 2 : Manage ownership with handles #

Total comments: 19

Patch Set 3 : Track background requests #

Total comments: 25

Patch Set 4 : Almost no linked_ptrs #

Total comments: 2

Patch Set 5 : Rebase in loader/ #

Patch Set 6 : Resilient to crashing renderers #

Total comments: 6

Patch Set 7 : Rebase #

Patch Set 8 : Treat synchronous requests as high priority #

Patch Set 9 : Fix typo #

Total comments: 8

Patch Set 10 : Remove all linked_ptrs #

Total comments: 13

Patch Set 11 : Use ResourceThrottle #

Total comments: 4

Patch Set 12 : Fix threading #

Patch Set 13 : Handle duplicate RenderViewReady messages #

Total comments: 10

Patch Set 14 : Remove OnCreate #

Patch Set 15 : Handle paint w/o navigation #

Patch Set 16 : Use OnNewPage #

Patch Set 17 : Track navigations instead of renderers #

Patch Set 18 : Add OnViewCreated to RenderWidgetHelper #

Patch Set 19 : Track navigations using MRUCache #

Patch Set 20 : Fix Win build #

Total comments: 14

Patch Set 21 : Handle reentrancy #

Patch Set 22 : DCHECK that queues are empty at destruction #

Patch Set 23 : Fix compile #

Patch Set 24 : Rebase & reupload #

Patch Set 25 : Use new WebKit signals #

Total comments: 10

Patch Set 26 : Move construction & destruction to IO thread #

Patch Set 27 : Rebase #

Patch Set 28 : Remove unused variable #

Patch Set 29 : Move Client back to .h -- broke Win #

Unified diffs Side-by-side diffs Delta from patch set Stats (+779 lines, -40 lines) Patch
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 18 19 20 21 22 23 24 25 4 chunks +8 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 18 19 20 21 22 23 24 25 6 chunks +18 lines, -35 lines 0 comments Download
A content/browser/loader/resource_scheduler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 1 chunk +113 lines, -0 lines 0 comments Download
A content/browser/loader/resource_scheduler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 1 chunk +242 lines, -0 lines 0 comments Download
A content/browser/loader/resource_scheduler_filter.h View 1 2 3 4 1 chunk +35 lines, -0 lines 0 comments Download
A content/browser/loader/resource_scheduler_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +49 lines, -0 lines 0 comments Download
A 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 18 19 20 21 22 23 24 1 chunk +211 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +2 lines, -0 lines 0 comments Download
M content/common/resource_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/resource_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 4 chunks +19 lines, -0 lines 0 comments Download
M content/common/resource_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +7 lines, -1 line 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +5 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +4 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +1 line, -0 lines 0 comments Download
M content/public/common/common_param_traits_macros.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +2 lines, -1 line 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +6 lines, -0 lines 0 comments Download
M webkit/glue/resource_loader_bridge.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 3 chunks +7 lines, -1 line 0 comments Download
M webkit/glue/resource_loader_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +1 line, -1 line 0 comments Download
M webkit/glue/weburlloader_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +1 line, -0 lines 0 comments Download
M webkit/glue/weburlloader_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 5 chunks +39 lines, -1 line 0 comments Download
M webkit/tools/test_shell/simple_resource_loader_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (0 generated)
James Simonsen
8 years, 2 months ago (2012-10-25 01:25:19 UTC) #1
willchan no longer on Chromium
Please update the changelist description to explain what behavior it's mimic'ing from the WebKit scheduler. ...
8 years, 1 month ago (2012-10-25 19:44:49 UTC) #2
James Simonsen
LoadHandles now make sure the ResourceDispatcher releases everything as needed. Darin says the IPC messages ...
8 years, 1 month ago (2012-11-17 02:56:15 UTC) #3
willchan no longer on Chromium
https://codereview.chromium.org/11270027/diff/7001/content/browser/renderer_host/resource_dispatcher_host_impl.h File content/browser/renderer_host/resource_dispatcher_host_impl.h (right): https://codereview.chromium.org/11270027/diff/7001/content/browser/renderer_host/resource_dispatcher_host_impl.h#newcode385 content/browser/renderer_host/resource_dispatcher_host_impl.h:385: typedef std::vector<linked_ptr<ResourceLoader> > BlockedLoadersList; This confuses me. Who owns ...
8 years, 1 month ago (2012-11-21 09:04:30 UTC) #4
James Simonsen
https://codereview.chromium.org/11270027/diff/7001/content/browser/renderer_host/resource_dispatcher_host_impl.h File content/browser/renderer_host/resource_dispatcher_host_impl.h (right): https://codereview.chromium.org/11270027/diff/7001/content/browser/renderer_host/resource_dispatcher_host_impl.h#newcode385 content/browser/renderer_host/resource_dispatcher_host_impl.h:385: typedef std::vector<linked_ptr<ResourceLoader> > BlockedLoadersList; On 2012/11/21 09:04:30, willchan wrote: ...
8 years ago (2012-11-27 02:20:51 UTC) #5
willchan no longer on Chromium
https://codereview.chromium.org/11270027/diff/7001/content/browser/renderer_host/resource_dispatcher_host_impl.h File content/browser/renderer_host/resource_dispatcher_host_impl.h (right): https://codereview.chromium.org/11270027/diff/7001/content/browser/renderer_host/resource_dispatcher_host_impl.h#newcode421 content/browser/renderer_host/resource_dispatcher_host_impl.h:421: scoped_ptr<ResourceScheduler> resource_scheduler_; On 2012/11/27 02:20:51, James Simonsen wrote: > ...
8 years ago (2012-11-30 10:16:20 UTC) #6
willchan no longer on Chromium
The memory ownership stuff is all confusing to me. We need to fix this. Here's ...
8 years ago (2012-12-03 02:30:16 UTC) #7
willchan no longer on Chromium
https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_scheduler_unittest.cc File content/browser/renderer_host/resource_scheduler_unittest.cc (right): https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_scheduler_unittest.cc#newcode10 content/browser/renderer_host/resource_scheduler_unittest.cc:10: #include "content/browser/renderer_host/resource_scheduler.h" This should go first https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_scheduler_unittest.cc#newcode25 content/browser/renderer_host/resource_scheduler_unittest.cc:25: // ...
8 years ago (2012-12-03 02:33:30 UTC) #8
James Simonsen
https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_dispatcher_host_impl.cc File content/browser/renderer_host/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_dispatcher_host_impl.cc#newcode711 content/browser/renderer_host/resource_dispatcher_host_impl.cc:711: ResourceLoader* loader) { On 2012/12/03 02:30:16, willchan wrote: > ...
8 years ago (2012-12-05 01:52:45 UTC) #9
willchan no longer on Chromium
https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_dispatcher_host_impl.cc File content/browser/renderer_host/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_dispatcher_host_impl.cc#newcode1295 content/browser/renderer_host/resource_dispatcher_host_impl.cc:1295: void ResourceDispatcherHostImpl::CancelRequestsForProcess(int child_id) { On 2012/12/05 01:52:45, James Simonsen ...
8 years ago (2012-12-05 03:44:28 UTC) #10
willchan no longer on Chromium
I apologize, eae@ gave me too much scotch tonight. I cannot review any more. I ...
8 years ago (2012-12-05 04:37:00 UTC) #11
James Simonsen
On 2012/12/05 03:44:28, willchan wrote: > https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_dispatcher_host_impl.cc > File content/browser/renderer_host/resource_dispatcher_host_impl.cc (right): > > https://codereview.chromium.org/11270027/diff/14001/content/browser/renderer_host/resource_dispatcher_host_impl.cc#newcode1295 > ...
8 years ago (2012-12-06 00:11:42 UTC) #12
James Simonsen
Despite the trybots being flaky tonight (failing to fetch patches), I think all the tests ...
8 years ago (2012-12-12 04:19:16 UTC) #13
willchan no longer on Chromium
I don't know why I didn't send this last week, but I just noticed I ...
8 years ago (2012-12-13 06:22:27 UTC) #14
willchan no longer on Chromium
OK, I think things look pretty good. You should probably get an OWNERS review around ...
8 years ago (2012-12-13 06:30:43 UTC) #15
James Simonsen
https://codereview.chromium.org/11270027/diff/24001/content/browser/renderer_host/resource_dispatcher_host_impl.cc File content/browser/renderer_host/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/11270027/diff/24001/content/browser/renderer_host/resource_dispatcher_host_impl.cc#newcode1195 content/browser/renderer_host/resource_dispatcher_host_impl.cc:1195: params.new_request_id); On 2012/12/05 04:37:00, willchan wrote: > indentation is ...
8 years ago (2012-12-14 20:23:23 UTC) #16
James Simonsen
Darin, are you a good person to review resource loading changes in content? If not, ...
8 years ago (2012-12-14 20:26:43 UTC) #17
willchan no longer on Chromium
https://codereview.chromium.org/11270027/diff/34013/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/11270027/diff/34013/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1061 content/browser/loader/resource_dispatcher_host_impl.cc:1061: pending_loaders_[extra_info->GetGlobalRequestID()] = make_linked_ptr( On 2012/12/14 20:23:23, James Simonsen wrote: ...
8 years ago (2012-12-14 20:33:31 UTC) #18
darin (slow to review)
https://codereview.chromium.org/11270027/diff/53001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/11270027/diff/53001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode784 content/browser/loader/resource_dispatcher_host_impl.cc:784: STLDeleteContainerPairSecondPointers(pending_loaders_.begin(), makes me wish we had a ScopedMap type ...
8 years ago (2012-12-14 22:16:28 UTC) #19
darin (slow to review)
James and I just chatted. I think the scheduler can be implemented in terms of ...
8 years ago (2012-12-14 22:26:57 UTC) #20
willchan no longer on Chromium
Hold on before changing anything! :) Will write up a response shortly. On Fri, Dec ...
8 years ago (2012-12-14 22:30:54 UTC) #21
willchan no longer on Chromium
OK, I don't know the ResourceThrottle users well, but I think they are mostly about ...
8 years ago (2012-12-14 22:48:03 UTC) #22
James Simonsen
We probably shoul've fully laid out the new idea... Instead of returning LoadHandles, the ResourceScheduler ...
8 years ago (2012-12-14 23:00:10 UTC) #23
mmenke
On 2012/12/14 23:00:10, James Simonsen wrote: > We probably shoul've fully laid out the new ...
8 years ago (2012-12-14 23:12:34 UTC) #24
willchan no longer on Chromium
Yeah Matt, I've conveyed this to Darin offline. That'd have to be done externally to ...
8 years ago (2012-12-14 23:14:10 UTC) #25
darin (slow to review)
Yes, you would solve that problem by modifying the priority of the URLRequest. Any queues ...
8 years ago (2012-12-14 23:19:04 UTC) #26
James Simonsen
Thanks, this looks way better. Most of the comments aren't applicable now, so I only ...
8 years ago (2012-12-15 02:58:57 UTC) #27
darin (slow to review)
On Fri, Dec 14, 2012 at 6:58 PM, <simonjam@chromium.org> wrote: > Thanks, this looks way ...
8 years ago (2012-12-15 05:05:37 UTC) #28
darin (slow to review)
https://codereview.chromium.org/11270027/diff/56007/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/11270027/diff/56007/content/browser/renderer_host/render_process_host_impl.cc#newcode1463 content/browser/renderer_host/render_process_host_impl.cc:1463: ResourceDispatcherHostImpl::Get()->scheduler()->OnDestroy( This looks like it is the main thread, ...
8 years ago (2012-12-15 05:17:24 UTC) #29
darin (slow to review)
https://codereview.chromium.org/11270027/diff/56007/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/11270027/diff/56007/content/browser/loader/resource_scheduler.cc#newcode75 content/browser/loader/resource_scheduler.cc:75: scoped_ptr<ScheduledResourceThrottle> request( nit: might be nice to improve the ...
8 years ago (2012-12-15 05:20:47 UTC) #30
James Simonsen
https://codereview.chromium.org/11270027/diff/56007/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/11270027/diff/56007/content/browser/loader/resource_scheduler.cc#newcode75 content/browser/loader/resource_scheduler.cc:75: scoped_ptr<ScheduledResourceThrottle> request( On 2012/12/15 05:20:47, darin wrote: > nit: ...
8 years ago (2012-12-17 21:31:38 UTC) #31
James Simonsen
Ping. It looks like the trybot failures are all flakes/unrelated. The reliable bots are all ...
8 years ago (2012-12-18 19:57:57 UTC) #32
darin (slow to review)
https://codereview.chromium.org/11270027/diff/65002/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/11270027/diff/65002/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1056 content/browser/loader/resource_dispatcher_host_impl.cc:1056: if (!throttles.empty()) { nit: You can delete this line ...
8 years ago (2012-12-18 21:09:56 UTC) #33
James Simonsen
I've changed the way we track navigation. I had a lot of trouble getting the ...
7 years, 11 months ago (2013-01-10 19:47:53 UTC) #34
James Simonsen
Ping.
7 years, 11 months ago (2013-01-14 21:21:53 UTC) #35
darin (slow to review)
Some superficial feedback. I haven't studied the main changes in ResourceScheduler yet. https://codereview.chromium.org/11270027/diff/90001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc ...
7 years, 11 months ago (2013-01-14 22:03:29 UTC) #36
darin (slow to review)
more substantive feedback... https://codereview.chromium.org/11270027/diff/90001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/11270027/diff/90001/content/browser/loader/resource_scheduler.cc#newcode32 content/browser/loader/resource_scheduler.cc:32: scheduler_->RemoveRequest(this); how do you know that ...
7 years, 11 months ago (2013-01-14 22:56:21 UTC) #37
James Simonsen
https://codereview.chromium.org/11270027/diff/90001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/11270027/diff/90001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1055 content/browser/loader/resource_dispatcher_host_impl.cc:1055: throttles.push_back(scheduler_.ScheduleRequest(child_id, route_id, On 2013/01/14 22:03:30, darin wrote: > nit: ...
7 years, 11 months ago (2013-01-15 01:10:06 UTC) #38
James Simonsen
Ping. I believe I've addressed all of the feedback to date.
7 years, 11 months ago (2013-01-15 23:59:21 UTC) #39
darin (slow to review)
Something is wrong with the diff. Can you re-upload?
7 years, 11 months ago (2013-01-16 06:05:59 UTC) #40
James Simonsen
Sorry about that. No idea what happened. I rebased and reuploaded and it looks sane ...
7 years, 11 months ago (2013-01-16 19:00:21 UTC) #41
James Simonsen
PTAL. I've updated this patch to use the new signals exposed by WebKit. These are ...
7 years, 10 months ago (2013-02-16 01:41:27 UTC) #42
darin (slow to review)
LGTM https://codereview.chromium.org/11270027/diff/113001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/11270027/diff/113001/content/browser/loader/resource_scheduler.cc#newcode25 content/browser/loader/resource_scheduler.cc:25: nit: nix the new line here https://codereview.chromium.org/11270027/diff/113001/content/browser/loader/resource_scheduler.cc#newcode45 content/browser/loader/resource_scheduler.cc:45: ...
7 years, 10 months ago (2013-02-19 06:58:33 UTC) #43
Cris Neckar
IPC security audit lgtm
7 years, 10 months ago (2013-02-19 19:59:09 UTC) #44
James Simonsen
https://codereview.chromium.org/11270027/diff/113001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/11270027/diff/113001/content/browser/loader/resource_scheduler.cc#newcode25 content/browser/loader/resource_scheduler.cc:25: On 2013/02/19 06:58:33, darin wrote: > nit: nix the ...
7 years, 10 months ago (2013-02-19 23:08:58 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonjam@chromium.org/11270027/127001
7 years, 10 months ago (2013-02-20 01:14:39 UTC) #46
commit-bot: I haz the power
7 years, 10 months ago (2013-02-20 02:32:55 UTC) #47
Message was sent while issue was closed.
Change committed as 183382

Powered by Google App Engine
This is Rietveld 408576698