Commit Graph
104 Commits
Author SHA1 Message Date
Nika Layzell e7bf4a196f Bug 2005006 - Store parsed URIs in InternalRequest/InternalResponse, r=dom-core,dom-worker-reviewers,necko-reviewers,smaug,kershaw,edenchuang
This patch updates InternalRequest and InternalResponse such that it parses the
URL passed to it at creation time, rather than when the channel is created.
This should improve the behaviour of these types around Blob URLs, so that
extra state, such as the "revoked" flag, is calculated at the correct time
as-per spec.

While making this change, I noticed that a previous Cache DB migration could
insert an "" URL in the DB when migrating from a single response URL to a URL
list, rather than storing an empty URL list. The choice was made to do
filtering when reading, rather than performing a migration, to avoid migration
first-time start-up overhead.

Differential Revision: https://phabricator.services.mozilla.com/D276047
2026-04-10 19:23:59 +00:00
Nika Layzell 5f0f9dd22a Bug 2020817 - Part 4: Annotate & clean up nsACString callers of BeginReading/Data, r=xpcom-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,toolkit-telemetry-reviewers-rotation,layout-reviewers,dom-worker-reviewers,gfx-reviewers,webgpu-reviewers,necko-reviewers,dom-core,smaug,handyman,emilio,pehrsons,kershaw,timhuang,edenchuang,padenot,bradwerth
This is a large number of largely mechanical changes. When possible, the code
was called to directly call `.get()` instead, performing the assertions
manually. In many places PromiseFlatCString() calls were added to dynamically
copy the strings into null terminated buffers if the string was not null
terminated.

Differential Revision: https://phabricator.services.mozilla.com/D286158
2026-03-25 08:23:04 +00:00
Tom Schuster 22deadcb9a Bug 2012984 - Use the ClientInfo for fetch with keepalive. r=sunil
Differential Revision: https://phabricator.services.mozilla.com/D280924
2026-02-09 11:19:19 +00:00
Tom Forbes 4552a2f867 Bug 1897424 - Add NotifyNetworkMonitorAlternateStack support for main-thread fetch requests. r=sunil,devtools-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D270808
2025-11-21 10:16:13 +00:00
Narcis Beleuzu b181b99b83 Revert "Bug 1897424 - Add NotifyNetworkMonitorAlternateStack support for main-thread fetch requests. r=sunil,devtools-reviewers,bomsy" for causing bustages on FetchChild.cpp
This reverts commit a49d577a22.
2025-11-17 10:19:18 +00:00
Tom Forbes a49d577a22 Bug 1897424 - Add NotifyNetworkMonitorAlternateStack support for main-thread fetch requests. r=sunil,devtools-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D270808
2025-11-17 09:43:21 +00:00
serge-sans-paille f61f1d17c2 Bug 1996566 - Remove unused mfbt inclusion in dom/** r=emilio,media-playback-reviewers,dom-storage-reviewers,dom-worker-reviewers,jari,alwu,asuth
Differential Revision: https://phabricator.services.mozilla.com/D270172
2025-10-28 07:24:25 +00:00
smayya 673deb9045 Bug 1989182 - remove fetch keepalive metrics. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D267319
2025-10-06 12:57:23 +00:00
Emilio Cobos Álvarez 791917d8af Bug 1976665 - Sort headers in dom/. r=dom-core,media-playback-reviewers,webrtc-reviewers,dom-storage-reviewers,padenot,janv,smaug,jesup,jib
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.

Differential Revision: https://phabricator.services.mozilla.com/D256800
2025-08-05 11:47:34 +00:00
Tim Huang 7625948b4a Bug 1968644 - Part 3: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for fetch requests. r=valentin,smaug
Differential Revision: https://phabricator.services.mozilla.com/D252444
2025-06-17 20:28:15 +00:00
agoloman a48b34690b Revert "Bug 1968644 - Part 10: Store JSCallingLocation and set the JSCallingLocation fallback for Media loads. r=emilio" for causing valgrid failures.
This reverts commit efd9a5ba48.

Revert "Bug 1968644 - Part 9: Add more tests for loads triggered by tracking scripts. r=valentin,anti-tracking-reviewers,emz"

This reverts commit 7d5c3e1c1c.

Revert "Bug 1968644 - Part 8: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for WebSocket requests. r=valentin,necko-reviewers"

This reverts commit 53a783a51e.

Revert "Bug 1968644 - Part 7: Add tests. r=necko-reviewers,anti-tracking-reviewers,emz,valentin"

This reverts commit e52f034955.

Revert "Bug 1968644 - Part 6: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags during channel creation. r=necko-reviewers,kershaw"

This reverts commit f564c21b37.

Revert "Bug 1968644 - Part 5: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for CSS loads. r=emilio"

This reverts commit 8a8fd7bacc.

Revert "Bug 1968644 - Part 4: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for loads. r=smaug,necko-reviewers"

This reverts commit 7b3ba3b668.

Revert "Bug 1968644 - Part 3: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for fetch requests. r=valentin,smaug"

This reverts commit 08f090244f.

Revert "Bug 1968644 - Part 2: Intorduce the ClassificationFlags to nsIClassifiedChannel.idl. r=dimi,necko-reviewers,valentin"

This reverts commit b8c01cd77c.

Revert "Bug 1968644 - Part 1: Introduce triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags to LoadInfo. r=necko-reviewers,kershaw"

This reverts commit a7619a72b4.
2025-06-17 14:27:29 +00:00
Tim Huang 08f090244f Bug 1968644 - Part 3: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for fetch requests. r=valentin,smaug
Differential Revision: https://phabricator.services.mozilla.com/D252444
2025-06-17 09:24:39 +00:00
Eden Chuang 0dd34d4e02 Bug 1963402 - Using DirectTaskDispatch for MozPromises related to FetchService. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D247131
2025-05-02 10:08:13 +00:00
Nika Layzell 3fedfa61ee Bug 1869650 - Remove MozPromise::IsResolved(), r=edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D238312
2025-02-18 20:40:20 +00:00
Florian Quèze 9609e47f62 Bug 1879329 - script generated replacement of the GleanMetrics.h includes, r=chutten,valentin,media-playback-reviewers,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,rkraesig,emz,aabh,padenot.
Differential Revision: https://phabricator.services.mozilla.com/D234744
2025-01-21 11:21:45 +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
smayya 6b4a826e78 Bug 1914632 - delete the actors during shutdown for worker keepalive requests.r=edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D222437
2024-09-24 17:10:06 +00:00
Butkovits Atila 47fc85341d Backed out 5 changesets (bug 1906952, bug 1914632, bug 1901761) for causing bustage at RefPtr.h. CLOSED TREE
Backed out changeset 4dadc74e5e51 (bug 1906952)
Backed out changeset 0689a41fae4c (bug 1914632)
Backed out changeset 1f93aaf15cf6 (bug 1914632)
Backed out changeset 37dbae4a6310 (bug 1914632)
Backed out changeset 177540310817 (bug 1901761)
2024-09-24 17:21:15 +03:00
smayya fe6c28d58c Bug 1914632 - delete the actors during shutdown for worker keepalive requests.r=edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D222437
2024-09-24 11:30:22 +00:00
Eden Chuang e3bc06ab76 Bug 1843001 - Allow fetch() to localhost in Workers while network is offline. r=asuth,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D198374
2024-09-23 09:07:52 +00:00
Iulian Moraru dc9aa53939 Backed out changeset 87f698d4fb8e (bug 1843001) for causing mochitest-plain failures on test_offline_localhost_fetch.html. CLOSED TREE 2024-08-15 12:11:13 +03:00
Eden Chuang 84375a3245 Bug 1843001 - Allow fetch() to localhost in Workers while network is offline. r=asuth,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D198374
2024-08-15 08:08:05 +00:00
smayya 3f8ca9b3b3 Bug 1873551 - Add telemetry probes for fetch keepalive. r=necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D218923
2024-08-14 09:51:36 +00:00
smayya 59782cfd9f Bug 1871382 - restrict fetch keepalive requests. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D216431
2024-08-08 17:35:52 +00:00
Noemi Erli 82c5b2c877 Backed out 3 changesets (bug 1871382, bug 1871395) for causing failures in request-keepalive-quota.html CLOSED TREE
Backed out changeset db259b914881 (bug 1871382)
Backed out changeset 39b043126eb2 (bug 1871382)
Backed out changeset 8b75d052771e (bug 1871395)
2024-08-08 01:22:05 +03:00
smayya f6be5db070 Bug 1871382 - restrict fetch keepalive requests. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D216431
2024-08-07 14:29:51 +00:00
sunil mayya 49fe950242 Bug 1871376 - route keepalive request through PFetchChild. r=edenchuang,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D205720
2024-06-13 06:27:18 +00:00
Iulian Moraru bc68aef5bf Backed out 3 changesets (bug 1871377, bug 1871376) for causing multiple failures on FetchChild.cpp.
Backed out changeset f40672b20c47 (bug 1871377)
Backed out changeset 39c159dbb3c6 (bug 1871376)
Backed out changeset a1120bbddda2 (bug 1871376)
2024-06-12 07:25:56 +03:00
sunil mayya 1883fa58d0 Bug 1871376 - route keepalive request through PFetchChild. r=edenchuang,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D205720
2024-06-11 17:44:20 +00:00
Tamas Szentpeteri 48ad0d9ebc Backed out 2 changesets (bug 1871376, bug 1871377) for causing bp-nu bustages related to RefPtr.h. CLOSED TREE.
Backed out changeset b2f28e905212 (bug 1871377)
Backed out changeset 46f26b4f249d (bug 1871376)
2024-06-11 01:00:02 +03:00
sunil mayya 7ad10cce40 Bug 1871376 - route keepalive request through PFetchChild. r=edenchuang,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D205720
2024-06-10 19:21:06 +00:00
Ray Kraesig 286effabaf Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio
All present uses of the call-site arguments to MozPromise's methods
supply static strings. However, this is nowhere enforced. Do so.

Additionally, since this is the third or fourth time the present author
alone has personally implemented such an enforcement mechanism, create a
helper class to simplify doing so.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D207462
2024-04-24 17:02:49 +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
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
Sandor Molnar b11982233f Backed out changeset 606288b34ee6 (bug 1871498) for causing xpc crashes @ mozilla::dom::FetchService::FetchInstance::OnResponseEnd CLOSED TREE 2024-01-24 13:17:50 +02:00
Eden Chuang 7627cc7b49 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-24 08:55:43 +00:00
Eden Chuang 1d9ca964aa Bug 1845317 - Propagate error response to Worker for PFetch before FetchDriver is created. r=dom-worker-reviewers,smaug
[[ https://searchfox.org/mozilla-central/rev/da1e39f50ef43145623938141c970437b226da9e/dom/fetch/FetchService.cpp#591 | fetch() in Workers when network is offline would returns a NetworkError response]], but this error response is not propagated through PFetch.

Before FetchInstance is created in the parent process, any errors should be propagated to the Worker.
This patch modifies the FetchService::NetworkErrorResponse() method to propagate the error to worker when PFetch is used.
To propagate the error, additional parameter FetchArgs is needed for FetchService::NetworkErrorResponse().
Since the propagation would only work when the FetchArgs is a WorkerFetchArgs, it gets a default parameter with UnknownArgs for other cases.
Here using UnknownArgs since it can meet errors while generating other types FetchArgs.

Differential Revision: https://phabricator.services.mozilla.com/D186125
2023-08-30 08:41:21 +00:00
Natalia Csoregi 72ecba1503 Backed out 2 changesets (bug 1845317) for causing bustage on FetchService.cpp. CLOSED TREE
Backed out changeset 3cda108b0c50 (bug 1845317)
Backed out changeset c6322668cd35 (bug 1845317)
2023-08-29 19:53:18 +03:00
Eden Chuang d958745e90 Bug 1845317 - Propagate error response to Worker for PFetch before FetchDriver is created. r=dom-worker-reviewers,smaug
[[ https://searchfox.org/mozilla-central/rev/da1e39f50ef43145623938141c970437b226da9e/dom/fetch/FetchService.cpp#591 | fetch() in Workers when network is offline would returns a NetworkError response]], but this error response is not propagated through PFetch.

Before FetchInstance is created in the parent process, any errors should be propagated to the Worker.
This patch modifies the FetchService::NetworkErrorResponse() method to propagate the error to worker when PFetch is used.
To propagate the error, additional parameter FetchArgs is needed for FetchService::NetworkErrorResponse().
Since the propagation would only work when the FetchArgs is a WorkerFetchArgs, it gets a default parameter with UnknownArgs for other cases.
Here using UnknownArgs since it can meet errors while generating other types FetchArgs.

Differential Revision: https://phabricator.services.mozilla.com/D186125
2023-08-29 15:08:07 +00:00