Commit Graph

417 Commits

Author SHA1 Message Date
Benjamin VanderSloot
d27e9eaab8 Bug 1945565 - Add ChromeOnly features to Fetch to allow FedCM to work - r=valentin,necko-reviewers,webidl,farre,sefeng,smaug
This updates RequestInit's ChromeOnly behavior:
- fixes up triggeringPrincipalOverride
- adds neverTaint

This adds Content-type: web-identity to ORB's allowlist.

Differential Revision: https://phabricator.services.mozilla.com/D237043
2025-03-14 14:38:49 +00:00
Stanca Serban
4a67a80267 Backed out 2 changesets (bug 1945565) for causing wpt failures.
Backed out changeset fbdc65ce6f84 (bug 1945565)
Backed out changeset 5296261171bc (bug 1945565)
2025-03-13 18:53:37 +02:00
Benjamin VanderSloot
968d298a34 Bug 1945565 - Add ChromeOnly features to Fetch to allow FedCM to work - r=valentin,necko-reviewers,webidl,farre,sefeng,smaug
This updates RequestInit's ChromeOnly behavior:
- fixes up triggeringPrincipalOverride
- adds neverTaint

This adds Content-type: web-identity to ORB's allowlist.

Differential Revision: https://phabricator.services.mozilla.com/D237043
2025-03-13 12:34:57 +00:00
Norisz Fay
739bf939a1 Backed out 2 changesets (bug 1945565) for causing bustageson Request.cpp CLOSED TREE
Backed out changeset 7c9eb04edd98 (bug 1945565)
Backed out changeset 155edbe21877 (bug 1945565)
2025-03-13 03:57:45 +02:00
Benjamin VanderSloot
950c05697e Bug 1945565 - Add ChromeOnly features to Fetch to allow FedCM to work - r=valentin,necko-reviewers,webidl,farre,sefeng,smaug
This updates RequestInit's ChromeOnly behavior:
- fixes up triggeringPrincipalOverride
- adds neverTaint

This adds Content-type: web-identity to ORB's allowlist.

Differential Revision: https://phabricator.services.mozilla.com/D237043
2025-03-13 00:51:19 +00:00
Emilio Cobos Álvarez
db9bcd53f7 Bug 1948889 - Simplify SRICheck by getting location from http referrer info. r=freddyb,tschuster
The referrer info is more directly what we want (what triggered this
load).

I could add this information for non-http channels, but I think it's
probably not worth it. This is useful because it's thread-safe, which
allows me to support off-main-thread parsing of stylesheets that contain
SRI metadata.

It also simplifies the API and avoids getting URIs around in non-error
code paths.

Differential Revision: https://phabricator.services.mozilla.com/D238612
2025-02-25 09:38:28 +00:00
smayya
85f33b56ef Bug 1938471 - synchronize access to FetchDriver::mObserver. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D235762
2025-02-04 15:48:43 +00:00
smayya
2ccb26b302 Bug 1938471 - Backed out changeset dcfa4149aaf3. r=necko-reviewers,kershaw
Please see the explaination for the fix in the bug [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1938471#c16 | comment ]]

Differential Revision: https://phabricator.services.mozilla.com/D235761
2025-02-04 15:48:43 +00:00
Tim Huang
5cd3f25e6a Bug 1915355 - Part 2: Propagate the isOn3PCBExcpetionList to workers. r=edenchuang
We need to propagate the isOn3PCBExceptionList flag from the nsILoadInfo
to workers so that the requests from workers can have the flag to exempt
third-party cookie blocking. We will also tackle the fetch request in
the worker scope in the patch.

Depends on D223380

Differential Revision: https://phabricator.services.mozilla.com/D223936
2025-01-10 08:24:28 +00:00
Stanca Serban
3eac2f1354 Backed out 8 changesets (bug 1915355) for causing xpcshell failures.
Backed out changeset d292c3a2592d (bug 1915355)
Backed out changeset 3386ee00459e (bug 1915355)
Backed out changeset 98848e63dfbf (bug 1915355)
Backed out changeset b668d0c685e8 (bug 1915355)
Backed out changeset 08acd8256071 (bug 1915355)
Backed out changeset 3ae9463ee988 (bug 1915355)
Backed out changeset 2dd416f1b847 (bug 1915355)
Backed out changeset 17107bbcf8c8 (bug 1915355)
2025-01-08 23:36:08 +02:00
Tim Huang
480c19889f Bug 1915355 - Part 2: Propagate the isOn3PCBExcpetionList to workers. r=edenchuang
We need to propagate the isOn3PCBExceptionList flag from the nsILoadInfo
to workers so that the requests from workers can have the flag to exempt
third-party cookie blocking. We will also tackle the fetch request in
the worker scope in the patch.

Depends on D223380

Differential Revision: https://phabricator.services.mozilla.com/D223936
2025-01-08 19:25:58 +00:00
smayya
76b65f790f Bug 1935088 - set thirdparty contexts for fetch keepalive requests. r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D231754
2025-01-07 14:41:55 +00:00
Alexandru Marc
0c1f8f4e28 Backed out 7 changesets (bug 1915355) for causing performance regressions CLOSED TREE
Backed out changeset 77b4cc920fe4 (bug 1915355)
Backed out changeset da9446e06954 (bug 1915355)
Backed out changeset 20708fe16d2a (bug 1915355)
Backed out changeset 7c4b003d1e48 (bug 1915355)
Backed out changeset 36163490219b (bug 1915355)
Backed out changeset 8f867025b79b (bug 1915355)
Backed out changeset 3d647f81adb9 (bug 1915355)
2024-12-30 13:02:45 +02:00
Alexandru Marc
c814f3818a Backed out changeset 5efbaa9e5c01 (bug 1935088) for causing conflicts 2024-12-30 12:57:53 +02:00
smayya
0aab8b73b0 Bug 1935088 - set thirdparty contexts for fetch keepalive requests. r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D231754
2024-12-20 11:36:24 +00:00
Tim Huang
2beb9afe1b Bug 1915355 - Part 2: Propagate the isOn3PCBExcpetionList to workers. r=edenchuang
We need to propagate the isOn3PCBExceptionList flag from the nsILoadInfo
to workers so that the requests from workers can have the flag to exempt
third-party cookie blocking. We will also tackle the fetch request in
the worker scope in the patch.

Differential Revision: https://phabricator.services.mozilla.com/D223936
2024-12-17 21:44:36 +00:00
Alexandru Marc
424d306b7d Backed out 7 changesets (bug 1915355) for causing build bustages @ ThirdPartyCookieBlockingExceptions.cpp CLOSED TREE
Backed out changeset 5e5278038a79 (bug 1915355)
Backed out changeset d2381f88168a (bug 1915355)
Backed out changeset 675785853d7a (bug 1915355)
Backed out changeset de6a26d3e3df (bug 1915355)
Backed out changeset b2934cae3c23 (bug 1915355)
Backed out changeset e7077b00cfc1 (bug 1915355)
Backed out changeset c5d7f4e7e839 (bug 1915355)
2024-12-17 12:39:21 +02:00
Tim Huang
ccba861132 Bug 1915355 - Part 2: Propagate the isOn3PCBExcpetionList to workers. r=edenchuang
We need to propagate the isOn3PCBExceptionList flag from the nsILoadInfo
to workers so that the requests from workers can have the flag to exempt
third-party cookie blocking. We will also tackle the fetch request in
the worker scope in the patch.

Differential Revision: https://phabricator.services.mozilla.com/D223936
2024-12-17 08:57:30 +00:00
Jonatan Klemets
d60f6391b3 Bug 1858078 - Part 1: Add nsIContentPolicy::{TYPE_JSON,TYPE_INTERNAL_JSON_PRELOAD} r=extension-reviewers,webidl,devtools-reviewers,dom-core,smaug,robwu,tschuster,nchevobbe,farre
Differential Revision: https://phabricator.services.mozilla.com/D229524
2024-12-12 17:39:18 +00:00
Randell Jesup
e25cedb938 Bug 1917901: Make it ok to retarget OnDataAvailable multiple times until the first ODA is received r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D223651
2024-12-02 16:38:25 +00:00
Alexandru Marc
d900437bd8 Backed out changeset f9ccd9f31b9c (bug 1917901) for causing networking crashes. a=backout 2024-11-21 11:26:48 +02:00
Randell Jesup
a9c3cf04c0 Bug 1917901: Make it ok to retarget OnDataAvailable multiple times until the first ODA is received r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D223651
2024-11-20 11:25:54 +00:00
serge-sans-paille
aee8b0d98b Bug 1920080 - Make nsCString default constructor constexpr r=glandium,xpcom-reviewers,emilio
This make it possible to flag a few MOZ_RUNINIT variables as
MOZ_CONSTINIT.

Differential Revision: https://phabricator.services.mozilla.com/D227451
2024-11-13 19:39:45 +00:00
Valentin Gosu
533ec6637b Bug 1900561 - Set nsIClassOfService::fetchPriority where callers use nsISupportsPriority.adjustPriority r=acreskey
Differential Revision: https://phabricator.services.mozilla.com/D221958
2024-09-25 18:42:52 +00:00
Butkovits Atila
e6ce34045f Backed out 3 changesets (bug 1900561, bug 1919158) for causing bustages at ipc_message_utils.h. CLOSED TREE
Backed out changeset a2a4a88ef8d1 (bug 1919158)
Backed out changeset ecb590690d2e (bug 1900561)
Backed out changeset ef92a69ff2d1 (bug 1900561)
2024-09-24 18:58:08 +03:00
Valentin Gosu
ebbb22fc8b Bug 1900561 - Set nsIClassOfService::fetchPriority where callers use nsISupportsPriority.adjustPriority r=acreskey
Depends on D221957

Differential Revision: https://phabricator.services.mozilla.com/D221958
2024-09-24 12:29:08 +00:00
Iulian Moraru
1e7ea75f9b Backed out 2 changesets (bug 1900561) for causing windows build bustages. CLOSED TREE
Backed out changeset 474e1a3ab5f0 (bug 1900561)
Backed out changeset 7a0bb5fa195e (bug 1900561)
2024-09-19 14:52:47 +03:00
Valentin Gosu
86dd18c852 Bug 1900561 - Set nsIClassOfService::fetchPriority where callers use nsISupportsPriority.adjustPriority r=acreskey
Differential Revision: https://phabricator.services.mozilla.com/D221958
2024-09-19 10:24:22 +00:00
Valentin Gosu
cb003cfaa8 Bug 1911759 - Add triggeringPrincipal override to RequestInit r=necko-reviewers,webidl,smaug,kershaw
This allows code with Chrome priviledges to use the fetch API
to specify a triggering principal instead of needing to use
XMLHttpRequest.
The triggeringPrincipal is only used when the fetch principal
is already the systemPrincipal.

Differential Revision: https://phabricator.services.mozilla.com/D213418
2024-08-07 09:16:20 +00:00
Tom Schuster
feaa0c77a1 Bug 1904004 - Use OriginAttributes::IsPrivateBrowsing instead of open coding PBM checks. r=timhuang,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,necko-reviewers,kershaw,dom-storage-reviewers,janv,canaltinova,dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D214532
2024-06-24 11:06:18 +00:00
Frédéric Wang
5b24b1b91a Bug 1881040 - Use the destination to refine the fetchpriority mapping. r=valentin
According to step 15 of [1], request’s destination is used in an
implementation-defined manner to set the internal priority but we
currently always use the preferences corresponding to the adjustments
of the global fetch API.

This patch handle destinations corresponding to CSP directives
"font-src", "script-src", "style-src", "img-src" and "media-src" [2]
specially by respectively using the adjustment preferences named
"link-preload-font", "link-preload-script", "link-preload-style"
"images" and a new preference "media".

Special handling of these destinations is motivated by the fact that
they are mentioned explicitly on [3]. For "media" we choose preferences
following the suggestions from that article (i.e. media is low
priority). However, for now we don't change the default value and make
sure fetchpriority=high/low preserves the invariants tested by
fetchpriority-adjustments.html

[1] https://fetch.spec.whatwg.org/#concept-fetch
[2] https://fetch.spec.whatwg.org/#destination-table
[3] https://web.dev/articles/fetch-priority?hl=en#browser_priority_and_fetchpriority

Differential Revision: https://phabricator.services.mozilla.com/D208467
2024-06-12 07:50:42 +00:00
Frédéric Wang
3f4b36821a Bug 1881040 - Add and propagate internal priority when copying Request. r=edenchuang
Step 12 of [1] says that internal prirority is copied by the Request
constructor so this patch adds such a member on InternalRequest and
makes sure it is copied by InternalRequest::GetRequestConstructorCopy.

Additionally, this patch also makes sure the original request's internal
priority is preserved when calling fetch(event.request) from a worker
on an intercepted fetch event (e.g. [2] for HTML images).

[1] https://fetch.spec.whatwg.org/#dom-request
[2] https://searchfox.org/mozilla-central/rev/b3f40fd7c4671537ed29a232e76c962977650045/testing/web-platform/tests/fetch/api/request/destination/fetch-destination.https.html#37

Differential Revision: https://phabricator.services.mozilla.com/D210283
2024-06-12 07:50:41 +00:00
Frédéric Wang
3dc8bbf3eb Bug 1881040 - Propagate InterceptedHttpChannel information when using PFetch. r=edenchuang
This interception information was introduced in bug 1658869 and is used
when calling fetch from the main thread. However, after bug 1351231 we
are not propagating that information when using PFetch, because it is
not copied by ToIPCInternalRequest here:
https://searchfox.org/mozilla-central/rev/14ff5b1650123600698f4bb8998ee02b102b8d2f/dom/fetch/Fetch.cpp#632

Differential Revision: https://phabricator.services.mozilla.com/D209330
2024-06-12 07:50:40 +00:00
Iulian Moraru
d78c84b1d1 Backed out 6 changesets (bug 1881040) for causing base-toolchains build bustages on FetchDriver.cpp. CLOSED TREE
Backed out changeset 320a5e2465e3 (bug 1881040)
Backed out changeset 13645c9ec29b (bug 1881040)
Backed out changeset 14ac42b80c59 (bug 1881040)
Backed out changeset 4c1cf7254f78 (bug 1881040)
Backed out changeset db29da0a049a (bug 1881040)
Backed out changeset 4f99700fa668 (bug 1881040)
2024-06-11 22:42:28 +03:00
Frédéric Wang
6431f5d22c Bug 1881040 - Use the destination to refine the fetchpriority mapping. r=valentin
According to step 15 of [1], request’s destination is used in an
implementation-defined manner to set the internal priority but we
currently always use the preferences corresponding to the adjustments
of the global fetch API.

This patch handle destinations corresponding to CSP directives
"font-src", "script-src", "style-src", "img-src" and "media-src" [2]
specially by respectively using the adjustment preferences named
"link-preload-font", "link-preload-script", "link-preload-style"
"images" and a new preference "media".

Special handling of these destinations is motivated by the fact that
they are mentioned explicitly on [3]. For "media" we choose preferences
following the suggestions from that article (i.e. media is low
priority). However, for now we don't change the default value and make
sure fetchpriority=high/low preserves the invariants tested by
fetchpriority-adjustments.html

[1] https://fetch.spec.whatwg.org/#concept-fetch
[2] https://fetch.spec.whatwg.org/#destination-table
[3] https://web.dev/articles/fetch-priority?hl=en#browser_priority_and_fetchpriority

Differential Revision: https://phabricator.services.mozilla.com/D208467
2024-06-11 09:14:15 +00:00
Frédéric Wang
8daf0cf05a Bug 1881040 - Add and propagate internal priority when copying Request. r=edenchuang
Step 12 of [1] says that internal prirority is copied by the Request
constructor so this patch adds such a member on InternalRequest and
makes sure it is copied by InternalRequest::GetRequestConstructorCopy.

Additionally, this patch also makes sure the original request's internal
priority is preserved when calling fetch(event.request) from a worker
on an intercepted fetch event (e.g. [2] for HTML images).

[1] https://fetch.spec.whatwg.org/#dom-request
[2] https://searchfox.org/mozilla-central/rev/b3f40fd7c4671537ed29a232e76c962977650045/testing/web-platform/tests/fetch/api/request/destination/fetch-destination.https.html#37

Differential Revision: https://phabricator.services.mozilla.com/D210283
2024-06-11 09:14:14 +00:00
Frédéric Wang
94a917f345 Bug 1881040 - Propagate InterceptedHttpChannel information when using PFetch. r=edenchuang
This interception information was introduced in bug 1658869 and is used
when calling fetch from the main thread. However, after bug 1351231 we
are not propagating that information when using PFetch, because it is
not copied by ToIPCInternalRequest here:
https://searchfox.org/mozilla-central/rev/14ff5b1650123600698f4bb8998ee02b102b8d2f/dom/fetch/Fetch.cpp#632

Differential Revision: https://phabricator.services.mozilla.com/D209330
2024-06-11 09:14:13 +00:00
Sean
a18c979054 Bug 1894288 - Remove network.fetch.redirect.stripAuthHeader and network.http.redirect.stripAuthHeader prefs r=sunil,edgul,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D209393
2024-05-22 15:10:48 +00:00
Tim Huang
cf64742fc5 Bug 1873631 - Part 2: Set the isInThirdPartyContext bit to the loadInfo of the channel for the fetch reqeust in workers. r=bvandersloot,asuth
We propergate the isInThirdPartyContext bit from the workerPrivate to
the fetchDrvier. So, we can set the bit for the channel that loads the
fetch request for workers.

Differential Revision: https://phabricator.services.mozilla.com/D207139
2024-04-22 16:02:51 +00:00
Emilio Cobos Álvarez
de09ab0dd6 Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen
Sorry for the massive patch but I found it hard to split without
introducing a bunch of copies around...

This mostly makes necko and DOM agree on which strings to use, which
should result on less copies and conversions.

Differential Revision: https://phabricator.services.mozilla.com/D205601
2024-04-04 11:49:57 +00:00
Thomas Wisniewski
70221d18ca Bug 1847358 part 3: add a fullMimeType attribute to nsIBaseChannel and use it to make our Data URI content-type header parsing standards-compliant for XHR and Fetch; r=dlrobertson,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D203380
2024-03-04 21:34:27 +00:00
Thomas Wisniewski
d782822b0f Bug 1847358 part 2: create and use nsIBaseChannel to reduce code debt and better-encapsulate logic for range-requests on nsBaseChannel classes; r=dlrobertson,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D203379
2024-03-04 21:34:27 +00:00
Thomas Wisniewski
cb7f1f5558 Bug 1847358 part 1: move nsBaseChannel::ContentRange content out into its own class as mozilla::net::ContentRange; r=dlrobertson,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D203378
2024-03-04 21:34:27 +00:00
Ziran Sun
9064e5419a Bug 1839319 - Add fetchpriority support for fetch() API. r=valentin,necko-reviewers,webidl,saschanaz,fredw
This is to add basic fetch priority support. It introduces preference of
fetch priority adjustment as per to recent discussions. We need to refine the
fetchpriority mapping taking into account of destination, which will be
addressed in Bug 1881040.

In addition, this changes the relervant prefs type to atomic type to accommodate
the access of the prefs off the main thread in the worker case.

Differential Revision: https://phabricator.services.mozilla.com/D200778
2024-02-23 15:14:17 +00:00
Eden Chuang
c215bd9694 Bug 1871498 - Let FetchDriver::RunAbortAlogrithm() resolving FetchInstance::mPromises by calling FetchObserver::OnResponseEnd(). r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D198685
2024-01-29 11:02:14 +00:00
Norisz Fay
cbb0667a13 Backed out changeset 07a3a86e82ee (bug 1871498) for causing multiple leakcheck failures CLOSED TREE 2024-01-25 18:35:45 +02:00
Eden Chuang
222ca6c2de Bug 1871498 - Let FetchDriver::RunAbortAlogrithm() resolving FetchInstance::mPromises by calling FetchObserver::OnResponseEnd(). r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D198685
2024-01-25 13:32:48 +00:00
sunil mayya
e1acb8a42f Bug 1810805 - update mObserver modifications in FetchDriver. r=necko-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D194220
2023-11-27 10:31:54 +00:00
sunil mayya
8fc5324936 Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl
Differential Revision: https://phabricator.services.mozilla.com/D187833
2023-10-27 13:30:11 +00:00
Narcis Beleuzu
a71d185ff5 Backed out 6 changesets (bug 1851992) for DT failure on browser_net_image_cache.js . CLOSED TREE
Backed out changeset 3ceaf46f8f55 (bug 1851992)
Backed out changeset c9d322362e22 (bug 1851992)
Backed out changeset 673df3f83249 (bug 1851992)
Backed out changeset 46e18c56dd39 (bug 1851992)
Backed out changeset f9f9143ac713 (bug 1851992)
Backed out changeset 38c40d735ab7 (bug 1851992)
2023-10-24 13:16:40 +03:00