Граф коммитов

5432 Коммитов

Автор SHA1 Сообщение Дата
Iulian Moraru 0b9ff7e847 Backed out changeset 7336444140d0 (bug 1757485) for causing multiple failures. CLOSED TREE 2022-04-11 19:05:14 +03:00
Jens Stutte 80f2314256 Bug 1757485: Make WorkerRef::Notify safe for reentrance. r=dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D143364
2022-04-11 14:56:42 +00:00
Jens Stutte 4b422845c8 Bug 1763390: Destroy the cycle collector explicitely in WorkerThreadPrimaryRunnable before checking the global scope sentinels. r=dom-worker-reviewers,smaug
There is a difference between

a) the cycle collector being shut down and
b) the JSContext being destroyed entirely

We can use weak references to cycle collected objects after the CC is destroyed, but not after the JSContext is destroyed.

Thus we need to move `nsCycleCollector_shutdown();` out of the `~WorkerJSContext()` and ensure we check our sentinels before we destroy it.

Differential Revision: https://phabricator.services.mozilla.com/D143061
2022-04-07 07:38:12 +00:00
Narcis Beleuzu 1f263e9a1f Merge autoland to mozilla-central. a=merge 2022-04-02 12:40:22 +03:00
Tom Schuster 2e72af38c0 Bug 1753309 - Implement AbortSignal.timeout() r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D137900
2022-04-01 17:15:19 +00:00
Randell Jesup ea1a74bb1e Bug 1760662 - DOM worker thread-safety annotations r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D130594
2022-04-01 15:44:23 +00:00
Norisz Fay cf2e0033db Backed out changeset baed7a5596e1 (bug 1760662) for causing build bustages on WorkerPrivate.h CLOSED TREE 2022-03-31 18:46:00 +03:00
Randell Jesup 5ef8024075 Bug 1760662 - DOM worker thread-safety annotations r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D130594
2022-03-31 14:08:13 +00:00
Gijs Kruitbosch 8e67201171 Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 16:16:42 +00:00
Norisz Fay acdd6851cd Backed out 2 changesets (bug 1753696) for causing multiple dt and bc failures CLOSED TREE
Backed out changeset 67fd9edfbcea (bug 1753696)
Backed out changeset a9d957ea887b (bug 1753696)
2022-03-30 12:17:55 +03:00
Gijs Kruitbosch 27039e2946 Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 08:18:51 +00:00
Butkovits Atila f60ac86be0 Backed out 2 changesets (bug 1728331) for causing failures at RTCPeerConnection-videoDetectorTest.html. CLOSED TREE
Backed out changeset b6649f0253c5 (bug 1728331)
Backed out changeset e9242af1224d (bug 1728331)
2022-03-29 00:04:47 +03:00
Nika Layzell 66b31a7ed2 Bug 1728331 - Part 1: Avoid cycling between processes when navigating within a tab, r=smaug
This patch replaces the previous process selection infrastructure with a
new setup implemented entirely in C++, which should more accurately
track the set of processes in use, and should encourage re-use of the
existing content process when navigating by not counting the current
tab.

This approach intentionally allows for process switching to another
process during navigation if there is uneven load between processes to
encourage balanced process use.

I think this may also fix some of the session restore issues with many
tabs using the same process, rather than being spread over 4, as we now
track a tab earlier in its lifecycle before the BrowserParent instance
is created.

Differential Revision: https://phabricator.services.mozilla.com/D126405
2022-03-28 16:18:04 +00:00
Olli Pettay ebe85cf3fa Bug 1756172, Make also DebuggerScope support weak references, r=asuth
Depends on D141507

Differential Revision: https://phabricator.services.mozilla.com/D142057
2022-03-25 15:36:52 +00:00
Jens Stutte 176025dddc Bug 1756172: Unroot the global scopes only after the last worker event ran. r=dom-worker-reviewers,asuth,smaug
The patch D138442 wanted to guard us against the late use of global scope's reference to WorkerPrivate by nulling it out. The rational behind this was to enforce the invariant, that a `WorkerGlobalScopeBase` derived object should never outlive its `WorkerPrivate`. It turned out that during further worker cleanup at the end of `WorkerThreadPrimaryRunnable::Run` we still process pending events (while the `WorkerPrivate` is still alive) that might want to access the global scope and in particular its `mWorkerPrivate` legitimately.

The purpose of this patch is to:

 - Postpone the unrooting until after the last expected event processing.
 - Enforce the invariant "Lifetime(global scope) < Lifetime(WorkerPrivate)" by asserting that the global scope went away after GC/CC.
 - Do the nulling of global scope's `mWorkerPrivate` only if needed after the CC shut down.
 - Do the nulling of debugger global scope's `mWorkerPrivate` while unrooting as it does not support weak references.

Differential Revision: https://phabricator.services.mozilla.com/D141507
2022-03-25 15:36:51 +00:00
Ryan Hunt 3ebced7e17 Bug 1761257 - wasm: Update interface tests for exception handling shipping. r=yury
Differential Revision: https://phabricator.services.mozilla.com/D142008
2022-03-25 15:35:38 +00:00
Jens Stutte c4335b4781 Bug 1761459: Make AssertIsOnWorkerThread independent from mWorkerPrivate in worker scopes. r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D142058
2022-03-25 13:00:30 +00:00
criss a817ec0742 Backed out 3 changesets (bug 1752907) for casuing failures on browser_navigator.js. CLOSED TREE
Backed out changeset 747092282e35 (bug 1752907)
Backed out changeset e50ad7304c18 (bug 1752907)
Backed out changeset e6c18f35ac5f (bug 1752907)
2022-03-24 19:11:59 +02:00
asharma 430822123f Bug 1752907: Cut over Hardware Concurrency to finer-grained RFP Check r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D137481
2022-03-24 13:43:44 +00:00
Nika Layzell 5b2ada26c5 Bug 1738103 - Part 4: Add XPCOM support for shutdown tasks, r=necko-reviewers,KrisWright
Tasks registered with shutdown tasks are called when the target
nsISerialEventTarget is about to be destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D129840
2022-03-23 22:22:04 +00:00
Joel Maher 583e9dece9 Bug 1759035 - disable xpcshell tests that fail with socketprocess_networking and fission.autostart=true|false. r=kershaw,application-update-reviewers,nalexander,zombie
Differential Revision: https://phabricator.services.mozilla.com/D140841
2022-03-23 21:40:23 +00:00
Tom Ritter 9664c43d70 Bug 1752907: Correctly populate the RFP member on Workers r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D141753
2022-03-23 19:01:50 +00:00
Eden Chuang b1c9671000 Bug 1545733 - Don't call WorkerPrivate::Cancel() in RemoteWorkerChild::CloseWorkerOnMainThread() if RemoteWorkerChild::mState(Pending).mWorkerPrivate is nullptr. r=dom-worker-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D141721
2022-03-23 09:19:29 +00:00
Matthew Gaudet 6450bc232b Bug 1759597 - Enable WritableStreams and pipeTo by default r=smaug
* TextEncoder stream tests now fail, rather than error
* WritableStreams are exosed on worker interfacess now; and broken-then is fixed too
* Fix interface semantics

Differential Revision: https://phabricator.services.mozilla.com/D141125
2022-03-22 20:33:04 +00:00
Emilio Cobos Álvarez 2b25e0298a Bug 1758702 - Avoid including RemoteWorkerChild in WorkerPrivate.h. r=asuth
This avoids having to include PRemoteBrowser* headers etc, which are not
exported otherwise.

Differential Revision: https://phabricator.services.mozilla.com/D140659
2022-03-17 19:06:51 +00:00
Randell Jesup c5917ed65a Bug 1207753: Basic thread-safety annotations to quiet errors until real annotations land r=nika
Differential Revision: https://phabricator.services.mozilla.com/D141062
2022-03-17 18:39:15 +00:00
Emilio Cobos Álvarez b055f536ea Bug 1758702 - Allow ThreadSafeWeakPtr<IncompleteType> to work. r=glandium
This will be used to avoid problematic includes from WorkerPrivate.h,
and it matches the behavior of RefPtr<> and WeakPtr<>.

Differential Revision: https://phabricator.services.mozilla.com/D140658
2022-03-17 15:24:40 +00:00
criss 9302fa739c Backed out 2 changesets (bug 1758702) for causing build bustages. CLOSED TREE
Backed out changeset 3e00d9203851 (bug 1758702)
Backed out changeset 66625baf0875 (bug 1758702)
2022-03-17 15:21:31 +02:00
Emilio Cobos Álvarez dd7770da6c Bug 1758702 - Avoid including RemoteWorkerChild in WorkerPrivate.h. r=asuth
This avoids having to include PRemoteBrowser* headers etc, which are not
exported otherwise.

Differential Revision: https://phabricator.services.mozilla.com/D140659
2022-03-17 12:15:20 +00:00
Emilio Cobos Álvarez 370bce32dc Bug 1758702 - Allow ThreadSafeWeakPtr<IncompleteType> to work. r=glandium
This will be used to avoid problematic includes from WorkerPrivate.h,
and it matches the behavior of RefPtr<> and WeakPtr<>.

Differential Revision: https://phabricator.services.mozilla.com/D140658
2022-03-17 12:15:20 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Matthew Gaudet 4186ebdfcc Bug 1759605 - Expose missing ReadableStream interfaces (as defined by WebIDL) r=saschanaz,webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D141126
2022-03-16 15:28:03 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Emilio Cobos Álvarez 2dd7088690 Bug 1759163 - Add origin trial support for worklets. r=asuth
Move the trial getter to nsIGlobalObject, make every implementation
provide a reasonable value, and add a test.

Differential Revision: https://phabricator.services.mozilla.com/D140848
2022-03-15 23:16:14 +00:00
Marian-Vasile Laza f0b42c159c Backed out changeset 558e256fcb31 (bug 1759163) for causing mochitest failures on test_header_simple.html. 2022-03-15 15:23:04 -07:00
Emilio Cobos Álvarez 7961a431ef Bug 1759163 - Add origin trial support for worklets. r=asuth
Move the trial getter to nsIGlobalObject, make every implementation
provide a reasonable value, and add a test.

Differential Revision: https://phabricator.services.mozilla.com/D140848
2022-03-15 17:50:03 +00:00
Emilio Cobos Álvarez 8e81f196b9 Bug 1758705 - Make origin trials in workers work. r=asuth,dom-worker-reviewers
(pun intended)

Snapshot the trials at worker creation time, which should be enough for
our purposes.

Differential Revision: https://phabricator.services.mozilla.com/D140660
2022-03-11 11:05:09 +00:00
Chris Peterson 809cd2a13e Bug 1598759 - Remove support for Large-Allocation HTTP header. r=nika,fluent-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D140459
2022-03-09 03:18:04 +00:00
Jens Stutte db8e331c53 Bug 1731298: Explicitly check if the worker is running in Exec. r=dom-worker-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D140302
2022-03-04 14:47:02 +00:00
Sean Feng df7b4b5bda Bug 1757221 - Always round up in WorkerPrivate::RescheduleTimeoutTimer when calculating the delay for timers r=smaug
When the delay value gets converted from double to integer, it
would lose its precision. So the delay of the timer is going to
be smaller than the actual delay that the user expects (by a
tiny bit though).

This patch changes the behavior to always round value upwards.

Differential Revision: https://phabricator.services.mozilla.com/D139773
2022-03-03 03:25:01 +00:00
Marian-Vasile Laza a26529d02d Backed out changeset 1eb0b24a4248 (bug 1757221) for causing wpt failures on aborting.any.serviceworker.html. CLOSED TREE 2022-02-28 18:32:25 -08:00
Sean Feng 3fe345f02c Bug 1757221 - Always round up in WorkerPrivate::RescheduleTimeoutTimer when calculating the delay for timers r=smaug
When the delay value gets converted from double to integer, it
would lose its precision. So the delay of the timer is going to
be smaller than the actual delay that the user expects (by a
tiny bit though).

This patch changes the behavior to always round value upwards.

Differential Revision: https://phabricator.services.mozilla.com/D139773
2022-03-01 00:44:49 +00:00
Jens Stutte 07dbd234c9 Bug 1691557: Make gRuntimeService atomic. r=dom-worker-reviewers,jesup
During shutdown gRuntimeService can be accessed from a different thread while it gets destroyed. There should be not too much penalty having this atomic, even if it is for an edge case only.

Differential Revision: https://phabricator.services.mozilla.com/D139819
2022-02-28 15:16:41 +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
Emilio Cobos Álvarez 685321b746 Bug 1755947 - Simplify nsIPrincipal.isSameOrigin(). r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D139030
2022-02-17 18:11:58 +00:00
Benjamin VanderSloot ca7df4a063 Bug 1755552 - Make tests in dom/workers/tests/ dFPI compatible, r=smaug
This is very similar to a few fixes we've sent your way already, like https://phabricator.services.mozilla.com/D136608. We are merging in the dFPI enabling test config now that all of the test fixes have rolled in, but this test beat us in the race condition.


Reminder:

We are fixing mochitests that fail when network.cookie.cookieBehavior = 5, i.e. when we enable Total Cookie Protection.
This is most often due to the test assuming that an origin will always have access to its storage state when embedded as
a third party.

In this case I had to request storage access to allow an embedded iframe to use a BroadcastChannel to communicate with top-level pages of the same origin.
This was only a problem in the XOrigin case where the test html file is loaded in an embedded iframe and then can't communicate with the top-level window it created.

Differential Revision: https://phabricator.services.mozilla.com/D138850
2022-02-17 12:16:36 +00:00
Jens Stutte ea1d009c3f Bug 1752120: Null out the mWorkerPrivate on WorkerGlobalScopeBase when a worker ends. r=dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D138442
2022-02-16 15:48:43 +00:00