Commit Graph
28 Commits
Author SHA1 Message Date
Frédéric Wang ae0b7271b8 Bug 1872657 - Add fetchpriority support for <link rel=preload as=image>. r=valentin,smaug,manuel
This patch adds fetchpriority support for `<link rel=preload as=image>`
and equivalent HTTP Link header. The fetchpriority value is passed from
where the link is parsed down to `NewImageChannel` where the priority
is initially set. Currently, the default equals PRIORITY_LOW, but is
decreased a bit if LOAD_BACKGROUND flag is set (this is always the case
for link preload images, see `imgLoader::LoadImage`). Later, the
priority can be increased again depending on the category (see
`imgRequest::BoostPriority`).

In order to minimize the changes, the new calculation is to keep the
initial setting to PRIORITY_LOW, adjust it using a new
`network.fetchpriority.adjustments.*` preference depending on the
fetchpriority attributes, and then preserve further adjustments for
LOAD_BACKGROUND and `BoostPriority`.

For the default value `fetchpriority=auto`, there is no adjustment
i.e. we continue to start with PRIORITY_LOW. `fetchpriority=low/high`
are respectively mapped to PRIORITY_LOW/PRIORITY_HIGH which is simple
and consistent with the "Image" cases from Google's web.dev article
https://web.dev/articles/fetch-priority. These values could of course
be revised in the future after more experiments.

This change is covered by the following tests below. The expectations
is modified to match what is described above (i.e. map to PRIORITY_LOW
or PRIORITY_HIGH with adjustment due to LOAD_BACKGROUND):
- `link-initial-preload-image.h2.html`
- `link-dynamic-preload-image.h2.html`
- `kPipeHeaderPreloadImageLinks`

Based on a patch by Mirko Brodesser ([email protected])

Differential Revision: https://phabricator.services.mozilla.com/D197493
2024-02-27 06:33:48 +00:00
Stanca Serban 08a6b4e21b Backed out changeset 621c8480cd35 (bug 1872657) for causing FetchPriority related bp-nu bustages in IconLoader.cpp. CLOSED TREE 2024-02-26 18:15:18 +02:00
Frédéric Wang b4d37da144 Bug 1872657 - Add fetchpriority support for <link rel=preload as=image>. r=valentin,smaug,manuel
This patch adds fetchpriority support for `<link rel=preload as=image>`
and equivalent HTTP Link header. The fetchpriority value is passed from
where the link is parsed down to `NewImageChannel` where the priority
is initially set. Currently, the default equals PRIORITY_LOW, but is
decreased a bit if LOAD_BACKGROUND flag is set (this is always the case
for link preload images, see `imgLoader::LoadImage`). Later, the
priority can be increased again depending on the category (see
`imgRequest::BoostPriority`).

In order to minimize the changes, the new calculation is to keep the
initial setting to PRIORITY_LOW, adjust it using a new
`network.fetchpriority.adjustments.*` preference depending on the
fetchpriority attributes, and then preserve further adjustments for
LOAD_BACKGROUND and `BoostPriority`.

For the default value `fetchpriority=auto`, there is no adjustment
i.e. we continue to start with PRIORITY_LOW. `fetchpriority=low/high`
are respectively mapped to PRIORITY_LOW/PRIORITY_HIGH which is simple
and consistent with the "Image" cases from Google's web.dev article
https://web.dev/articles/fetch-priority. These values could of course
be revised in the future after more experiments.

This change is covered by the following tests below. The expectations
is modified to match what is described above (i.e. map to PRIORITY_LOW
or PRIORITY_HIGH with adjustment due to LOAD_BACKGROUND):
- `link-initial-preload-image.h2.html`
- `link-dynamic-preload-image.h2.html`
- `kPipeHeaderPreloadImageLinks`

Based on a patch by Mirko Brodesser ([email protected])

Differential Revision: https://phabricator.services.mozilla.com/D197493
2024-02-26 15:03:58 +00:00
Manuel Bucher 211015d6f1 Bug 1771867 - Early Hints Phase 2 - Part 7: Pass early hint preload to image preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161177
2022-12-02 16:15:55 +00:00
Csoregi Natalia 51f523d872 Backed out 13 changesets (bug 1771867) for causing CanonicalBrowsingContext crashes. CLOSED TREE
Backed out changeset 120838b58449 (bug 1771867)
Backed out changeset aea7ca0bbd17 (bug 1771867)
Backed out changeset 2fe2afdee09d (bug 1771867)
Backed out changeset 8bdb1f682d22 (bug 1771867)
Backed out changeset a9f3158ed688 (bug 1771867)
Backed out changeset 1177913e1edf (bug 1771867)
Backed out changeset d33ccbbf407d (bug 1771867)
Backed out changeset 110ac12e16f5 (bug 1771867)
Backed out changeset 7f20525f5e94 (bug 1771867)
Backed out changeset b3d65b1aa872 (bug 1771867)
Backed out changeset 7cdf3cef2773 (bug 1771867)
Backed out changeset 5090eae24a5c (bug 1771867)
Backed out changeset f8a03d226c73 (bug 1771867)
2022-12-02 13:44:55 +02:00
Manuel Bucher bb8505a5e4 Bug 1771867 - Early Hints Phase 2 - Part 7: Pass early hint preload to image preloader r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D161177
2022-12-02 09:45:26 +00:00
Kershaw Chang bd7389a309 Bug 1760580 - P2: Provide a reason when request is cancelled with NS_BINDING_ABORTED, r=necko-reviewers,media-playback-reviewers,valentin,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D156071
2022-09-08 09:11:19 +00:00
Markus Stange 971acb9fde Bug 1691861 - Remove unused mContentType fields. r=mconley
This code seems to have been broken quite some time ago, but without adverse effect.
I have filed bug 1691868 so that a proper fix can be found.

In the meantime, this preserves the current behavior and is less confusing.

Differential Revision: https://phabricator.services.mozilla.com/D104634
2021-02-12 00:32:06 +00:00
Markus Stange 6266a3a9bc Bug 1691861 - Move image region handling out of IconLoader. r=mconley
On Windows we were passing an empty rect to signal "entire image", and on macOS we can move the logic into MOZIconHelper.

Differential Revision: https://phabricator.services.mozilla.com/D104633
2021-02-12 00:32:06 +00:00
Markus Stange aefcbb1239 Bug 1691861 - Rename IconLoader::Helper to IconLoader::Listener. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D104627
2021-02-12 00:32:04 +00:00
Markus Stange 12f554742b Bug 1691861 - Make IconLoader not cycle-collected. r=mconley
It no longer needs to be cycle-collected because it doesn't have any strong
references to other cycle-collected objects anymore.

Differential Revision: https://phabricator.services.mozilla.com/D104622
2021-02-12 00:32:02 +00:00
Markus Stange d06633a826 Bug 1691861 - Make the mHelper field of IconLoader a non-owning reference, and make sure it's always cleared with a call to Destroy before the helper goes away. r=mconley
This breaks another reference cycle.

Differential Revision: https://phabricator.services.mozilla.com/D104621
2021-02-12 00:32:01 +00:00
Markus Stange 6faa0d0f79 Bug 1691861 - Remove IconLoader's mContent field, and pass the node to LoadURI instead. r=mconley
Now IconLoader no longer has an unnecessary strong reference to the node.

Differential Revision: https://phabricator.services.mozilla.com/D104620
2021-02-12 00:32:01 +00:00
Markus Stange 09f7e9c020 Bug 1691861 - Unified build fixes. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D104619
2021-02-12 00:32:01 +00:00
Kartik Gautam 619cd73acb Bug 1684173 - Add newline character at end of files when missing r=sylvestre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D100484
2021-01-07 08:53:08 +00:00
Cosmin Sabou 5980f4a6e1 Backed out changeset dbed1cdf588f (bug 1684173) for mochitest plain and devtools failures. a=backout DONTBUILD 2020-12-28 00:43:51 +02:00
Kartik Gautam 25fc1e9e28 Bug 1684173 - Add newline character at end of files when missing r=sylvestre
Depends on D100443

Differential Revision: https://phabricator.services.mozilla.com/D100484
2020-12-27 11:43:41 +00:00
Mike Conley 8a7f7e0452 Bug 1663784 - Make StatusBarEntry and IconLoader classes work with the cycle collector. r=mccr8
Depends on D90007

Differential Revision: https://phabricator.services.mozilla.com/D91644
2020-09-30 21:13:55 +00:00
Mike Conley 5aec5278f5 Bug 1663784 - Add Windows platform support for IconLoader. r=mhowell
Depends on D89972

Differential Revision: https://phabricator.services.mozilla.com/D90007
2020-09-30 21:14:00 +00:00
Mike Conley 2e25d15f97 Bug 1663784 - Generalize nsIconLoaderService so other platforms can use it. r=mstange
In this patch, I've tried to abstract out all of the platform-specific parts
of what was the nsIconLoaderService into something generic enough to be used
across multiple platforms. I also renamed it and namespaced it to
mozilla::widget::IconLoader.

Depends on D89788

Differential Revision: https://phabricator.services.mozilla.com/D89972
2020-09-30 21:14:02 +00:00
Narcis Beleuzu d67d02f05c Backed out 9 changesets (bug 1661474, bug 1668010, bug 1663784, bug 1665490) for bc failures on browser_all_files_referenced.js . CLOSED TREE
Backed out changeset 9a5e08c77923 (bug 1668010)
Backed out changeset 9bcba802456e (bug 1665490)
Backed out changeset 82ba64e4e81f (bug 1661474)
Backed out changeset 9b5d89c13aa3 (bug 1661474)
Backed out changeset e812f197f225 (bug 1663784)
Backed out changeset ddfbe96735f3 (bug 1663784)
Backed out changeset 282d763360a2 (bug 1663784)
Backed out changeset 9e5267b83d94 (bug 1663784)
Backed out changeset 53a57a5b60d3 (bug 1663784)
2020-10-01 00:08:50 +03:00
Mike Conley 45fdd3bc6c Bug 1663784 - Make StatusBarEntry and IconLoader classes work with the cycle collector. r=mccr8
Depends on D90007

Differential Revision: https://phabricator.services.mozilla.com/D91644
2020-09-30 15:15:27 +00:00
Mike Conley d7b1a30a40 Bug 1663784 - Add Windows platform support for IconLoader. r=mhowell
Depends on D89972

Differential Revision: https://phabricator.services.mozilla.com/D90007
2020-09-30 15:15:01 +00:00
Mike Conley fe6b6c0206 Bug 1663784 - Generalize nsIconLoaderService so other platforms can use it. r=mstange
In this patch, I've tried to abstract out all of the platform-specific parts
of what was the nsIconLoaderService into something generic enough to be used
across multiple platforms. I also renamed it and namespaced it to
mozilla::widget::IconLoader.

Depends on D89788

Differential Revision: https://phabricator.services.mozilla.com/D89972
2020-09-30 15:33:06 +00:00
Razvan Maries 80c4993f85 Backed out 8 changesets (bug 1661474, bug 1663784, bug 1665490) for build bustages on IconLoaderHelperCocoa.h and nsMenuItemIconX.mm. CLOSED TREE
Backed out changeset 4a035c0339f8 (bug 1665490)
Backed out changeset 573e8d8d1fc8 (bug 1661474)
Backed out changeset c2d5b0b0a1a3 (bug 1661474)
Backed out changeset 97be0dd0742d (bug 1663784)
Backed out changeset 428926be2268 (bug 1663784)
Backed out changeset a737df82383a (bug 1663784)
Backed out changeset d1faf309c9d0 (bug 1663784)
Backed out changeset 4ee61c4a6bc8 (bug 1663784)
2020-09-30 02:16:00 +03:00
Mike Conley d0ddb69733 Bug 1663784 - Make StatusBarEntry and IconLoader classes work with the cycle collector. r=mccr8
Depends on D90007

Differential Revision: https://phabricator.services.mozilla.com/D91644
2020-09-29 19:31:36 +00:00
Mike Conley 7fbe6332f5 Bug 1663784 - Add Windows platform support for IconLoader. r=mhowell
Depends on D89972

Differential Revision: https://phabricator.services.mozilla.com/D90007
2020-09-29 06:50:37 +00:00
Mike Conley 6591214535 Bug 1663784 - Generalize nsIconLoaderService so other platforms can use it. r=mstange
In this patch, I've tried to abstract out all of the platform-specific parts
of what was the nsIconLoaderService into something generic enough to be used
across multiple platforms. I also renamed it and namespaced it to
mozilla::widget::IconLoader.

Depends on D89788

Differential Revision: https://phabricator.services.mozilla.com/D89972
2020-09-29 07:54:48 +00:00