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

376 Коммитов

Автор SHA1 Сообщение Дата
Tooru Fujisawa 73c36f0f8f Bug 1878817 - Remove unused ModuleLoaderBase::mEventTarget member. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D200753
2024-02-06 10:15:29 +00:00
Tooru Fujisawa 976c794ad0 Bug 1800641 - Part 8: Add LoadContextBase* parameter to ScriptLoadRequest methods which is going to be moved to LoadedScriptDelegate. r=nbp
Depends on D197845

Differential Revision: https://phabricator.services.mozilla.com/D197846
2024-01-08 14:57:38 +00:00
Tooru Fujisawa f135bad3aa Bug 1800641 - Part 7: Add ScriptLoadRequest::State::{CheckingCache,PendingFetchingError}. r=nbp
Depends on D197844

Differential Revision: https://phabricator.services.mozilla.com/D197845
2024-01-08 14:57:38 +00:00
Noemi Erli 7fd755cbb5 Backed out changeset 4d6294424819 (bug 1800641) for causing Bug 1872347 2023-12-29 16:23:18 +02:00
Nicolas B. Pierron 8a851d2266 Bug 1800641 - Move some ScriptLoadRequest fields into LoadedScript. r=yulia
We are looking into caching loaded script in memory. To do so we need something
to cache.

At the moment, the `ScriptLoadRequest` structure hold all the fields which are
loaded, and used before executing JavaScript code. Then, the `ScriptLoadRequest`
is not guaranteed to out-live the first execution.

Therefore, we have to move fields out of the `ScriptLoadRequest` such that they
can later be used by any caching mechanism. The `LoadedScript` is the closest
existing structure which exists which fit the description.

This patch moves fields out of the ScriptLoadRequest into the `LoadedScript`,
which already has a `LoadedScript` field.

The `LoadedScript` field is initialized sooner, when the `ScriptLoadRequest` is
created, to be subsituted later by a real cache implementation. At the moment
the function `ScriptLoadRequest::NoCacheEntryFound` is used as a placeholder to
change the state of the `ScriptLoadRequest` from `CheckingCache` to `Fetching`.
Existing initializations are replaced by assertions to fail in debug build if
the current patch does not reproduce the expected state properly.

The `LoadedScript` get fields such as the source text, the text length, the
bytecode buffer (which also contains SRI), and the offset at which the bytecode
starts within the bytecode buffer. As these fields are no longer reachable by
name, multiple accessors are added to work-around the issue. Using this as an
opportunity to add extra assertions as part of these accessors.

A new class named `LoadedScriptDelegate` is added to re-add, by inheritance, all
the accessors which used to be part of `ScriptLoadRequest` as methods which are
delegating to the field which is holding the `LoadedScript`. This class is using
templates to avoid virtual inheritance which might hinder inlining, especially
since `ScriptLoadRequest` cannot be made final, as `ModuleLoadRequest` extends
it.

The `ScriptFetchOptions` structure is moved to its own file to solve C++ include
issues.

Differential Revision: https://phabricator.services.mozilla.com/D163615
2023-12-25 09:46:54 +00:00
Cosmin Sabou a9cb718ef1 Backed out changeset f69f493b2f3c (bug 1800641) for causing non-unified build bustages on LoadedScript.cpp. CLOSED TREE 2023-12-25 08:38:51 +02:00
Nicolas B. Pierron 7b23c511de Bug 1800641 - Move some ScriptLoadRequest fields into LoadedScript. r=yulia
We are looking into caching loaded script in memory. To do so we need something
to cache.

At the moment, the `ScriptLoadRequest` structure hold all the fields which are
loaded, and used before executing JavaScript code. Then, the `ScriptLoadRequest`
is not guaranteed to out-live the first execution.

Therefore, we have to move fields out of the `ScriptLoadRequest` such that they
can later be used by any caching mechanism. The `LoadedScript` is the closest
existing structure which exists which fit the description.

This patch moves fields out of the ScriptLoadRequest into the `LoadedScript`,
which already has a `LoadedScript` field.

The `LoadedScript` field is initialized sooner, when the `ScriptLoadRequest` is
created, to be subsituted later by a real cache implementation. At the moment
the function `ScriptLoadRequest::NoCacheEntryFound` is used as a placeholder to
change the state of the `ScriptLoadRequest` from `CheckingCache` to `Fetching`.
Existing initializations are replaced by assertions to fail in debug build if
the current patch does not reproduce the expected state properly.

The `LoadedScript` get fields such as the source text, the text length, the
bytecode buffer (which also contains SRI), and the offset at which the bytecode
starts within the bytecode buffer. As these fields are no longer reachable by
name, multiple accessors are added to work-around the issue. Using this as an
opportunity to add extra assertions as part of these accessors.

A new class named `LoadedScriptDelegate` is added to re-add, by inheritance, all
the accessors which used to be part of `ScriptLoadRequest` as methods which are
delegating to the field which is holding the `LoadedScript`. This class is using
templates to avoid virtual inheritance which might hinder inlining, especially
since `ScriptLoadRequest` cannot be made final, as `ModuleLoadRequest` extends
it.

The `ScriptFetchOptions` structure is moved to its own file to solve C++ include
issues.

Differential Revision: https://phabricator.services.mozilla.com/D163615
2023-12-25 05:50:53 +00:00
Jon Coppeard f9febfda89 Bug 1871075 - Part 1: Store referencing private as a pointer to the underlying LoadedScript r=yulia
In Gecko we use a LoadedScript pointer as the referencing private for dynamic
imports. This is passed through the JS engine as a private value, which doesn't
care what it means. Currently we store this in the module loader as a JS::Value,
but we could just as well unpack it since we know what it is. That lets use a
RefPtr which also keeps it alive and will let use remove some manual reference
counting.

We also don't need to pass it to the CreateDynamicImport method twice.

This change makes it the responsibility of the module loader for keeping the
referencing private alive until FinishDynamicModuleImport is called.

Differential Revision: https://phabricator.services.mozilla.com/D196974
2023-12-21 13:30:34 +00:00
Tom Ritter 68cae289a0 Bug 1851816: Pass PBM Status into RFPIsEnabledFor r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D192501
2023-12-18 18:39:33 +00:00
Noemi Erli a4dae64f34 Backed out 2 changesets (bug 1851816) for causing private browsing related failures CLOSED TREE
Backed out changeset d2f63b3f6342 (bug 1851816)
Backed out changeset 7d0d2fe95e67 (bug 1851816)
2023-11-07 00:18:54 +02:00
Tom Ritter 19d70df0a2 Bug 1851816: Pass PBM Status into RFPIsEnabledFor r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D192501
2023-11-06 21:02:40 +00:00
Mark Banner 6119729476 Bug 1860988 - Enable ESLint rule no-useless-return on all of dom/*. r=dom-core,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D191848
2023-10-27 12:43:03 +00:00
Tom Marble 9a53e8dcde Bug 1855298 - convert .ini manifests to .toml: batch 10 dom/[t-z]**/mochitest.ini r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D190089
2023-10-25 15:54:48 +00:00
Tim Huang e8f8d32e61 Bug 1824222 - Make nsRFPService::IsRFPEnabledFor() to use the given OverriddenFingerprintingSettings for checking RFPTargets. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D185016
2023-10-17 22:02:30 +00:00
Tim Huang 5081de9795 Bug 1824222 - Add OverriddenFingerprintingSettings to worklet implementation. r=tjr,dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D185015
2023-10-17 22:02:29 +00:00
Narcis Beleuzu 346566085d Backed out changeset eac298199d7b (bug 1855298) for Linting failure. CLOSED TREE 2023-10-12 01:44:24 +03:00
Tom Marble 8518f990ca Bug 1855298 - convert .ini manifests to .toml: batch 10 dom/[t-z]**/mochitest.ini r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D190089
2023-10-11 20:51:09 +00:00
Emilio Cobos Álvarez 25c0d10932 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
Yoshi Cheng-Hao Huang cd69bc3c65 Bug 1841859 - Part 1: Move ReferrerPolicy to ScriptLoadRequest and LoadedScript. r=jonco,smaug
Suggested by jonco during review,
https://phabricator.services.mozilla.com/D186944#inline-1036982

Differential Revision: https://phabricator.services.mozilla.com/D187385
2023-09-20 17:32:15 +00:00
Jan de Mooij eee5922d41 Bug 1851854 - Use SetPrefableContextOptions for worklet JS ContextOptions. r=mccr8
`SetPrefableContextOptions` currently has to be called on the main thread, so store
the options in `StartModuleLoadRunnable` and copy them on the worklet thread.

This doesn't update the options when the prefs are changed, but we've been moving
to read-on-startup for prefs so we probably don't need that.

Differential Revision: https://phabricator.services.mozilla.com/D187767
2023-09-11 10:09:45 +00:00
Tom Schuster 9917ffc2ef Bug 1846224 - Use RFPTarget for JS locale en-US spoofing. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D184945
2023-09-08 19:24:44 +00:00
Iulian Moraru dd918f58bd Backed out 5 changesets (bug 1846224, bug 1845940) for causing spidermonkey build bustages on TestingUtility.cpp. CLOSED TREE
Backed out changeset fc9692101130 (bug 1846224)
Backed out changeset 61486ba55cae (bug 1846224)
Backed out changeset a85aaad7d2f8 (bug 1846224)
Backed out changeset e90bc9bc5729 (bug 1846224)
Backed out changeset 38262976d922 (bug 1845940)
2023-09-08 17:13:44 +03:00
Tom Schuster a14c9980e2 Bug 1846224 - Use RFPTarget for JS locale en-US spoofing. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D184945
2023-09-08 13:38:11 +00:00
Ryan Hunt b3b912f859 Bug 1851468 - wasm: Set ContextOptions defaults to help consumers that don't read preferences. r=yury
WorkletThread does not read from preferences to initialize JS::ContextOptions
and relies on the default values it has. This lead to a regression from
bug 1832378 where certain wasm features had their field's default change.
This didn't affect other globals because we read preferences from those
and so the default value is ignored.

This commit fixes the default value for wasm features in JS::ContextOptions
as a temporary fix, and adds a quick test in worklets.

Ideally worklets will read from preferences for consistency and to allow
us to force enable/disable features. But that's a bigger change.

Differential Revision: https://phabricator.services.mozilla.com/D187583
2023-09-07 15:30:57 +00:00
Mirko Brodesser 2966a909e7 Bug 1839316: part 4) Add `RequestPriority` to `ScriptFetchOptions` and `ScriptLoadRequest`. r=smaug
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.

Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-28 11:56:34 +00:00
Cosmin Sabou c406bcf318 Backed out 5 changesets (bug 1839316) for causing bustages on ScriptLoader.cpp. CLOSED TREE
Backed out changeset 85f107e082ee (bug 1839316)
Backed out changeset 8c1e22518c3a (bug 1839316)
Backed out changeset a4c3dec0f34c (bug 1839316)
Backed out changeset 313ff15742dd (bug 1839316)
Backed out changeset fa200e26bbb1 (bug 1839316)
2023-08-09 20:16:06 +03:00
Mirko Brodesser 5cade38f47 Bug 1839316: part 4) Add `RequestPriority` to `ScriptFetchOptions` and `ScriptLoadRequest`. r=smaug
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.

Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-09 13:50:28 +00:00
Cosmin Sabou 0058dbdd1c Backed out 5 changesets (bug 1839316) for causing leaks. CLOSED TREE
Backed out changeset 75edff380fee (bug 1839316)
Backed out changeset 6a622fd5cd91 (bug 1839316)
Backed out changeset 60908cc7c586 (bug 1839316)
Backed out changeset 7b9dd8875a9e (bug 1839316)
Backed out changeset b586915187c2 (bug 1839316)
2023-08-07 16:43:03 +03:00
Mirko Brodesser 5d091f10d0 Bug 1839316: part 4) Add `RequestPriority` to `ScriptFetchOptions` and `ScriptLoadRequest`. r=smaug
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.

Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-07 11:46:19 +00:00
Tom Schuster ecff00a7ba Bug 1843002 - Add parser-metadata to ScriptFetchOptions. r=allstarschh,smaug
Differential Revision: https://phabricator.services.mozilla.com/D183366
2023-07-21 17:28:02 +00:00
Tom Schuster 936032fed3 Bug 1843002 - Add nonce to ScriptFetchOptions. r=allstarschh,smaug
Differential Revision: https://phabricator.services.mozilla.com/D183365
2023-07-21 17:28:02 +00:00
Stanca Serban 70ab9b117e Backed out 6 changesets (bug 1313937, bug 1843066, bug 1843002) for causing build bustages in ScriptLoadRequest.h. CLOSED TREE
Backed out changeset 84c2d1c04aa2 (bug 1313937)
Backed out changeset 7cab9a1ea25f (bug 1313937)
Backed out changeset affc7d1f130d (bug 1313937)
Backed out changeset e13aacfe7944 (bug 1843066)
Backed out changeset 21a9bee8f772 (bug 1843002)
Backed out changeset d381b6365111 (bug 1843002)
2023-07-21 17:41:04 +03:00
Tom Schuster 593c5e731b Bug 1843002 - Add parser-metadata to ScriptFetchOptions. r=allstarschh,smaug
Differential Revision: https://phabricator.services.mozilla.com/D183366
2023-07-21 12:31:23 +00:00
Tom Schuster 9df91ffb4d Bug 1843002 - Add nonce to ScriptFetchOptions. r=allstarschh,smaug
Differential Revision: https://phabricator.services.mozilla.com/D183365
2023-07-21 12:31:22 +00:00
Gregory Pappas 15a5560a3d Bug 1630497 - Remove dom.audioworklet.enabled and dom.worklet.enabled prefs r=padenot,webidl,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D183645
2023-07-19 12:41:18 +00:00
Natalia Csoregi 87dee095ca Backed out 6 changesets (bug 1842798) for causing failures on js/src/tests/test262/language/*. CLOSED TREE
Backed out changeset 38669a2ddad9 (bug 1842798)
Backed out changeset 5dad4aeacd53 (bug 1842798)
Backed out changeset 23d10eb8f853 (bug 1842798)
Backed out changeset 946e4dfe5452 (bug 1842798)
Backed out changeset 1b89736a463f (bug 1842798)
Backed out changeset b2e6bdd781ac (bug 1842798)
2023-07-17 20:52:18 +03:00
Jon Coppeard 3aab0ac6ba Bug 1842798 - Part 3: Remove unused event target from ModuleLoaderBase r=smaug
This was previously used by MozPromise but is no longer required.

Differential Revision: https://phabricator.services.mozilla.com/D183586
2023-07-17 12:44:19 +00:00
Cristian Tuns b323fe0afa Backed out changeset ef60c7cdcb76 (bug 1630497) for causing multiple mochitest failures in dom/worklet/tests/* CLOSED TREE 2023-07-17 07:28:41 -04:00
Gregory Pappas b38fbfc882 Bug 1630497 - Remove dom.audioworklet.enabled and dom.worklet.enabled prefs r=padenot,webidl,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D183645
2023-07-17 10:01:56 +00:00
Cristian Tuns 13353f56b9 Backed out changeset 16c42273dc28 (bug 1630497) for causing mochitest failures in dom/worklet/tests/* CLOSED TREE 2023-07-17 04:56:49 -04:00
Gregory Pappas b83517c7df Bug 1630497 - Remove dom.audioworklet.enabled and dom.worklet.enabled prefs r=padenot,webidl,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D183645
2023-07-17 07:38:23 +00:00
Kershaw Chang 705e17a537 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-28 13:21:00 +00:00
Norisz Fay 07a91b8c6a Backed out 2 changesets (bug 1838829) for causing perma mochitest failure with dom/websocket/tests being skipped CLOSED TREE
Backed out changeset 19a5d4f1850a (bug 1838829)
Backed out changeset 97cd8a256954 (bug 1838829)
2023-06-27 02:52:52 +03:00
Kershaw Chang 75c68b6864 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-26 14:22:14 +00:00
Norisz Fay e86f1fa0e9 Backed out 5 changesets (bug 1838829) for causing mochitest failures CLOSED TREE
Backed out changeset 693d34c8447d (bug 1838829)
Backed out changeset 903d9ff4afaa (bug 1838829)
Backed out changeset 5e51feff7467 (bug 1838829)
Backed out changeset e125be49d2a6 (bug 1838829)
Backed out changeset 1a8cf3c83dc4 (bug 1838829)
2023-06-22 03:37:07 +03:00
Kershaw Chang 2cdb6b3a96 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-21 19:43:33 +00:00
Nika Layzell 9f4d22f4e0 Bug 1826206 - Require nsISerialEventTarget for RetargetDeliveryTo, r=necko-reviewers,valentin
This avoids potential issues where multiple OnDataAvailable callbacks or
similar could theoretically be called concurrently on different
StreamTransportService threads when targeting the STS - these cases will
now target a TaskQueue on the STS instead, structurally ensuring serial
execution.

Differential Revision: https://phabricator.services.mozilla.com/D179984
2023-06-07 14:48:38 +00:00
Tom Schuster 880e5017fe Bug 1834737 - Make RFPTarget parameter of WorkletGlobalScope::ShouldResistFingerprinting non-optional. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D179227
2023-05-31 09:46:54 +00:00
Tom Schuster 0119f3c072 Bug 1834737 - Make RFPTarget parameter of nsIGlobalObject::ShouldResistFingerprinting non-optional. r=tjr,media-playback-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D178924
2023-05-31 09:46:53 +00:00
Mark Banner 8219a5c503 Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00