Add fetchpriority support for link header [chromium/src : main]

22 views
Skip to first unread message

Yoav Weiss (Gerrit)

unread,
Feb 9, 2023, 12:19:59 AM2/9/23
to Patrick Meenan, blink-...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, network-ser...@chromium.org, danakj, Chromium IPC Reviews, Takashi Toyoshima, Findit, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin

Attention is currently required from: Patrick Meenan, Takashi Toyoshima.

View Change

5 comments:

  • File content/browser/loader/navigation_early_hints_manager.cc:

    • Patch Set #4, Line 596: return net::MEDIUM;

      So `as=stylesheet fetchpriority=high` would have a lower priority than `as=stylesheet`? That doesn't seem right..

    • Patch Set #4, Line 601: case network::mojom::LinkAsAttribute::kFont:

      Preloaded fonts are not currently render-blocking, so marking them as "highest" seems excessive. There are plans to experiment with making them render blocking for short periods of time, which may make this more appropriate.

  • File services/network/public/mojom/request_priority.mojom:

  • File third_party/blink/renderer/platform/loader/link_header_test.cc:

    • Patch Set #4, Line 28: const char* fetch_priority;

      Aside: we should just convert all this to WPTs and drop those unittests..

  • File third_party/blink/web_tests/http/tests/linkHeader/link-header-preload-fetchpriority.php:

To view, visit change 4228311. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I0880bb9879d5a7b853f23d4092dbfea8fb540dcd
Gerrit-Change-Number: 4228311
Gerrit-PatchSet: 4
Gerrit-Owner: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Reviewer: Yoav Weiss <yoav...@chromium.org>
Gerrit-Reviewer: danakj <dan...@chromium.org>
Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: gwsq
Gerrit-Attention: Patrick Meenan <pme...@chromium.org>
Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Feb 2023 05:19:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Takashi Toyoshima (Gerrit)

unread,
Feb 9, 2023, 1:29:51 AM2/9/23
to Patrick Meenan, blink-...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, network-ser...@chromium.org, danakj, Chromium IPC Reviews, Yoav Weiss, Findit, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin

Attention is currently required from: Patrick Meenan, Yoav Weiss.

Patch set 4:Code-Review +1

View Change

1 comment:

  • File content/browser/loader/navigation_early_hints_manager.cc:

    • Patch Set #4, Line 601: case network::mojom::LinkAsAttribute::kFont:

      Preloaded fonts are not currently render-blocking, so marking them as "highest" seems excessive. […]

      Ah, this is due to my comment. As we already used a wrong priority for Font, I suggested keeping the same wrong implementation in this CL, and another follow-up CL will fix the priority to see how our perfbots detect it.

      Probably, submitting this first, then fixing the priority later will be a better order as we can easily revert the priority change part if perfbots complain... WDYT?

To view, visit change 4228311. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I0880bb9879d5a7b853f23d4092dbfea8fb540dcd
Gerrit-Change-Number: 4228311
Gerrit-PatchSet: 4
Gerrit-Owner: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Reviewer: Yoav Weiss <yoav...@chromium.org>
Gerrit-Reviewer: danakj <dan...@chromium.org>
Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: gwsq
Gerrit-Attention: Yoav Weiss <yoav...@chromium.org>
Gerrit-Attention: Patrick Meenan <pme...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Feb 2023 06:29:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Yoav Weiss <yoav...@chromium.org>
Gerrit-MessageType: comment

Yoav Weiss (Gerrit)

unread,
Feb 9, 2023, 4:18:21 AM2/9/23
to Patrick Meenan, blink-...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, network-ser...@chromium.org, Takashi Toyoshima, danakj, Chromium IPC Reviews, Findit, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin

Attention is currently required from: Patrick Meenan.

View Change

1 comment:

  • File content/browser/loader/navigation_early_hints_manager.cc:

    • Ah, this is due to my comment. […]

      Makes sense!! I was just surprised by it 😊

To view, visit change 4228311. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I0880bb9879d5a7b853f23d4092dbfea8fb540dcd
Gerrit-Change-Number: 4228311
Gerrit-PatchSet: 4
Gerrit-Owner: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Reviewer: Yoav Weiss <yoav...@chromium.org>
Gerrit-Reviewer: danakj <dan...@chromium.org>
Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: gwsq
Gerrit-Attention: Patrick Meenan <pme...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Feb 2023 09:18:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yoav Weiss <yoav...@chromium.org>
Comment-In-Reply-To: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-MessageType: comment

Patrick Meenan (Gerrit)

unread,
Feb 9, 2023, 11:30:38 AM2/9/23
to blink-...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, network-ser...@chromium.org, Takashi Toyoshima, danakj, Chromium IPC Reviews, Yoav Weiss, Findit, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin

Attention is currently required from: Yoav Weiss.

View Change

4 comments:

  • Patchset:

    • Patch Set #5:

      Yoav@ thanks. Fixed it so this CL won't lower the priority of HIGHEST resources when fetchpriority is set to high.

      I'll work on a separate CL to actually fix the base priorities. Preloaded fonts should be the same as HTML-preloaded fonts and, arguably, preloaded stylesheets should be the same as preloaded scripts/fonts and not the same priority as the HTML. For that matter, regular early-body CSS should also be the same priority so that it is sequenced in parser order relative to blocking scripts (since they block each other) and only @import stylesheets should be HIGHEST (probably a few CL's and experiments before it all lands).

  • File content/browser/loader/navigation_early_hints_manager.cc:

    • Patch Set #4, Line 596: return net::MEDIUM;

      So `as=stylesheet fetchpriority=high` would have a lower priority than `as=stylesheet`? That doesn't […]

      Thanks. Fixed it so font and stylesheet remain HIGHEST when set to "high". I'll take on fixing the actual priorities in a separate CL.

  • File services/network/public/mojom/request_priority.mojom:

    • Done

  • File third_party/blink/web_tests/http/tests/linkHeader/link-header-preload-fetchpriority.php:

    • Don't we have a WPT way to do this? (e.g. […]

      Not yet. We will (sort of) when I add the priority header but it will still probably need to be a browser test for explicit priority values since those aren't spec'd. We will probably be able to wpt that high and low for a given resource type result in different priorities.

To view, visit change 4228311. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I0880bb9879d5a7b853f23d4092dbfea8fb540dcd
Gerrit-Change-Number: 4228311
Gerrit-PatchSet: 5
Gerrit-Owner: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Reviewer: Yoav Weiss <yoav...@chromium.org>
Gerrit-Reviewer: danakj <dan...@chromium.org>
Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: gwsq
Gerrit-Attention: Yoav Weiss <yoav...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Feb 2023 16:30:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yoav Weiss <yoav...@chromium.org>
Gerrit-MessageType: comment

Yoav Weiss (Gerrit)

unread,
Feb 9, 2023, 11:36:54 AM2/9/23
to Patrick Meenan, blink-...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, network-ser...@chromium.org, Takashi Toyoshima, danakj, Chromium IPC Reviews, Findit, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin

Attention is currently required from: Patrick Meenan.

Patch set 5:Code-Review +1

View Change

1 comment:

To view, visit change 4228311. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I0880bb9879d5a7b853f23d4092dbfea8fb540dcd
Gerrit-Change-Number: 4228311
Gerrit-PatchSet: 5
Gerrit-Owner: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
Gerrit-Reviewer: Patrick Meenan <pme...@chromium.org>
Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
Gerrit-Reviewer: Yoav Weiss <yoav...@chromium.org>
Gerrit-Reviewer: danakj <dan...@chromium.org>
Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: gwsq
Gerrit-Attention: Patrick Meenan <pme...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Feb 2023 16:36:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Patrick Meenan (Gerrit)

unread,
Feb 9, 2023, 3:59:41 PM2/9/23
to blink-...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, network-ser...@chromium.org, Yoav Weiss, Takashi Toyoshima, danakj, Chromium IPC Reviews, Findit, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin

Attention is currently required from: Patrick Meenan.

Patch set 5:Commit-Queue +2

View Change

    To view, visit change 4228311. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I0880bb9879d5a7b853f23d4092dbfea8fb540dcd
    Gerrit-Change-Number: 4228311
    Gerrit-PatchSet: 5
    Gerrit-Owner: Patrick Meenan <pme...@chromium.org>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Patrick Meenan <pme...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Yoav Weiss <yoav...@chromium.org>
    Gerrit-Reviewer: danakj <dan...@chromium.org>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: gwsq
    Gerrit-Attention: Patrick Meenan <pme...@chromium.org>
    Gerrit-Comment-Date: Thu, 09 Feb 2023 20:59:30 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Chromium LUCI CQ (Gerrit)

    unread,
    Feb 9, 2023, 4:17:02 PM2/9/23
    to Patrick Meenan, blink-...@chromium.org, gavinp...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, loading...@chromium.org, network-ser...@chromium.org, Yoav Weiss, Takashi Toyoshima, danakj, Chromium IPC Reviews, Findit, chromium...@chromium.org, Nate Chapin

    Chromium LUCI CQ submitted this change.

    View Change

    Approvals: Patrick Meenan: Commit Takashi Toyoshima: Looks good to me Yoav Weiss: Looks good to me danakj: Looks good to me
    Add fetchpriority support for link header

    This plumbs support for the "fetchpriority" attribute of the link
    http header when used with rel=preload.

    The support is plumbed for both regular HTTP responses as well as 103
    early-hints which are processed separately.

    Bug: 1405738
    Change-Id: I0880bb9879d5a7b853f23d4092dbfea8fb540dcd
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4228311
    Reviewed-by: Yoav Weiss <yoav...@chromium.org>
    Reviewed-by: Takashi Toyoshima <toyo...@chromium.org>
    Commit-Queue: Patrick Meenan <pme...@chromium.org>
    Reviewed-by: danakj <dan...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1103485}
    ---
    M content/browser/loader/navigation_early_hints_manager.cc
    M content/browser/loader/navigation_early_hints_manager.h
    M content/browser/loader/navigation_early_hints_manager_unittest.cc
    M services/network/public/cpp/link_header_parser.cc
    M services/network/public/cpp/link_header_parser_unittest.cc
    M services/network/public/mojom/link_header.mojom
    M services/network/public/mojom/request_priority.mojom
    M third_party/blink/renderer/core/loader/link_load_parameters.cc
    M third_party/blink/renderer/core/loader/preload_helper.cc
    M third_party/blink/renderer/platform/loader/link_header.cc
    M third_party/blink/renderer/platform/loader/link_header.h
    M third_party/blink/renderer/platform/loader/link_header_test.cc
    M third_party/blink/renderer/platform/network/http_parsers.cc
    A third_party/blink/web_tests/http/tests/linkHeader/link-header-preload-fetchpriority-expected.txt
    A third_party/blink/web_tests/http/tests/linkHeader/link-header-preload-fetchpriority.php
    15 files changed, 373 insertions(+), 115 deletions(-)


    To view, visit change 4228311. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I0880bb9879d5a7b853f23d4092dbfea8fb540dcd
    Gerrit-Change-Number: 4228311
    Gerrit-PatchSet: 6
    Gerrit-Owner: Patrick Meenan <pme...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Findit <findit...@appspot.gserviceaccount.com>
    Gerrit-Reviewer: Patrick Meenan <pme...@chromium.org>
    Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
    Gerrit-Reviewer: Yoav Weiss <yoav...@chromium.org>
    Gerrit-Reviewer: danakj <dan...@chromium.org>
    Gerrit-CC: Chromium IPC Reviews <chrome-ip...@google.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: gwsq
    Gerrit-MessageType: merged
    Reply all
    Reply to author
    Forward
    0 new messages