Commit Graph

276 Commits

Author SHA1 Message Date
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
Mirko Brodesser
713b492cdd Bug 1882498: add web API stubs for Trusted Types guarded behind a new pref. r=smaug,peterv
The TODOs corresponding to the stubs will be implemented in separate
patches.

Differential Revision: https://phabricator.services.mozilla.com/D202930
2024-03-13 08:24:18 +00:00
Emilio Cobos Álvarez
d02e297b2d Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Byron Campen
837490d82a Bug 1631263: Implement RTCRtpScriptTransform. r=pehrsons,jib,asuth,emilio,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D179735
2023-07-20 14:24:27 +00:00
Cristian Tuns
cedc63bf4c Backed out 9 changesets (bug 1631263, bug 1838080) for causing wpt failures in script-transform-generateKeyFrame.https.html CLOSED TREE
Backed out changeset a857a01fb321 (bug 1631263)
Backed out changeset dc46d2be4c25 (bug 1631263)
Backed out changeset 581c7a4d8f5f (bug 1631263)
Backed out changeset 7a2c4be3701d (bug 1631263)
Backed out changeset e091677e39fa (bug 1838080)
Backed out changeset 1eb303981213 (bug 1838080)
Backed out changeset 6c10370ed682 (bug 1838080)
Backed out changeset a614605b47ee (bug 1838080)
Backed out changeset 86fcc8ba6779 (bug 1838080)
2023-07-19 17:03:55 -04:00
Byron Campen
7f4694355b Bug 1631263: Implement RTCRtpScriptTransform. r=pehrsons,jib,asuth,emilio,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D179735
2023-07-19 15:41:06 +00:00
Norisz Fay
ccd30856e8 Backed out 9 changesets (bug 1838080, bug 1631263) for causing VideoConduitTest related failures CLOSED TREE
Backed out changeset 717eac481650 (bug 1631263)
Backed out changeset 2dd5c7b8fe5b (bug 1631263)
Backed out changeset d51f80b53059 (bug 1631263)
Backed out changeset 4cfe27d450e4 (bug 1631263)
Backed out changeset 0fb0b9a4e151 (bug 1838080)
Backed out changeset 3f41779ac63f (bug 1838080)
Backed out changeset f3a099a2173c (bug 1838080)
Backed out changeset c0f042536365 (bug 1838080)
Backed out changeset 6f5162d90ff3 (bug 1838080)
2023-07-09 18:00:05 +03:00
Byron Campen
594a2f4189 Bug 1631263: Implement RTCRtpScriptTransform. r=pehrsons,jib,asuth,emilio,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D179735
2023-07-09 12:35:32 +00:00
Tom Schuster
7b45e9e177 Bug 1834744 - Go back to having WorkerPrivate::ShouldResistFingerprinting. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D179960
2023-06-07 10:52:30 +00:00
Eden Chuang
73cfb8b6d1 Bug 1800659 - P3 Remove WorkerPrivate::ClearMainEventQueue() r=asuth,smaug
Pending->Canceling->Killing (WorkerNeverRan)

Need to clear WorkerPrivate::mPreStartRunnables

Could we call WorkerRunnable::WorkerRun() to release resource? There could be no WorkerGlobalScope...

Pending->Running->Closing->Canceling->Killing(WorkerRan)
Pending->Running->Canceling->Killing(WorkerRan)

When entering “Closing”
1. Keeping receives normal WorkerRunnables
2. Making ParentStatus as Closing
3. Cancel all timeout
4. Don’t clear the main event queue anymore. But we still wait for all SyncLoops be completed.
5. Call WorkerGlobalScope::NoteTerminating() and nsIGlobalObject::DisconnectEventTargetObjects().
6. Switching to “Canceling” by asking parent thread to call WorkerPrivate::Cancel()

When entering “Canceling”
1. Call WorkerGlobalScope::NoteTerminating()
2. Notify StrongWorkerRefs, worker is in “Canceling”, send and complete the corresponding shutdown work right now.
3. Executing all runnables until no normal WorkerRunnables in queue and no WorkerRefs, SyncLoops and children workers
4. Stop receiving normal WorkerRunnables and DisconnectEventTargetObjects of WorkerScope.
4. Entering “Killing”

When entering “Killing”
1. We would not notify WorkerRefs anymore. Logically all WorkerRefs should be released in “Canceling”
2. Executing all remaining ControlRunnables
3. Release corresponding resources of Worker on worker thread.

Depends on D173850

Differential Revision: https://phabricator.services.mozilla.com/D177511
2023-06-06 06:36:50 +00:00
Tom Schuster
c8e8ce0fed Bug 1834737 - Make RFPTarget parameter of WorkerGlobalScopeBase::ShouldResistFingerprinting non-optional. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D179208
2023-05-31 09:46:54 +00:00
Tom Schuster
cae6b871ce Bug 1825250 - Consider WorkerLoadInfo::mShouldResistFingerprinting as precomputed. r=tjr
The boolean is used to initialize WorkerGlobalScopeBase::mShouldResistFingerprinting which is similar
in its behavior to the precomputed mShouldResistFingerprinting in Document.

Differential Revision: https://phabricator.services.mozilla.com/D178660
2023-05-24 09:38:25 +00:00
Emilio Cobos Álvarez
d8324af55d Bug 1811950 - Allow WorkerGlobalScope.fonts to fail. r=aosmond,webidl,saschanaz
It can fail when canceling the worker (though I couldn't reproduce the
crash locally). Some things were already accounting for it.

Rename some things for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D175126
2023-04-11 13:44:53 +00:00
Tom Ritter
8126391f4d Bug 1815307: Make all ShouldRFP functions take a RTPTarget r=timhuang
The default value for the target is Unknown, so all callsites
keep working.

We also add a Target value used for Document precomputation. This
value is enabled in RFP Lite mode, and allows us to precompute
ShouldRFP and cache it for faster computations later.  (The later
computations will still check the Target, but won't need to do the
other expensive checks.)

Differential Revision: https://phabricator.services.mozilla.com/D170891
2023-03-21 14:14:48 +00:00
Cristina Horotan
1b7f31569f Backed out 7 changesets (bug 1815307) for causing mochitest failures at test_bug1729861.html CLOSED TREE
Backed out changeset 18c8ae091952 (bug 1815307)
Backed out changeset df49c162e4ad (bug 1815307)
Backed out changeset a22d49909ffa (bug 1815307)
Backed out changeset 371d1d626984 (bug 1815307)
Backed out changeset 7f4b594cf468 (bug 1815307)
Backed out changeset 83d79fcbded5 (bug 1815307)
Backed out changeset 337dfbf6a1f9 (bug 1815307)
2023-03-16 17:51:56 +02:00
Tom Ritter
c3c3d10155 Bug 1815307: Make all ShouldRFP functions take a RTPTarget r=timhuang
The default value for the target is Unknown, so all callsites
keep working.

We also add a Target value used for Document precomputation. This
value is enabled in RFP Lite mode, and allows us to precompute
ShouldRFP and cache it for faster computations later.  (The later
computations will still check the Target, but won't need to do the
other expensive checks.)

Differential Revision: https://phabricator.services.mozilla.com/D170891
2023-03-16 13:53:13 +00:00
Yulia Startsev
c5bd8065c1 Bug 1247687 - Implement initial Static Module Loading for Workers; r=jonco
This is the first pass of getting static module loading to work. This roughly implements
https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-worklet/module-worker-script-graph --
without some of the settings objects correctly set.

Th WorkerModuleLoader itself is implementing step 5, with the StartFetch method handling moving the work back to the main thread. The algorithm in step 5 is generic to all modules.

Depends on D147329

Differential Revision: https://phabricator.services.mozilla.com/D147327
2023-01-18 13:46:30 +00:00
Yulia Startsev
abfe829cb9 Bug 1247687 - Implement InitModuleLoader methods for WorkerScriptLoader and WorkerGlobalScope; r=jonco
This implements a method to initialize the moduleLoader for workers. This will initialize only once, for all worker types (module and classic).

Depends on D147324

Differential Revision: https://phabricator.services.mozilla.com/D147326
2023-01-18 13:46:29 +00:00
Nika Layzell
8c037ef668 Bug 1806709 - Part 2: Clean up some trivial nsIPrincipal helper methods from nsIGlobalObject, r=asuth
These methods only existed because nsIGlobalObject::PrincipalOrNull was not
available off-main-thread, so can now be removed.

Depends on D165198

Differential Revision: https://phabricator.services.mozilla.com/D165199
2022-12-21 15:53:22 +00:00
Norisz Fay
afd4d3408b Backed out 15 changesets (bug 1247687) as requested by dev CLOSED TREE
Backed out changeset 81d052cabf84 (bug 1247687)
Backed out changeset d698041e5174 (bug 1247687)
Backed out changeset 2adf67f910e8 (bug 1247687)
Backed out changeset 0bc871906e97 (bug 1247687)
Backed out changeset 1700d5b79273 (bug 1247687)
Backed out changeset 31888ffde37a (bug 1247687)
Backed out changeset 9153182c650d (bug 1247687)
Backed out changeset 45de9ffeec19 (bug 1247687)
Backed out changeset 59207e959b7c (bug 1247687)
Backed out changeset 49f18430c465 (bug 1247687)
Backed out changeset 0ae1fd421d4f (bug 1247687)
Backed out changeset 7770ec4717fd (bug 1247687)
Backed out changeset 68b476066248 (bug 1247687)
Backed out changeset c94a9dc60dff (bug 1247687)
Backed out changeset 0ab366c6eaaf (bug 1247687)
2022-12-21 10:48:15 +02:00
Yulia Startsev
1f63ccd529 Bug 1247687 - Implement InitModuleLoader methods for WorkerScriptLoader and WorkerGlobalScope; r=jonco
This implements a method to initialize the moduleLoader for workers. This will initialize only once, for all worker types (module and classic).

Depends on D147324

Differential Revision: https://phabricator.services.mozilla.com/D147326
2022-12-20 20:56:12 +00:00
Csoregi Natalia
b7e7a05b44 Backed out 16 changesets (bug 1247687) for frequent string bundle related crashes with PDF viewer (bug 1806064). a=backout
Backed out changeset 721f612fd09f (bug 1247687)
Backed out changeset c6c5750cf713 (bug 1247687)
Backed out changeset 5d05ab0c7cde (bug 1247687)
Backed out changeset 2429599729cb (bug 1247687)
Backed out changeset 55f13fb4ee3f (bug 1247687)
Backed out changeset 354711cf113a (bug 1247687)
Backed out changeset 40b8abaf1c0b (bug 1247687)
Backed out changeset 0c9650a1ac48 (bug 1247687)
Backed out changeset e7b103c79b1a (bug 1247687)
Backed out changeset 4dbd510fb042 (bug 1247687)
Backed out changeset 9276c7e1ddd9 (bug 1247687)
Backed out changeset 6ee318df6641 (bug 1247687)
Backed out changeset 6c129bd72b61 (bug 1247687)
Backed out changeset 4b0a4fcc6894 (bug 1247687)
Backed out changeset 34680059b9f0 (bug 1247687)
Backed out changeset 85b827971a48 (bug 1247687)
2022-12-17 11:27:32 +02:00
Yulia Startsev
b2b84bd175 Bug 1247687 - Implement InitModuleLoader methods for WorkerScriptLoader and WorkerGlobalScope; r=jonco
This implements a method to initialize the moduleLoader for workers. This will initialize only once, for all worker types (module and classic).

Depends on D147324

Differential Revision: https://phabricator.services.mozilla.com/D147326
2022-12-14 14:55:35 +00:00
Eden Chuang
41a3e7f280 Bug 1752856 - Null CheckedUnsafePtr<WorkerPrivate> for members of WorkerGlobalScope when releaseing WorkerPrivate. r=dom-worker-reviewers,asuth,smaug
In some unusual cases, WorkerGlobalScope could live longer than WorkerPrivate since some other objects hold a reference on WorkerGlobalScope. We try to use CC/GC to release WorkerGlobalScope and force disconnect them from the WorkerPrivate before releasing WorkerPrivate. https://searchfox.org/mozilla-central/rev/83b86005c6913c2062419efb8aabdf2e683aa47f/dom/workers/RuntimeService.cpp#2068-2109

The previous implementation focused on nulling the WorkerGlobalScopeBase::mWorkerPrivate. However, it is not enough since WorkerGlobalScope's member could possibly hold a CheckedUnsafePtr<WorkerPrivate>, i.e. WorkerGlobalScope::mPerformance.

In this patch, we focus on breaking these connections.

Differential Revision: https://phabricator.services.mozilla.com/D162575
2022-11-30 14:27:51 +00:00
Jan Varga
6d33fc8615 Bug 1791867 - Add GetStorageManager to nsIGlobalObject; r=smaug,dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D157902
2022-11-30 09:51:14 +00:00
Tom Ritter
affa6b423f Bug 1778510: Add RTPCallerType to GlobalObject r=asuth
This centralizes the logic in one place.

In order to do this, we will need to check the principal
off-main thread. (Well, we need to know if it's System
Principal.)  Worker and Worklet need special ways to do
this, so create a virtual method for it and let them
override it.  This is analogous to the ShouldRFP method
on GlobalObject.

Differential Revision: https://phabricator.services.mozilla.com/D157564
2022-11-29 13:34:15 +00:00
Tom Ritter
ef693d4e6e Bug 1778510: Move shouldRFP from WorkerPrivate to WorkerGlobalScopeBase r=asuth
This does not remove mShouldResistFingerprinting from
WorkerPrivate->mLoadInfo.  This is because in between
mLoadInfo getting initialized (including where shouldRFP gets
set) and when the worker's global scope is constructed, we
need to keep track of whether we shouldRFP or not.  We could
make this single bool an outparam of GetLoadInfo to later
pass to GetOrCreateGlobalScope, but that seems noisy.

Differential Revision: https://phabricator.services.mozilla.com/D157563
2022-11-29 13:34:12 +00:00
Butkovits Atila
b5d69ff02c Backed out 33 changesets (bug 1778510) for causing build bustages at nsIGlobalObject.h. CLOSED TREE
Backed out changeset f2a53c9e497c
Backed out changeset 59350ca6f3f2 (bug 1778510)
Backed out changeset abbba7e72b57 (bug 1778510)
Backed out changeset 6cf7473afae8 (bug 1778510)
Backed out changeset 74fb5fed93ea (bug 1778510)
Backed out changeset 5b5dc70cdd0a (bug 1778510)
Backed out changeset ff93191cafd2 (bug 1778510)
Backed out changeset 39cc006b610c (bug 1778510)
Backed out changeset dfaef3ad17a9 (bug 1778510)
Backed out changeset 8fbabeb8244b (bug 1778510)
Backed out changeset 45051b62e3f1 (bug 1778510)
Backed out changeset 86c0923fd81f (bug 1778510)
Backed out changeset a49c0f69d519 (bug 1778510)
Backed out changeset cfad733d4aaf (bug 1778510)
Backed out changeset df6d0fe89d5b (bug 1778510)
Backed out changeset 704db76eab17 (bug 1778510)
Backed out changeset 0651c128e369 (bug 1778510)
Backed out changeset 1e650de647c0 (bug 1778510)
Backed out changeset fa15a3572741 (bug 1778510)
Backed out changeset 4ceffd409eae (bug 1778510)
Backed out changeset 47db43142c62 (bug 1778510)
Backed out changeset ebb21153aaac (bug 1778510)
Backed out changeset a87eaaec3f9c (bug 1778510)
Backed out changeset 43ad5ee21f79 (bug 1778510)
Backed out changeset 5f20af8e1263 (bug 1778510)
Backed out changeset b78576875db0 (bug 1778510)
Backed out changeset d801fdeac90b (bug 1778510)
Backed out changeset 5af032c628c0 (bug 1778510)
Backed out changeset 86aa59de11b4 (bug 1778510)
Backed out changeset 58642357a19c (bug 1778510)
Backed out changeset c575e824e291 (bug 1778510)
Backed out changeset 32a358de4843 (bug 1778510)
Backed out changeset 40e0708c01e7 (bug 1778510)
2022-11-28 23:14:52 +02:00
Tom Ritter
bbaff951ca Bug 1778510: Add RTPCallerType to GlobalObject r=asuth
This centralizes the logic in one place.

In order to do this, we will need to check the principal
off-main thread. (Well, we need to know if it's System
Principal.)  Worker and Worklet need special ways to do
this, so create a virtual method for it and let them
override it.  This is analogous to the ShouldRFP method
on GlobalObject.

Differential Revision: https://phabricator.services.mozilla.com/D157564
2022-11-28 18:04:07 +00:00
Tom Ritter
777cef93a5 Bug 1778510: Move shouldRFP from WorkerPrivate to WorkerGlobalScopeBase r=asuth
This does not remove mShouldResistFingerprinting from
WorkerPrivate->mLoadInfo.  This is because in between
mLoadInfo getting initialized (including where shouldRFP gets
set) and when the worker's global scope is constructed, we
need to keep track of whether we shouldRFP or not.  We could
make this single bool an outparam of GetLoadInfo to later
pass to GetOrCreateGlobalScope, but that seems noisy.

Differential Revision: https://phabricator.services.mozilla.com/D157563
2022-11-28 18:04:05 +00:00
Cosmin Sabou
9251c6ec90 Backed out 33 changesets (bug 1778510) for causing bp-hybrid bustages on nsIPrincipal.h. CLOSED TREE
Backed out changeset 282f589ede4a
Backed out changeset e23d03ba5a89 (bug 1778510)
Backed out changeset cbdb34cf7c8d (bug 1778510)
Backed out changeset d9a54521f3fb (bug 1778510)
Backed out changeset f5b7f8ce38b0 (bug 1778510)
Backed out changeset eb64607765a9 (bug 1778510)
Backed out changeset 18291e692834 (bug 1778510)
Backed out changeset bb71cc94a8be (bug 1778510)
Backed out changeset 507e84e1dafe (bug 1778510)
Backed out changeset 6d42e7a083ac (bug 1778510)
Backed out changeset 53799e6a46dd (bug 1778510)
Backed out changeset ff20d709839a (bug 1778510)
Backed out changeset 328d4d2df591 (bug 1778510)
Backed out changeset 9ba44fd8a440 (bug 1778510)
Backed out changeset eb1b7e30e519 (bug 1778510)
Backed out changeset c0927de6153b (bug 1778510)
Backed out changeset 02a306acd093 (bug 1778510)
Backed out changeset 2c5eecc4ad4c (bug 1778510)
Backed out changeset 38a9f45c9621 (bug 1778510)
Backed out changeset 35b7c7df62ce (bug 1778510)
Backed out changeset 187d71f42593 (bug 1778510)
Backed out changeset 450f4ccd6cd0 (bug 1778510)
Backed out changeset 915149e27da0 (bug 1778510)
Backed out changeset 9c6e85369f15 (bug 1778510)
Backed out changeset c6a9fe0ce713 (bug 1778510)
Backed out changeset a2f00462157e (bug 1778510)
Backed out changeset 5278e40b80c3 (bug 1778510)
Backed out changeset dba220581d93 (bug 1778510)
Backed out changeset 17a63044b0dc (bug 1778510)
Backed out changeset 68d607aaa121 (bug 1778510)
Backed out changeset e93004f91f6f (bug 1778510)
Backed out changeset 41d6d9f889e1 (bug 1778510)
Backed out changeset 28ac62019086 (bug 1778510)
2022-11-28 07:34:46 +02:00
Tom Ritter
b9083946f3 Bug 1778510: Add RTPCallerType to GlobalObject r=asuth
This centralizes the logic in one place.

In order to do this, we will need to check the principal
off-main thread. (Well, we need to know if it's System
Principal.)  Worker and Worklet need special ways to do
this, so create a virtual method for it and let them
override it.  This is analogous to the ShouldRFP method
on GlobalObject.

Differential Revision: https://phabricator.services.mozilla.com/D157564
2022-11-28 04:21:26 +00:00
Tom Ritter
6a7313a8c2 Bug 1778510: Move shouldRFP from WorkerPrivate to WorkerGlobalScopeBase r=asuth
This does not remove mShouldResistFingerprinting from
WorkerPrivate->mLoadInfo.  This is because in between
mLoadInfo getting initialized (including where shouldRFP gets
set) and when the worker's global scope is constructed, we
need to keep track of whether we shouldRFP or not.  We could
make this single bool an outparam of GetLoadInfo to later
pass to GetOrCreateGlobalScope, but that seems noisy.

Differential Revision: https://phabricator.services.mozilla.com/D157563
2022-11-28 04:21:24 +00:00
Jan Varga
022c955183 Bug 1798773 - Always shutdown FileSystemManager; r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162200
2022-11-24 13:58:38 +00:00
Jan Varga
bb4aa33e4e Bug 1790207 - Forward declaration of mozilla::Result in nsIGlobalObject.h and other cleanup; r=dom-storage-reviewers,jesup
Depends on D162087

Differential Revision: https://phabricator.services.mozilla.com/D162088
2022-11-15 17:13:02 +00:00
Randell Jesup
b6c5787857 Bug 1790207: Provide cross-origin security checks for OPFS r=nika,asuth
Differential Revision: https://phabricator.services.mozilla.com/D157892
2022-11-15 17:13:01 +00:00
Jan Varga
ca320afd75 Bug 1786501 - Implement WorkerNavigator::Invalidate; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D155371
2022-08-31 09:34:50 +00:00
Kagami Sascha Rosylight
cf7dd810d1 Bug 1778489 - Define window.indexedDB as null in Private Browsing Mode r=twisniewski,asuth
https://www.msn.com/ja-jp/feed accesses `indexedDB` as a global variable and thus it throws undefined identifier error when it's not defined. Returning null fixes the regression.

Differential Revision: https://phabricator.services.mozilla.com/D151373
2022-07-08 16:05:25 +00:00
Andrew Osmond
aeb00f5e9f Bug 1072107 - Part 9. Expose FontFaceSet on workers. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D149254
2022-07-07 21:24:11 +00:00
Sean Feng
7656eea3db Bug 1734997 - Prototype the Prioritized Task Scheduling API r=smaug
Spec: https://wicg.github.io/scheduling-apis/

Differential Revision: https://phabricator.services.mozilla.com/D133494
2022-04-21 18:47:52 +00:00
Marian-Vasile Laza
05a0488a76 Backed out 7 changesets (bug 1734997) for causing bustages on WebTaskSchedulerMainThread.cpp. CLOSED TREE
Backed out changeset 7ab1e7cc8f6a (bug 1734997)
Backed out changeset 0846da0f5ab1 (bug 1734997)
Backed out changeset 3a138b8501ec (bug 1734997)
Backed out changeset 55c6e7862298 (bug 1734997)
Backed out changeset 724cccd1d595 (bug 1734997)
Backed out changeset 5e624d630397 (bug 1734997)
Backed out changeset 09469f7dd10e (bug 1734997)
2022-04-19 12:54:00 -07:00
Sean Feng
53dcd69ec4 Bug 1734997 - Prototype the Prioritized Task Scheduling API r=smaug
Spec: https://wicg.github.io/scheduling-apis/

Differential Revision: https://phabricator.services.mozilla.com/D133494
2022-04-19 19:08:44 +00:00
Olli Pettay
5093e37c21 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
b5a86673fd 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
Jens Stutte
8ce115f10d 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
Emilio Cobos Álvarez
c7c5de6781 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
b328ae122e 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
7b2db77ff1 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
Sylvestre Ledru
35a175aa33 Bug 1754767 - Remove duplicate includes r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D138441
2022-02-11 10:01:15 +00:00
nchevobbe
75d600089c Bug 1674336 - Add WorkerScope#clearConsoleEvents. r=asuth.
This will be used from the DevTools webconsole to clear events when
the user hits the clear button in the UI.

A test for the console is added in the next patch of the queue.

Differential Revision: https://phabricator.services.mozilla.com/D138314
2022-02-10 17:16:24 +00:00