Commit graph

567 commits

Author SHA1 Message Date
Tom Ritter
73c477c80e 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
Nazım Can Altınova
3c14a0bff0 Bug 1812368 - Truncate the URLs we are passing into profiler markers r=julienw
Differential Revision: https://phabricator.services.mozilla.com/D169053
2023-02-09 10:16:51 +00:00
Yulia Startsev
56c6f79308 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
8332c88faa 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
8cf029b070 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
e859be10b8 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
c382c6a7ca 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
a40b702d6e 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
Nika Layzell
8351f7cc2d Bug 1804093 - Part 5: Eliminate WorkerPrincipal and WorkletPrincipals, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D163856
2022-12-12 22:08:36 +00:00
Nika Layzell
6c15719086 Bug 1804093 - Part 2: Remove some values cached from nsIPrincipal from WorkerLoadInfo, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D163853
2022-12-12 22:08:35 +00:00
Eden Chuang
0943e68b5e 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
e95f3b4eec 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
c89f44794d Bug 1778510: Update the WorkerScope Vsync method to use fine-grained RFP information r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D151309
2022-11-29 13:34:16 +00:00
Tom Ritter
39b2fec75c 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
803ad112c2 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
cb853b7f77 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
c30a2c6a5f Bug 1778510: Update the WorkerScope Vsync method to use fine-grained RFP information r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D151309
2022-11-28 18:04:08 +00:00
Tom Ritter
d54e4c9877 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
0812bb2e5b 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
d245f666b9 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
8af8993421 Bug 1778510: Update the WorkerScope Vsync method to use fine-grained RFP information r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D151309
2022-11-28 04:21:27 +00:00
Tom Ritter
3e82dba9f2 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
d3041242a7 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
b1055977ce 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
f40ce49b02 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
Jan Varga
7ce6e92fa1 Bug 1790207 - Change nsIGlobalObject::GetStorageKey to return NS_ERROR_NOT_AVAILABLE by default; r=dom-storage-reviewers,jesup,asuth
nsGlobalWindowInner, WorkerGlobalScopeBase, BackstagePas and SandboxPrivate now
explicitly provide GetStorageKey implementation which explicitly block null and
expanded principals. All other globals (nsGlobalWindowOuter, SimpleGlobalObject,
ShadowRealmGlobalScope and WorkletGlobalScope) inherit the default
implementation which returns NS_ERROR_NOT_AVAILABLE.

Differential Revision: https://phabricator.services.mozilla.com/D162087
2022-11-15 17:13:01 +00:00
Randell Jesup
229303901a 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
bccd6f0308 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
32a02a7021 Bug 1784590 - Part 1: Remove hide_in_pbmode prefs r=asuth
It turns out that websites break with different reasons when hiding things. At this point we want to stop revising the hack further and instead gather the data about how many websites are currently affected.

Differential Revision: https://phabricator.services.mozilla.com/D154578
2022-08-24 10:58:46 +00:00
Marian-Vasile Laza
e32b8c70e9 Backed out 2 changesets (bug 1784590) for causing mochitest failures on test_privateBrowsing.html. CLOSED TREE
Backed out changeset cd284ba05fbb (bug 1784590)
Backed out changeset 2f714355a8c8 (bug 1784590)
2022-08-23 01:26:37 +03:00
Kagami Sascha Rosylight
ee9aec5cb9 Bug 1784590 - Part 1: Remove hide_in_pbmode prefs r=asuth
It turns out that websites break with different reasons when hiding things. At this point we want to stop revising the hack further and instead gather the data about how many websites are currently affected.

Differential Revision: https://phabricator.services.mozilla.com/D154578
2022-08-22 20:48:33 +00:00
Marian-Vasile Laza
b92a6b8396 Backed out 2 changesets (bug 1784590) for causing mochitest failures on test_privateBrowsing.html.
Backed out changeset 36d36e75930f (bug 1784590)
Backed out changeset 35dbbd6dbb70 (bug 1784590)
2022-08-22 22:50:41 +03:00
Kagami Sascha Rosylight
bfc04ec1a4 Bug 1784590 - Part 1: Remove hide_in_pbmode prefs r=asuth
It turns out that websites break with different reasons when hiding things. At this point we want to stop revising the hack further and instead gather the data about how many websites are currently affected.

Differential Revision: https://phabricator.services.mozilla.com/D154578
2022-08-22 18:48:12 +00:00
Kagami Sascha Rosylight
f4fcfcd045 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
c5989fee52 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
Kagami Sascha Rosylight
9902521a4c Bug 1768189 - Part 43: Apply modernize-concat-nested-namespaces to dom/workers/JSExecutionManager.cpp ... r=andi
Depends on D145778

Differential Revision: https://phabricator.services.mozilla.com/D145779
2022-05-09 20:41:20 +00:00
Sean Feng
5042a856cf 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
8615f36226 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
ec21b3c0a4 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
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
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
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
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
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
nchevobbe
ce39e48888 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
Iulian Moraru
2fb7711a91 Backed out 2 changesets (bug 1754477, bug 1674336) for causing devtools failures on browser_webconsole_console_logging_workers_api.js.
Backed out changeset c3fd724b3ba9 (bug 1754477)
Backed out changeset f7ad3ba32926 (bug 1674336)
2022-02-10 14:07:51 +02:00
nchevobbe
f737759a1b 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 10:45:02 +00:00
Eden Chuang
4de896f8ef Bug 1744025: Use CheckedUnsafePtr<WorkerPrivate> in WorkerGlobalScopeBase. r=dom-worker-reviewers,asuth
Depends on D132708

Differential Revision: https://phabricator.services.mozilla.com/D132709
2022-01-25 08:53:00 +00:00