New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 821464 link

Starred by 16 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Feature



Sign in to add a comment

Priority Hints API

Project Member Reported by addyo@chromium.org, Mar 13 2018

Issue description

Chrome Version: 64.0.3282.186
OS: All

The browser's resource loading process is a complex one. Browsers discover needed resources and download them according to their heuristic priority. Browsers may also use this heuristic resource priority to delay sending certain requests in order to avoid bandwidth contention of these resources with more critical ones.

Currently web developers have very little control over the heuristic importance of loaded resources, other than speeding up their discovery using `<link rel=preload>`. Browsers make many assumptions on the importance of resources based on the resource's type (AKA its request destination), and based on its location in the containing document.

Priority Hints describe a browser API to enable developers signal the priorities of the resources they need to download.

https://wicg.github.io/priority-hints/
 

Comment 1 by addyo@chromium.org, Mar 13 2018

Cc: kenjibaheux@chromium.org y...@yoav.ws

Comment 2 by addyo@chromium.org, Mar 13 2018

Status: Available (was: Untriaged)
Owner: domfarolino@gmail.com
Status: Assigned (was: Available)
Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, May 13 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1e86edb82fffb6d487503dae991461f8d2069981

commit 1e86edb82fffb6d487503dae991461f8d2069981
Author: Dominic Farolino <domfarolino@gmail.com>
Date: Sun May 13 03:02:31 2018

Prototype Priority Hints Infrastructure

Initial infrastructure changes to support Priority Hints. This includes
adding a FetchImportanceMode enum to fetch_api_request.mojom, some
supporting getters/setters to FetchParameters as well as ResourceRequest,
and priority-modifying logic to ResourceFetcher.

R=kinuko@chromium.org, yhirano@chromium.org, yoav@yoav.ws

Bug: 821464
Change-Id: I5ab7f70f44e80d01b7d47ad4c00ae3f4817815ee
Reviewed-on: https://chromium-review.googlesource.com/1053221
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558150}
[modify] https://crrev.com/1e86edb82fffb6d487503dae991461f8d2069981/third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom
[modify] https://crrev.com/1e86edb82fffb6d487503dae991461f8d2069981/third_party/blink/renderer/platform/loader/fetch/fetch_parameters.h
[modify] https://crrev.com/1e86edb82fffb6d487503dae991461f8d2069981/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc
[modify] https://crrev.com/1e86edb82fffb6d487503dae991461f8d2069981/third_party/blink/renderer/platform/loader/fetch/resource_request.cc
[modify] https://crrev.com/1e86edb82fffb6d487503dae991461f8d2069981/third_party/blink/renderer/platform/loader/fetch/resource_request.h
[modify] https://crrev.com/1e86edb82fffb6d487503dae991461f8d2069981/third_party/blink/renderer/platform/runtime_enabled_features.json5

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/73a5187ae81d3389c7b699465899671903b31744

commit 73a5187ae81d3389c7b699465899671903b31744
Author: Dominic Farolino <domfarolino@gmail.com>
Date: Fri Jun 01 06:26:30 2018

Add Priority Hints support to link and img elements

This adds Priority Hints support to link and img elements under a
runtime-enabled flag. The support for link elements do not extend
<link rel=modulepreload>s due to the nature of module script fetching.
Support for this as well as script elements in general will come at a
later time due to the significant changes to the module script loading
infrastructure.

Intent to Implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/65lfM2f0eeM

R=kinuko@chromium.org, kouhei@chromium.org, yhirano@chromium.org, yoav@yoav.ws

Bug: 821464
Change-Id: I5ab0a114ee2b2fce9f0df6c4c5e1f7a487980d0a
Reviewed-on: https://chromium-review.googlesource.com/1067245
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563550}
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/external/wpt/priority-hints/img-attr-named-constructor.tentative.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/external/wpt/priority-hints/link-attr.tentative.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/external/wpt/priority-hints/resources/stylesheet.css
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/http/tests/priority-hints/image-dynamic-insertion.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/http/tests/priority-hints/image-initial-load.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/http/tests/priority-hints/image-low-importance-in-viewport.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/http/tests/priority-hints/link-dynamic-insertion.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/http/tests/priority-hints/link-preload-dynamic-insertion.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/http/tests/priority-hints/link-preload-initial-load.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/http/tests/priority-hints/link-stylesheet-initial-load.html
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/http/tests/priority-hints/resources/common.js
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/html_attribute_names.json5
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/html_image_element.idl
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/html_link_element.cc
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/html_link_element.h
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/html_link_element.idl
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/link_style.cc
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/parser/html_preload_scanner.cc
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/parser/preload_request.cc
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/html/parser/preload_request.h
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/loader/BUILD.gn
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/loader/image_loader.cc
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/loader/importance_attribute.cc
[add] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/loader/importance_attribute.h
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/loader/link_loader.cc
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/loader/link_loader.h
[modify] https://crrev.com/73a5187ae81d3389c7b699465899671903b31744/third_party/blink/renderer/core/loader/link_loader_test.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Jun 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d30e0da337828d7cc438181b6d92ce73766d0692

commit d30e0da337828d7cc438181b6d92ce73766d0692
Author: Dominic Farolino <domfarolino@gmail.com>
Date: Fri Jun 01 13:33:38 2018

Remove extra runtime-enabled flag check, DCHECK later instead

This removes an unnecessary Priority Hints runtime-enabled flag check,
and adds a DCHECK towards in AdjustPriorityWithPriority ensuring that
we're only calling into this function with a non-auto importance if
the appropriate runtime-enabled flag is indeed enabled.

R=kinuko@chromium.org, kouhei@chromium.org, yhirano@chromium.org, yoav@yoav.ws

Bug: 821464
Change-Id: I8a0ce492ff92d94bda598dbf7006a86701e13ff0
Reviewed-on: https://chromium-review.googlesource.com/1082111
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Cr-Commit-Position: refs/heads/master@{#563609}
[modify] https://crrev.com/d30e0da337828d7cc438181b6d92ce73766d0692/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Jun 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c839f018e299561dbab642484eb564f08ecd527b

commit c839f018e299561dbab642484eb564f08ecd527b
Author: Dominic Farolino <domfarolino@gmail.com>
Date: Tue Jun 05 08:39:59 2018

Experimental Priority Hints support on fetch() API

Adding support for Priority Hints on the fetch() API under an
experimental flag. This adds the notion of importance to core/fetch
code, and adds a new member to the RequestInit dictionary to communicate
developer-specified "importance" downstream.

R=kinuko@chromium.org, kouhei@chromium.org, yhirano@chromium.org, yoav@yoav.ws

Bug: 821464
Change-Id: Ib96a128d77004029e86122c07552250c697dea5f
Reviewed-on: https://chromium-review.googlesource.com/1084063
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Cr-Commit-Position: refs/heads/master@{#564410}
[add] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/WebKit/LayoutTests/external/wpt/priority-hints/fetch-api-request.tentative.any.js
[add] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/WebKit/LayoutTests/http/tests/priority-hints/fetch-api-importance.html
[modify] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/blink/renderer/core/fetch/fetch_manager.cc
[modify] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/blink/renderer/core/fetch/fetch_request_data.cc
[modify] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/blink/renderer/core/fetch/fetch_request_data.h
[modify] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/blink/renderer/core/fetch/request.cc
[modify] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/blink/renderer/core/fetch/request.h
[modify] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/blink/renderer/core/fetch/request.idl
[modify] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/blink/renderer/core/fetch/request_init.cc
[modify] https://crrev.com/c839f018e299561dbab642484eb564f08ecd527b/third_party/blink/renderer/core/fetch/request_init.h

Project Member

Comment 9 by bugdroid1@chromium.org, Jun 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/36da47793bee4f5c4ed5850e2559321189bfa192

commit 36da47793bee4f5c4ed5850e2559321189bfa192
Author: Dominic Farolino <domfarolino@gmail.com>
Date: Mon Jun 11 04:52:59 2018

Clean up no-op core/fetch Priority Hints leftovers

This CL cleans up some unused code that would otherwise be used if we
were exposing `importance` as a readonly attribute on the Request
interface, but we are not right now. This also replaces a
RuntimeEnabledFeatures check for Priority Hints with a DCHECK since we
already check the flag earlier than the location this CL touches.

R=kinuko@chromium.org, kouhei@chromium.org, yhirano@chromium.org, yoav@yoav.ws

Bug: 821464
Change-Id: Ic1d2fe3ddabf4eeec46b5298cc4a914001cd2d32
Reviewed-on: https://chromium-review.googlesource.com/1092243
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Cr-Commit-Position: refs/heads/master@{#565926}
[modify] https://crrev.com/36da47793bee4f5c4ed5850e2559321189bfa192/third_party/blink/renderer/core/fetch/request.cc
[modify] https://crrev.com/36da47793bee4f5c4ed5850e2559321189bfa192/third_party/blink/renderer/core/fetch/request.h
[modify] https://crrev.com/36da47793bee4f5c4ed5850e2559321189bfa192/third_party/blink/renderer/core/fetch/request.idl

Cc: kouhei@chromium.org igrigo...@chromium.org pmeenan@chromium.org domfarolino@gmail.com lizeb@chromium.org
 Issue 690550  has been merged into this issue.
Project Member

Comment 11 by bugdroid1@chromium.org, Yesterday (37 hours ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b431ab66155bad31eef995a919afe88fab7dd4a0

commit b431ab66155bad31eef995a919afe88fab7dd4a0
Author: Dominic Farolino <domfarolino@gmail.com>
Date: Tue Jan 22 00:24:25 2019

Add Priority Hints UseCounter

This CL adds the [MeasureAs] extended IDL attribute to HTML elements
supporting Priority Hints, in preparation for bringing Priority Hints to
Origin Trial, and adds explicit Count()s where necessary. This CL also
introduces tests to ensure the use counter is working as expected.

R=kinuko@chromium.org, kouhei@chromium.org, yhirano@chromium.org, yoavweiss@chromium.org

Bug: 821464
Change-Id: I3f281891fecb8c5417d0f452c03bd5159efeb085
Reviewed-on: https://chromium-review.googlesource.com/c/1424405
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624701}
[modify] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/public/platform/web_feature.mojom
[modify] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/renderer/core/fetch/request.cc
[modify] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/renderer/core/html/html_image_element.cc
[modify] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/renderer/core/html/html_image_element.idl
[modify] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/renderer/core/html/html_link_element.cc
[modify] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/renderer/core/html/html_link_element.idl
[add] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/web_tests/http/tests/priority-hints/fetch-api-use-counter.html
[add] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/web_tests/http/tests/priority-hints/image-element-use-counter.html
[add] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/web_tests/http/tests/priority-hints/image-preload-scanner-use-counter.html
[add] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/web_tests/http/tests/priority-hints/link-element-use-counter.html
[add] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/web_tests/http/tests/priority-hints/link-preload-scanner-use-counter.html
[modify] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/third_party/blink/web_tests/http/tests/priority-hints/resources/common.js
[modify] https://crrev.com/b431ab66155bad31eef995a919afe88fab7dd4a0/tools/metrics/histograms/enums.xml

Sign in to add a comment