Commit Graph

67 Commits

Author SHA1 Message Date
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
Eden Chuang
234eab4e05 Bug 1947434 - Use default memory ordering policy for FetchInstance::mActorDying. r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D237699
2025-02-12 08:57:20 +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
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
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
Eden Chuang
1cad963a91 Bug 1819570 - P4 Propagte stack trace notification back to the content process for PFetch. r=asuth
After PFetch is enabled, fetch() call in workers will not create a channel in the content process anymore.
Although netmonitor watches channels and NetEvents, stack traces are only caught in the content process.
That means PFetch should notify the netmonitor about the stack trace of the fetch at the proper moment.

In original fetch steps, FetchDriver would notify the netmonitor the fetch stack trace at
https://searchfox.org/mozilla-central/rev/cdddec7fd690700efa4d6b48532cf70155e0386b/dom/fetch/FetchDriver.cpp#834

When PFetch is enabled, PFetch needs also to propagate this notification back to the content process.

Depends on D174442

Differential Revision: https://phabricator.services.mozilla.com/D174443
2023-05-05 15:24:10 +00:00
Eden Chuang
bbe5d99867 Bug 1819570 - P1 Propagate worker's assocaited BrowsingContextID through PFetch to the parent process. r=asuth
After PFetch is enabled, fetch() call in workers will not create a channel in the content process anymore.
Although netmonitor also watches the channels in the parent process, the created channel still loses the BrowsingContext information for netmonitor to connect the network event and the channel.

This patch is the first part to propagte the worker's associated BrowsingContextID to the parent process through PFetch.

Differential Revision: https://phabricator.services.mozilla.com/D174249
2023-05-05 15:24:09 +00:00
Iulian Moraru
3c45645f59 Backed out 5 changesets (bug 1819570) for causing dt failures on browser_net_worker_stacks.js. CLOSED TREE
Backed out changeset e73379145f9a (bug 1819570)
Backed out changeset addc41903c2f (bug 1819570)
Backed out changeset c8534cf58f86 (bug 1819570)
Backed out changeset 81e926cf92dc (bug 1819570)
Backed out changeset 7d73ec5415a4 (bug 1819570)
2023-05-04 07:19:13 +03:00
Eden Chuang
fdbcb9980c Bug 1819570 - P4 Propagte stack trace notification back to the content process for PFetch. r=asuth
After PFetch is enabled, fetch() call in workers will not create a channel in the content process anymore.
Although netmonitor watches channels and NetEvents, stack traces are only caught in the content process.
That means PFetch should notify the netmonitor about the stack trace of the fetch at the proper moment.

In original fetch steps, FetchDriver would notify the netmonitor the fetch stack trace at
https://searchfox.org/mozilla-central/rev/cdddec7fd690700efa4d6b48532cf70155e0386b/dom/fetch/FetchDriver.cpp#834

When PFetch is enabled, PFetch needs also to propagate this notification back to the content process.

Depends on D174442

Differential Revision: https://phabricator.services.mozilla.com/D174443
2023-05-04 02:46:31 +00:00
Eden Chuang
36e87d7240 Bug 1819570 - P1 Propagate worker's assocaited BrowsingContextID through PFetch to the parent process. r=asuth
After PFetch is enabled, fetch() call in workers will not create a channel in the content process anymore.
Although netmonitor also watches the channels in the parent process, the created channel still loses the BrowsingContext information for netmonitor to connect the network event and the channel.

This patch is the first part to propagte the worker's associated BrowsingContextID to the parent process through PFetch.

Differential Revision: https://phabricator.services.mozilla.com/D174249
2023-05-04 02:46:31 +00:00
Eden Chuang
f06471a5bb Bug 1810816 - P4 Report the preload response timing for ServiceWorker NavigationPreload. r=dom-worker-reviewers,asuth
Response Timing should be reported before the body stream completing.

In the original implementation, the response timing is recorded when OnResponseEnd is called, but it is too late. Response timing could not be ready when response.text() or response.blob() resolves the promise.

This is the fourth patch for reporting the preload response timing for ServiceWorker NavigationPreload.
This patch adds the needed IPCs PFetchEventOp and PFetchEventOpProxy to propagate the preload response timing from the parent process main thread to the content process worker thread.
Since navigation preload is an asynchronous action, corresponding promises for asynchronous propagation are also created in FetchService, FetchEventOpChild, FetchEventOpProxyChild, and FetchEventOp.

Depends on D167938

Differential Revision: https://phabricator.services.mozilla.com/D167939
2023-02-23 02:52:54 +00:00
Eden Chuang
6c50593abe Bug 1810816 - P2 Add new interface OnReportPerformanceTiming on FetchDriverObserver. r=dom-worker-reviewers,asuth
Response Timing should be reported before the body stream completing.

In the original implementation, the response timing is recorded when OnResponseEnd is called, but it is too late. Response timing could not be ready when response.text() or response.blob() resolves the promise.

This is the second patch to add a new interface OnReportPerformanceTiming() on FetchDriverObserver, so FetchDriver could control when to report the response timing.
The patch gives an empty implementation in FetchDriverObserver for MainThreadFetchResolver and WorkerFetchResolver. And FetchInstace overrides the method for PFetch and ServiceWorker NavigationPreload.

Depends on D167936

Differential Revision: https://phabricator.services.mozilla.com/D167937
2023-02-23 02:52:54 +00:00
Csoregi Natalia
5386413ef4 Backed out 4 changesets (bug 1810816) for causing high rate failures on /service-workers/service-worker/navigation-headers.https.html. CLOSED TREE
Backed out changeset 2479dc798994 (bug 1810816)
Backed out changeset e5eacedc370d (bug 1810816)
Backed out changeset b52649243851 (bug 1810816)
Backed out changeset 0aea172f9dd3 (bug 1810816)
2023-02-22 22:39:38 +02:00
Eden Chuang
65ad2f69f0 Bug 1810816 - P4 Report the preload response timing for ServiceWorker NavigationPreload. r=dom-worker-reviewers,asuth
Response Timing should be reported before the body stream completing.

In the original implementation, the response timing is recorded when OnResponseEnd is called, but it is too late. Response timing could not be ready when response.text() or response.blob() resolves the promise.

This is the fourth patch for reporting the preload response timing for ServiceWorker NavigationPreload.
This patch adds the needed IPCs PFetchEventOp and PFetchEventOpProxy to propagate the preload response timing from the parent process main thread to the content process worker thread.
Since navigation preload is an asynchronous action, corresponding promises for asynchronous propagation are also created in FetchService, FetchEventOpChild, FetchEventOpProxyChild, and FetchEventOp.

Depends on D167938

Differential Revision: https://phabricator.services.mozilla.com/D167939
2023-02-22 16:49:51 +00:00
Eden Chuang
70f3fc8d5b Bug 1810816 - P2 Add new interface OnReportPerformanceTiming on FetchDriverObserver. r=dom-worker-reviewers,asuth
Response Timing should be reported before the body stream completing.

In the original implementation, the response timing is recorded when OnResponseEnd is called, but it is too late. Response timing could not be ready when response.text() or response.blob() resolves the promise.

This is the second patch to add a new interface OnReportPerformanceTiming() on FetchDriverObserver, so FetchDriver could control when to report the response timing.
The patch gives an empty implementation in FetchDriverObserver for MainThreadFetchResolver and WorkerFetchResolver. And FetchInstace overrides the method for PFetch and ServiceWorker NavigationPreload.

Depends on D167936

Differential Revision: https://phabricator.services.mozilla.com/D167937
2023-02-22 16:49:50 +00:00
Eden Chuang
6f4cd78191 Bug 1351231 - FetchService integration for PFetch. r=dom-worker-reviewers,jesup
Depends on D142436

Differential Revision: https://phabricator.services.mozilla.com/D142437
2023-01-20 09:09:17 +00:00
Noemi Erli
64b4ccc119 Backed out 5 changesets (bug 1351231) for causing multiple wpt failures CLOSED TREE
Backed out changeset 257553919696 (bug 1351231)
Backed out changeset 4fd92351d64b (bug 1351231)
Backed out changeset 7a4e3f5f674a (bug 1351231)
Backed out changeset 9da00c1364a5 (bug 1351231)
Backed out changeset 19b78046ffef (bug 1351231)
2023-01-18 18:16:01 +02:00
Eden Chuang
5d56464868 Bug 1351231 - FetchService integration for PFetch. r=dom-worker-reviewers,jesup
Depends on D142436

Differential Revision: https://phabricator.services.mozilla.com/D142437
2023-01-18 00:50:20 +00:00
Marian-Vasile Laza
36626c8b7e Backed out 5 changesets (bug 1351231) for causing multiple wpt failures. CLOSED TREE
Backed out changeset a41252141399 (bug 1351231)
Backed out changeset 6cbb442f4772 (bug 1351231)
Backed out changeset dbdca4661a35 (bug 1351231)
Backed out changeset ea27cd66fefd (bug 1351231)
Backed out changeset 8c21c9468949 (bug 1351231)
2023-01-17 19:53:09 +02:00
Eden Chuang
32eac38347 Bug 1351231 - FetchService integration for PFetch. r=dom-worker-reviewers,jesup
Depends on D142436

Differential Revision: https://phabricator.services.mozilla.com/D142437
2023-01-17 15:13:46 +00:00
Butkovits Atila
24e4985a7a Backed out 5 changesets (bug 1351231) for causing fetch related failures. CLOSED TREE
Backed out changeset da5c4a821428 (bug 1351231)
Backed out changeset 66b279e5a513 (bug 1351231)
Backed out changeset 3eb8fdd0ba6d (bug 1351231)
Backed out changeset a1fcf22a2a0e (bug 1351231)
Backed out changeset fd2a843599d1 (bug 1351231)
2023-01-12 20:20:14 +02:00
Eden Chuang
2bafa9b267 Bug 1351231 - FetchService integration for PFetch. r=dom-worker-reviewers,jesup
Depends on D142436

Differential Revision: https://phabricator.services.mozilla.com/D142437
2023-01-12 17:24:28 +00:00
Stanca Serban
937d8d1fd4 Backed out 5 changesets (bug 1351231) for Fetch related failures. CLOSED TREE
Backed out changeset cc26eeeaf3dd (bug 1351231)
Backed out changeset c0cb3c17f246 (bug 1351231)
Backed out changeset 84162d09eef8 (bug 1351231)
Backed out changeset 5c3b5a384f2f (bug 1351231)
Backed out changeset d8fa8a006948 (bug 1351231)
2023-01-12 18:56:25 +02:00
Eden Chuang
b62bded106 Bug 1351231 - FetchService integration for PFetch. r=dom-worker-reviewers,jesup
Depends on D142436

Differential Revision: https://phabricator.services.mozilla.com/D142437
2023-01-12 15:09:45 +00:00