Commit graph

54 commits

Author SHA1 Message Date
Eden Chuang
bf3fa5100a 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
f6ba398065 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
021d7987c7 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
c871ac466f 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
382c6e8162 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
794756e970 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
ef309febfa Bug 1810816 - P3 Report response timing for PFetch. 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 third patch for reporting the response timing for PFetch.
This patch adds the needed IPC PFetch/Send/RecvOnReportPerformanceTiming to propagate the response timing from the parent process main thread to the content process worker thread.

Depends on D167937

Differential Revision: https://phabricator.services.mozilla.com/D167938
2023-02-23 02:52:54 +00:00
Eden Chuang
5648b756d7 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
Eden Chuang
b5c2505d30 Bug 1810816 - P1 Remove ResponseTiming from ResponseEndArgs. 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 first patch to remove response timing from ResponseEndArgs, and also remove the timing recording from OnResponseEnd for PFetch and ServiceWorker NavigationPreload.

Differential Revision: https://phabricator.services.mozilla.com/D167936
2023-02-23 02:52:53 +00:00
Csoregi Natalia
0b5aa4e516 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
5112380396 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
3f3a5f60c7 Bug 1810816 - P3 Report response timing for PFetch. 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 third patch for reporting the response timing for PFetch.
This patch adds the needed IPC PFetch/Send/RecvOnReportPerformanceTiming to propagate the response timing from the parent process main thread to the content process worker thread.

Depends on D167937

Differential Revision: https://phabricator.services.mozilla.com/D167938
2023-02-22 16:49:51 +00:00
Eden Chuang
8e786e56ce 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
088fcc976b Bug 1810816 - P1 Remove ResponseTiming from ResponseEndArgs. 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 first patch to remove response timing from ResponseEndArgs, and also remove the timing recording from OnResponseEnd for PFetch and ServiceWorker NavigationPreload.

Differential Revision: https://phabricator.services.mozilla.com/D167936
2023-02-22 16:49:50 +00:00
Eden Chuang
2ca58b8fde 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
2a016fbd8d 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
159a61e1f2 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
1037940f5b 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
3d02a65194 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
Nika Layzell
9d6bb19c23 Bug 1809753 - Part 4: Remove unnecessary GetMainThreadEventTarget, r=mccr8
This method always returned GetMainThreadSerialEventTarget(). This patch
switches all callers over to use that method instead.

We can't easily switch all calls to be calls to NS_GetMainThread(), as there is
no version of that method returning a bare nsIThread* instance.

I didn't introduce one, as we may want to add a lock around mMainThread in the
future, which would require removing nsThreadManager::GetMainThreadWeak. As
this method only returns nsISerialEventTarget, it method could remain
implemented, however, by returning a statically allocated fake event target
which forwards dispatches (and QIs to nsIThread) to the real main thread.

Differential Revision: https://phabricator.services.mozilla.com/D166608
2023-01-16 23:14:12 +00:00
Sandor Molnar
41b78439d0 Backed out 6 changesets (bug 1809752, bug 1809753) for causing perma failures in browser/components/firefoxview/tests/browser/browser_feature_callout_position.js
Backed out changeset ea05784d74c4 (bug 1809753)
Backed out changeset 7c9b20eebcc8 (bug 1809753)
Backed out changeset d0267ac2256d (bug 1809753)
Backed out changeset aa9f2971bd6f (bug 1809753)
Backed out changeset f0d9fcfaa6f8 (bug 1809752)
Backed out changeset 6d58c799cffe (bug 1809752)
2023-01-17 03:19:24 +02:00
Nika Layzell
f7772bb6ae Bug 1809753 - Part 4: Remove unnecessary GetMainThreadEventTarget, r=mccr8
This method always returned GetMainThreadSerialEventTarget(). This patch
switches all callers over to use that method instead.

We can't easily switch all calls to be calls to NS_GetMainThread(), as there is
no version of that method returning a bare nsIThread* instance.

I didn't introduce one, as we may want to add a lock around mMainThread in the
future, which would require removing nsThreadManager::GetMainThreadWeak. As
this method only returns nsISerialEventTarget, it method could remain
implemented, however, by returning a statically allocated fake event target
which forwards dispatches (and QIs to nsIThread) to the real main thread.

Differential Revision: https://phabricator.services.mozilla.com/D166608
2023-01-16 23:14:12 +00:00
Butkovits Atila
7855df7caf 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
d71967bf2f 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
0d5b1d231b 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
56ecd30a22 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
sunil mayya
05dc2710d3 Bug 1793736 - Include abort signal reason for fetch. r=necko-reviewers,valentin,tschuster
Differential Revision: https://phabricator.services.mozilla.com/D161669
2022-11-28 10:43:05 +00:00
Butkovits Atila
bf0a7fa012 Backed out changeset 133c9084af25 (bug 1793736) for causing failures at browser_navigationPreload_read_after_respondWith.js. 2022-11-21 19:49:41 +02:00
sunil mayya
6222054cd4 Bug 1793736 - Include abort signal reason for fetch. r=necko-reviewers,valentin,tschuster
Differential Revision: https://phabricator.services.mozilla.com/D161669
2022-11-21 16:56:09 +00:00
Eden Chuang
f03fb58873 Bug 1765777 - Resolve FetchEvent.preloadResponse when the response is available not the response end. r=dom-worker-reviewers,jesup.
In the previous implementation, FetchEvent.preloadResponse is resolved when the response fetching finishes.
However, ServiceWorker responding letency could be increased since waiting for preloadResponse finishes.
The patch resolves FetchEvent.preloadResponse earlier when the response is available.

The basic idea is to resolve the preload response when FetchInstance::OnResponseAvailableInternal() is called.
Then propagating the response from the parent process main thread to the content process worker thread. This is achieved by IPC PFetchEventOp::Send/RecvPreloadResponse -> PFetchEventOpProxy::Send/RecvPreloadResponse.

Since we can only get the response's ResourceTiming when FetchInstance::OnResponseEnd() is called. This patch introduces a new IPC method to propagate the ResourceTiming information from the parent process main thread to the content process worker thread.
PFetchEventOp::Send/RecvPreloadResponseEnd -> PFetchEventOpProxy->Send/RecvPreloadResponseEnd.

The tricky of this patch is we must extend the life cycle of FetchEventOp object if preloadResponse is set into FetchEvent.
That because ServiceWorker could resolve FetchEvent.respondWith() by using FetchEvent.preloadResponse.
In that case, FetchEventOp will get into a finish state and try to call FetchEventOpProxyChild::Senddelete with the operation result.
However, the ResponseEnd could not be called at the moment, and we need to wait for the corresponding timing information and its end reason.
To extend the life cycle of FetchEventOp, this patch cached the operation result while we get FetchEventOp::Callback is called. Then call FetchEventOpProxyChile::Senddelete() in FetchEventOpProxyChild::RecvPreloadResponseEnd() to close IPC. Or Senddelete() will be called while ActorDestroy() caused by shutdown.

Differential Revision: https://phabricator.services.mozilla.com/D145338
2022-05-11 19:40:47 +00:00
Eden Chuang
b764f82c8f Bug 1757147 - make FetchService observe the network status. r=dom-worker-reviewers,asuth,jesup
Differential Revision: https://phabricator.services.mozilla.com/D139953
2022-03-14 15:31:22 +00:00
smolnar
1feca16bdd Backed out changeset 689b9fb1be6d (bug 1757147) for causing build bustages in /dom/fetch/FetchService.cpp CLOSED TREE 2022-03-10 13:03:37 +02:00
Eden Chuang
f0718f68ea Bug 1757147 - make FetchService observe the network status. r=dom-worker-reviewers,asuth,jesup
Differential Revision: https://phabricator.services.mozilla.com/D139953
2022-03-10 09:26:55 +00:00
Jens Stutte
775a7e29a1 Bug 1757514: Ignore missing PerformanceTimingData in OnResponseEnd. r=dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D139918
2022-03-01 12:44:49 +00:00
Eden Chuang
e06a90c8d7 Bug 1754365 - Saving NavigationPreload's PerformanceTimingData into worker's PerformanceStorage. r=dom-worker-reviewers,jesup
Depends on D138251

Differential Revision: https://phabricator.services.mozilla.com/D138252
2022-02-27 00:26:22 +00:00
Eden Chuang
2c0fec1d03 Bug 1754365 - Create IPC for transferring NavigationPreload's PerformanceTimingData. r=dom-worker-reviewers,jesup
Depends on D138250

Differential Revision: https://phabricator.services.mozilla.com/D138251
2022-02-27 00:26:22 +00:00
Eden Chuang
9975a42d06 Bug 1754365 - Getting PerformanceTimingData from channel for FetchService. r=dom-worker-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D138249
2022-02-27 00:26:21 +00:00
Marian-Vasile Laza
af4995d8ba Backed out 4 changesets (bug 1754365) for causing wpt failures on service-worker/navigation-headers.https.html. CLOSED TREE
Backed out changeset 9ee546b9fd2b (bug 1754365)
Backed out changeset cf972fe0d961 (bug 1754365)
Backed out changeset f8afd25bf41e (bug 1754365)
Backed out changeset 34d4e99f8219 (bug 1754365)
2022-02-26 01:51:59 -08:00
Eden Chuang
d3aabddeb0 Bug 1754365 - Saving NavigationPreload's PerformanceTimingData into worker's PerformanceStorage. r=dom-worker-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D138252
2022-02-26 08:40:26 +00:00
Eden Chuang
abba984a19 Bug 1754365 - Create IPC for transferring NavigationPreload's PerformanceTimingData. r=dom-worker-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D138251
2022-02-26 08:40:26 +00:00
Eden Chuang
a45f67f6fa Bug 1754365 - Getting PerformanceTimingData from channel for FetchService. r=dom-worker-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D138249
2022-02-26 08:40:25 +00:00
Eden Chuang
0a82cc9f46 Bug 1755416 - Using ChannelURI to create principal for NavigationPreload channel. r=dom-worker-reviewers,smaug,asuth
Differential Revision: https://phabricator.services.mozilla.com/D138783
2022-02-25 13:16:28 +00:00
Eden Chuang
7e7901fca2 Bug 1753025 - Adding debugging log for FetchSerivce/FetchInstance. r=dom-worker-reviewers,jesup
Depends on D137594

Differential Revision: https://phabricator.services.mozilla.com/D137599
2022-02-09 07:14:25 +00:00
Eden Chuang
a319862300 Bug 1753025 - Using correct principal to create channel for NavigationPreload. r=dom-worker-reviewers,jesup
Currently using the pricinpal of InternalRequest to create the channel for NavigationPreload.
However, it is not a correct principal and makes NavigationPreload stop with channel security checking.
Instead of using the principal of InternalRequest, this patch uses the loadingPrincipal of InterceptedHttpChannel to create the channel.

Differential Revision: https://phabricator.services.mozilla.com/D137594
2022-02-09 07:14:25 +00:00
Marian-Vasile Laza
a9f8213954 Backed out 3 changesets (bug 1750515, bug 1753025) for causing wpt failures on idlharness.https.any... CLOSED TREE
Backed out changeset 9771e7cbe148 (bug 1750515)
Backed out changeset f671d5206b88 (bug 1753025)
Backed out changeset 99bacb6a3d92 (bug 1753025)
2022-02-09 00:10:47 +02:00
Eden Chuang
2026337440 Bug 1753025 - Adding debugging log for FetchSerivce/FetchInstance. r=dom-worker-reviewers,jesup
Depends on D137594

Differential Revision: https://phabricator.services.mozilla.com/D137599
2022-02-08 18:12:34 +00:00
Eden Chuang
792a165fb9 Bug 1753025 - Using correct principal to create channel for NavigationPreload. r=dom-worker-reviewers,jesup
Currently using the pricinpal of InternalRequest to create the channel for NavigationPreload.
However, it is not a correct principal and makes NavigationPreload stop with channel security checking.
Instead of using the principal of InternalRequest, this patch uses the loadingPrincipal of InterceptedHttpChannel to create the channel.

Differential Revision: https://phabricator.services.mozilla.com/D137594
2022-02-08 18:12:34 +00:00
criss
3b218d4269 Backed out 3 changesets (bug 1753025, bug 1750515) for causing build bustages on Logging.h
Backed out changeset c07607b89a61 (bug 1750515)
Backed out changeset 09f9724c8c1c (bug 1753025)
Backed out changeset 90e9e803f010 (bug 1753025)
2022-02-08 17:52:43 +02:00
Eden Chuang
cd7727939d Bug 1753025 - Adding debugging log for FetchSerivce/FetchInstance. r=dom-worker-reviewers,jesup
Depends on D137594

Differential Revision: https://phabricator.services.mozilla.com/D137599
2022-02-08 11:01:21 +00:00
Eden Chuang
42dfc17202 Bug 1753025 - Using correct principal to create channel for NavigationPreload. r=dom-worker-reviewers,jesup
Currently using the pricinpal of InternalRequest to create the channel for NavigationPreload.
However, it is not a correct principal and makes NavigationPreload stop with channel security checking.
Instead of using the principal of InternalRequest, this patch uses the loadingPrincipal of InterceptedHttpChannel to create the channel.

Differential Revision: https://phabricator.services.mozilla.com/D137594
2022-02-08 11:01:21 +00:00