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

Issue 462813002: Changed resource scheduler to block until all critical resources actually load. (Closed)

Created:
6 years, 4 months ago by Pat Meenan
Modified:
6 years, 4 months ago
Reviewers:
mmenke
CC:
chromium-reviews, darin-cc_chromium.org, jam
Project:
chromium
Visibility:
Public.

Description

There are basically 2 phases to the loading of resources. The "critical" phase is when the resources referenced in the head are being loaded and then the "regular" phase follows. We limit resources being loaded during the critical phase because nothing can be rendered on the screen until they have all loaded. Historically this was done by tracking when the main HTML parser reached the <body> tag but that doesn't always work because css resources do not block the parser. This patch flags all high priority requests that are started before the parser reaches the body tag as critical and only exits the critical loading phase once they have all finished loading. BUG=402891 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=291055

Patch Set 1 #

Patch Set 2 : Updated the scheduler logic comment to match the new logic. #

Total comments: 2

Patch Set 3 : Switched to an enum for tracking critical and delayable resources #

Patch Set 4 : Updated existing tests and added a new one #

Total comments: 11

Patch Set 5 : Fixed reprioritization in redirect and made DCHECK more paranoid #

Patch Set 6 : Changed "critical" to "layout-blocking" #

Patch Set 7 : Fixed tracking of pending layout-blocking requests #

Total comments: 15

Patch Set 8 : Cleanup from review feedback #

Total comments: 4

Patch Set 9 : Cleaned up the request classification tracking logic #

Total comments: 6

Patch Set 10 : Changed naming to be clearer #

Patch Set 11 : Fixed member initialization order (clang warning) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -48 lines) Patch
M content/browser/loader/resource_scheduler.h View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/loader/resource_scheduler.cc View 1 2 3 4 5 6 7 8 9 10 13 chunks +97 lines, -48 lines 0 comments Download
M content/browser/loader/resource_scheduler_unittest.cc View 1 2 3 5 chunks +20 lines, -0 lines 0 comments Download

Messages

Total messages: 45 (0 generated)
Pat Meenan
mmenke@ PTAL when you get a chance.
6 years, 4 months ago (2014-08-12 17:13:24 UTC) #1
mmenke
On 2014/08/12 17:13:24, Pat Meenan wrote: > mmenke@ PTAL when you get a chance. I ...
6 years, 4 months ago (2014-08-12 17:18:22 UTC) #2
mmenke
Oops, meant to publish a quick question. https://codereview.chromium.org/462813002/diff/20001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/462813002/diff/20001/content/browser/loader/resource_scheduler.cc#newcode388 content/browser/loader/resource_scheduler.cc:388: SetRequestCritical(request, IsCriticalRequest(request)); ...
6 years, 4 months ago (2014-08-12 17:18:37 UTC) #3
Pat Meenan
Switched the separate bools to an enum since the delayable and critical states are non-overlapping. ...
6 years, 4 months ago (2014-08-13 00:20:12 UTC) #4
Pat Meenan
ok, should be ready now. The existing unit tests were updated to handle the fact ...
6 years, 4 months ago (2014-08-13 15:12:07 UTC) #5
mmenke
https://codereview.chromium.org/462813002/diff/60001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/462813002/diff/60001/content/browser/loader/resource_scheduler.cc#newcode453 content/browser/loader/resource_scheduler.cc:453: DCHECK_LE(total_critical_count_, in_flight_requests_.size()); Maybe these would get more coverage if ...
6 years, 4 months ago (2014-08-13 17:55:12 UTC) #6
mmenke
One other question - are you planning on just unconditionally enabling this for everyone, without ...
6 years, 4 months ago (2014-08-13 17:57:14 UTC) #7
Pat Meenan
FWIW, the tests were WebPagetest (not replay) though not sure if that's what you ultimately ...
6 years, 4 months ago (2014-08-13 19:24:55 UTC) #8
aiolos (Not reviewing)
> https://codereview.chromium.org/462813002/diff/60001/content/browser/loader/resource_scheduler.cc#newcode623 > content/browser/loader/resource_scheduler.cc:623: total_critical_count_ != 0 && > On 2014/08/13 17:55:11, mmenke wrote: > ...
6 years, 4 months ago (2014-08-13 21:03:19 UTC) #9
mmenke
On 2014/08/13 21:03:19, aiolos wrote: > > > https://codereview.chromium.org/462813002/diff/60001/content/browser/loader/resource_scheduler.cc#newcode623 > > content/browser/loader/resource_scheduler.cc:623: total_critical_count_ != 0 ...
6 years, 4 months ago (2014-08-13 21:09:41 UTC) #10
Pat Meenan
Would calling it "render blocking" instead of critical make it less confusing? FWIW, we consider ...
6 years, 4 months ago (2014-08-14 12:13:52 UTC) #11
mmenke
On 2014/08/14 12:13:52, Pat Meenan wrote: > Would calling it "render blocking" instead of critical ...
6 years, 4 months ago (2014-08-14 15:25:11 UTC) #12
Pat Meenan
I changed all of the "critical" language to "layout-blocking" (enums, variables, comments, etc) so it ...
6 years, 4 months ago (2014-08-14 17:22:24 UTC) #13
Pat Meenan
Actually, hold off for today. The current tracking of the layout_blocking requests is only tracking ...
6 years, 4 months ago (2014-08-14 21:22:11 UTC) #14
Pat Meenan
ok, I fixed it to track all layout-blocking requests (in-flight and pending) and I fixed ...
6 years, 4 months ago (2014-08-14 22:26:24 UTC) #15
mmenke
Quick comments. https://codereview.chromium.org/462813002/diff/60001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/462813002/diff/60001/content/browser/loader/resource_scheduler.cc#newcode623 content/browser/loader/resource_scheduler.cc:623: total_critical_count_ != 0 && On 2014/08/13 19:24:55, ...
6 years, 4 months ago (2014-08-15 19:53:40 UTC) #16
Pat Meenan
https://codereview.chromium.org/462813002/diff/120001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/462813002/diff/120001/content/browser/loader/resource_scheduler.cc#newcode265 content/browser/loader/resource_scheduler.cc:265: // validate the counts is accurate. On 2014/08/15 19:53:40, ...
6 years, 4 months ago (2014-08-15 21:39:32 UTC) #17
mmenke
https://codereview.chromium.org/462813002/diff/120001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/462813002/diff/120001/content/browser/loader/resource_scheduler.cc#newcode267 content/browser/loader/resource_scheduler.cc:267: SetRequestCategory(request, LAYOUT_BLOCKING_REQUEST); On 2014/08/15 21:39:31, Pat Meenan wrote: > ...
6 years, 4 months ago (2014-08-18 16:30:20 UTC) #18
Pat Meenan
https://codereview.chromium.org/462813002/diff/120001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/462813002/diff/120001/content/browser/loader/resource_scheduler.cc#newcode267 content/browser/loader/resource_scheduler.cc:267: SetRequestCategory(request, LAYOUT_BLOCKING_REQUEST); On 2014/08/18 16:30:20, mmenke wrote: > On ...
6 years, 4 months ago (2014-08-18 18:29:57 UTC) #19
mmenke
This looks pretty reasonable to me. https://codereview.chromium.org/462813002/diff/160001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/462813002/diff/160001/content/browser/loader/resource_scheduler.cc#newcode485 content/browser/loader/resource_scheduler.cc:485: bool in_flight = ...
6 years, 4 months ago (2014-08-18 20:59:43 UTC) #20
Pat Meenan
https://codereview.chromium.org/462813002/diff/160001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/462813002/diff/160001/content/browser/loader/resource_scheduler.cc#newcode485 content/browser/loader/resource_scheduler.cc:485: bool in_flight = !pending_requests_.IsQueued(request); On 2014/08/18 20:59:43, mmenke wrote: ...
6 years, 4 months ago (2014-08-20 14:57:32 UTC) #21
mmenke
LGTM!
6 years, 4 months ago (2014-08-20 15:13:25 UTC) #22
Pat Meenan
The CQ bit was checked by pmeenan@chromium.org
6 years, 4 months ago (2014-08-20 15:16:25 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pmeenan@chromium.org/462813002/180001
6 years, 4 months ago (2014-08-20 15:18:05 UTC) #24
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_gpu on tryserver.chromium.gpu ...
6 years, 4 months ago (2014-08-20 17:01:57 UTC) #25
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-20 17:05:53 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_swarming on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_swarming/builds/5145)
6 years, 4 months ago (2014-08-20 17:05:54 UTC) #27
Pat Meenan
The CQ bit was checked by pmeenan@chromium.org
6 years, 4 months ago (2014-08-20 17:16:38 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pmeenan@chromium.org/462813002/180001
6 years, 4 months ago (2014-08-20 17:18:37 UTC) #29
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_gpu on tryserver.chromium.gpu ...
6 years, 4 months ago (2014-08-20 18:03:16 UTC) #30
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-20 18:09:56 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu/builds/54939) android_dbg_tests_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_tests_recipe/builds/693) mac_chromium_rel_swarming ...
6 years, 4 months ago (2014-08-20 18:09:57 UTC) #32
Pat Meenan
The CQ bit was checked by pmeenan@chromium.org
6 years, 4 months ago (2014-08-20 18:32:43 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pmeenan@chromium.org/462813002/200001
6 years, 4 months ago (2014-08-20 18:34:05 UTC) #34
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_gpu on tryserver.chromium.gpu ...
6 years, 4 months ago (2014-08-20 20:22:36 UTC) #35
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-20 20:26:22 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu/builds/55046)
6 years, 4 months ago (2014-08-20 20:26:23 UTC) #37
Pat Meenan
The CQ bit was checked by pmeenan@chromium.org
6 years, 4 months ago (2014-08-20 20:31:08 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pmeenan@chromium.org/462813002/200001
6 years, 4 months ago (2014-08-20 20:32:42 UTC) #39
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_gpu on tryserver.chromium.gpu ...
6 years, 4 months ago (2014-08-20 22:19:05 UTC) #40
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-20 22:22:50 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu/builds/55172)
6 years, 4 months ago (2014-08-20 22:22:51 UTC) #42
Pat Meenan
The CQ bit was checked by pmeenan@chromium.org
6 years, 4 months ago (2014-08-21 10:58:58 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pmeenan@chromium.org/462813002/200001
6 years, 4 months ago (2014-08-21 10:59:48 UTC) #44
commit-bot: I haz the power
6 years, 4 months ago (2014-08-21 12:49:21 UTC) #45
Message was sent while issue was closed.
Committed patchset #11 (200001) as 291055

Powered by Google App Engine
This is Rietveld 408576698