Commit Graph

340 Commits

Author SHA1 Message Date
Yoshi Cheng-Hao Huang
2925957e93 Bug 1958495: Add CancelFetchingModules for BETA. a=RyanVM
Apply the fix in https://phabricator.services.mozilla.com/D257677 to
BETA.

Original Revision: https://phabricator.services.mozilla.com/D260293

Differential Revision: https://phabricator.services.mozilla.com/D260572
2025-08-09 22:05:01 +00:00
Yoshi Cheng-Hao Huang
510b3e9a5c Bug 1965426 - Check recursion limit in ModuleLoaderBase. a=dmeehan DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D249674

Differential Revision: https://phabricator.services.mozilla.com/D253300
2025-06-11 17:04:42 +00:00
Mike Hommey
c9818c67e7 Bug 1966547 - Remove unnecessary virtual specifiers. r=nika,necko-reviewers,media-playback-reviewers,permissions-reviewers,timhuang,kershaw,padenot
clang 21 now warns about them.

Differential Revision: https://phabricator.services.mozilla.com/D249517
2025-05-22 05:47:21 +00:00
Sylvestre Ledru
8ae54ea4f9 Bug 1519636 - Reformat recent changes to the Google coding style r=geckoview-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,nalexander,gstoll,tcampbell,janv,julienw
Updated with clang-format version 19.1.7 (taskcluster-DYvBxDZJRVqTi8E7pTSJAQ)

Differential Revision: https://phabricator.services.mozilla.com/D249880
2025-05-17 19:11:13 +00:00
Yoshi Cheng-Hao Huang
8f81cf5c44 Bug 1965436 - Remove redundant HoldJSObjects call in ScriptLoadRequest. r=jonco
HoldJSObjects is already called in the ~ScriptLoadRequest. So remove the
redundant one in ScriptLoadRequest::DropBytecodeCacheReferences.

Differential Revision: https://phabricator.services.mozilla.com/D249036
2025-05-13 11:02:55 +00:00
Tooru Fujisawa
c882062351 Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 13:09:04 +00:00
Stanca Serban
3d34fe1048 Backed out 8 changesets (bug 1949932) for causing reftests failures in LoadedScript.h. CLOSED TREE
Backed out changeset de39fd08733d (bug 1949932)
Backed out changeset b75281f1b27c (bug 1949932)
Backed out changeset 8920e6d4cf8c (bug 1949932)
Backed out changeset c05f9bf802ae (bug 1949932)
Backed out changeset 2c9718bfd7be (bug 1949932)
Backed out changeset 03f4514cfba8 (bug 1949932)
Backed out changeset 9fe4fd6ee6e8 (bug 1949932)
Backed out changeset 1cebf102e64e (bug 1949932)
2025-04-01 08:59:51 +03:00
Tooru Fujisawa
872eb028b0 Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 03:11:18 +00:00
Goloman Adrian
62c97b0b6c Backed out 8 changesets (bug 1949932) for causing build bustages @RootingAPI.h. CLOSED TREE
Backed out changeset 181cde5d267e (bug 1949932)
Backed out changeset 44fd656c40de (bug 1949932)
Backed out changeset b4d93df0edb1 (bug 1949932)
Backed out changeset 7c20db67f688 (bug 1949932)
Backed out changeset ac742d9dc3aa (bug 1949932)
Backed out changeset 102e0dc46dff (bug 1949932)
Backed out changeset 80d1b3331844 (bug 1949932)
Backed out changeset cc1834c3ea2a (bug 1949932)
2025-04-01 07:09:29 +03:00
Tooru Fujisawa
85a3b6e05a Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 03:11:18 +00:00
Tooru Fujisawa
bcc4c6ecf8 Bug 1954644 - Part 9: Remove unnecessary cast. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242314
2025-03-22 04:03:56 +00:00
Tooru Fujisawa
eae715d121 Bug 1954644 - Part 5: Make ScriptFetchOptions::IsCompatible more robust against various situations. r=nbp
mTriggeringPrincipal can be nullptr in chrome-privileged context.
And also the `other` can be `this` value itself.

Differential Revision: https://phabricator.services.mozilla.com/D242310
2025-03-22 04:03:55 +00:00
Tooru Fujisawa
2383b98374 Bug 1954644 - Part 3: Cleanup ModuleLoadRequest parameters to avoid confusing parameter syntax. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242308
2025-03-22 04:03:54 +00:00
Tooru Fujisawa
303abbb5c4 Bug 1954644 - Part 1: Make the cycle collection macro use consistent. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242306
2025-03-22 04:03:54 +00:00
Tooru Fujisawa
5c69e6024e Bug 1899316 - Add ModuleScript::{FromCache,ToCache}. r=nbp
In order to store ModuleScript in SharedScriptCache, we need to strip off
all GC-things and runtime-related flags.
All fields in ModuleScript matches either of them, so just converting to
base class LoadedScript fits this purpose.

Differential Revision: https://phabricator.services.mozilla.com/D242305
2025-03-22 04:03:54 +00:00
Fatih Kilic
37486aeb74 Bug 1945540: Part 3 - Get integrity from import map. r=tschuster,jonco,dom-core,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D236559
2025-03-06 14:16:30 +00:00
Fatih Kilic
92c8533185 Bug 1945540: Part 1 - Implement parsing of integrity field. r=tschuster,jonco
Differential Revision: https://phabricator.services.mozilla.com/D236729
2025-03-06 14:16:29 +00:00
Dave Townsend
941f1ac3b3 Bug 1945566 - Add a moz-src protocol handler, r=necko-reviewers,firefox-desktop-core-reviewers ,extension-reviewers,robwu,mconley,valentin,tschuster
Differential Revision: https://phabricator.services.mozilla.com/D236569
2025-03-03 12:47:46 +00:00
Sandor Molnar
13d09c1f65 Backed out 4 changesets (bug 1945566) for causing build bustages/py3 unit test failures/bugzilla lint failures CLOSED TREE
Backed out changeset 6d69925d57ac (bug 1945566)
Backed out changeset 1b2bd35ca71f (bug 1945566)
Backed out changeset 9eba66d33006 (bug 1945566)
Backed out changeset c19c6833ebdc (bug 1945566)
2025-02-26 14:24:49 +02:00
Dave Townsend
75fc886ee6 Bug 1945566 - Add a moz-src protocol handler, r=necko-reviewers,firefox-desktop-core-reviewers ,extension-reviewers,robwu,mconley,valentin
Differential Revision: https://phabricator.services.mozilla.com/D236569
2025-02-26 11:30:59 +00:00
Yoshi Cheng-Hao Huang
0f700f4d20 Bug 1948589 - Part 1: Report exception if import() a unknown module type. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D238421
2025-02-18 17:41:52 +00:00
Bryan Thrall
3bacfd5034 Bug 1724236 - Rename JSExecutionUtils from JSExecutionContext r=arai
Differential Revision: https://phabricator.services.mozilla.com/D218458
2024-10-30 13:41:47 +00:00
Jon Coppeard
a8cd5ddb9e Bug 1927125 - Avoid triggering gray unmarking when unlinking module scripts r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D226902
2024-10-28 17:34:58 +00:00
serge-sans-paille
f2b5cecd37 Bug 1923330 - Reorder using declaration to prevent -Wchanges-meaning warning r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D224935
2024-10-09 12:30:17 +00:00
Tooru Fujisawa
84727f2cc6 Bug 1916635 - Part 1: Create PerformanceResourceTiming entry for SharedScriptCache. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D223357
2024-10-01 12:17:26 +00:00
Jonatan Klemets
d81453192a Bug 1917899 - Check unsupported import attributes before resolving specifier r=jonco
We need to check if we have an unsupported attribute before resolving the
specifier because, according to the spec, the unknown attribute should be
reported before the invalid specifier.

Differential Revision: https://phabricator.services.mozilla.com/D221998
2024-09-17 08:25:46 +00:00
Jonatan Klemets
4823d60d86 Bug 1877792 - Part 15: Skip ExposeScriptToDebugger/UpdateDebugMetadata for synthetic modules r=spidermonkey-reviewers,jonco
Differential Revision: https://phabricator.services.mozilla.com/D218562
2024-09-03 08:10:53 +00:00
Jonatan Klemets
d79584cae1 Bug 1877792 - Part 14: Return early in ModuleLoaderBase::ResolveRequestedModules for synthetic modules r=spidermonkey-reviewers,jonco
Synthetic modules do not have any dependencies, so calling
`GetRequestedModulesCount` results in cash. This patch fixes this by making
`ResolveRequestedModules` return early for synthetic modules.

Differential Revision: https://phabricator.services.mozilla.com/D218561
2024-09-03 08:10:53 +00:00
Jonatan Klemets
7c061d08e8 Bug 1877792 - Part 13: Skip setting/clearing the module private for synthetic modules r=spidermonkey-reviewers,jonco
Synthetic modules do not have a module private.

Differential Revision: https://phabricator.services.mozilla.com/D218560
2024-09-03 08:10:52 +00:00
Jonatan Klemets
00609001ca Bug 1877792 - Part 10: Get the module type from the module request r=spidermonkey-reviewers,jonco
Differential Revision: https://phabricator.services.mozilla.com/D218557
2024-09-03 08:10:51 +00:00
Jonatan Klemets
24c00f1528 Bug 1877792 - Part 9: Add module type to ModuleLoaderBase::{CreateStaticImport,CreateDynamicImport} r=spidermonkey-reviewers,dom-worker-reviewers,dom-core,asuth,jonco,mccr8
This patch adds a module type parameter to
`ModuleLoaderBase::{CreateStaticImport,CreateDynamicImport},` and gets rid of a
bunch of hard-coded `JS::ModuleType::JavaScript.` However, the module type is
still hard-coded when we call `CreateDynamicImport` and `CreateStaticImport`.

Differential Revision: https://phabricator.services.mozilla.com/D218556
2024-09-03 08:10:51 +00:00
Jonatan Klemets
5d9da99e61 Bug 1877792 - Part 8: Add module type to ModuleLoadRequest::NewVisitedSetForTopLevelImport r=spidermonkey-reviewers,dom-worker-reviewers,dom-core,asuth,jonco,mccr8
This patch adds the new parameter to the `NewVisitedSetForTopLevelImport`
method, but we hard-code the module type (which will be addressed in a later
patch)

Differential Revision: https://phabricator.services.mozilla.com/D218555
2024-09-03 08:10:50 +00:00
Jonatan Klemets
becd3a556a Bug 1877792 - Part 7: Add ModuleLoadRequest::mModuleType r=dom-core,spidermonkey-reviewers,dom-worker-reviewers,asuth,jonco,mccr8
This patch gets rid of most hard-coded `JS::ModuleType::JavaScript` in
`js/loader/ModuleLoaderBase.cpp`. However, the module type is still hard-coded
when constructing the `ModuleLoadRequest` (will be addressed in a later patch).

Differential Revision: https://phabricator.services.mozilla.com/D218554
2024-09-03 08:10:50 +00:00
Jonatan Klemets
76c8568c12 Bug 1877792 - Part 6: Change ModuleLoaderBase::ResolveRequestedModules to handle URL and module type r=spidermonkey-reviewers,jonco
This patch is a small step towards the end goal, so we hardcoded the module
type to `JS::ModuleType::JavaScript`, but that will get changed in a later
patch.

Differential Revision: https://phabricator.services.mozilla.com/D218553
2024-09-03 08:10:50 +00:00
Jonatan Klemets
c5a80d9d47 Bug 1877792 - Part 3: Update module map methods to take ModuleMapKey instead of nsIURI r=spidermonkey-reviewers,jonco
Differential Revision: https://phabricator.services.mozilla.com/D218209
2024-09-03 08:10:48 +00:00
Jonatan Klemets
0598953bb0 Bug 1877792 - Part 2: Change the module map key to include both URL and module type r=yulia,jonco
The module maps (`mFetchingModules` and `mFetchedModules`) in
`ModuleLoaderBase`, and `VisitedURLSet` were previously only keyed by the URL
and used the `nsURIHashKey` hashtable key class. This is no longer sufficient,
and the key should also contain the module type.

This patch introduces a new hashtable key class called `ModuleMapKey` and
changes `mFetchingModules`, `mFetchedModules`, and `VisitedURLSet` to use the
new key type.

To make this a bit easier to review, this first patch only introduces the new
key type and hard-codes the type to Javascript, where the key is constructed.
The hard-corded module types will be fixed in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D155160
2024-09-03 08:10:48 +00:00
Cristina Horotan
a842adb0d9 Backed out 20 changesets (bug 1877792) for causing wpt failures at importscripts_mime_local.any.sharedworker.html CLOSED TREE
Backed out changeset 19d78d0b6ee4 (bug 1877792)
Backed out changeset 14f104e5ce51 (bug 1877792)
Backed out changeset 662eb52b2a6f (bug 1877792)
Backed out changeset 48dc4035a14f (bug 1877792)
Backed out changeset d98ecddf2f59 (bug 1877792)
Backed out changeset 1234a31ff88f (bug 1877792)
Backed out changeset a3b5b0cde6ce (bug 1877792)
Backed out changeset a1f494b9592a (bug 1877792)
Backed out changeset a4d7565218f3 (bug 1877792)
Backed out changeset fe179004423b (bug 1877792)
Backed out changeset 39a20aee3942 (bug 1877792)
Backed out changeset 95b20763e650 (bug 1877792)
Backed out changeset d763241fccaf (bug 1877792)
Backed out changeset 0674cf646120 (bug 1877792)
Backed out changeset bd23c96418b6 (bug 1877792)
Backed out changeset 5b1e29e4c597 (bug 1877792)
Backed out changeset 3cead4149e6b (bug 1877792)
Backed out changeset d73a9f57f03c (bug 1877792)
Backed out changeset 82a58a80f58a (bug 1877792)
Backed out changeset 4c7182604e4f (bug 1877792)
2024-08-22 19:23:15 +03:00
Jonatan Klemets
4f0c793a69 Bug 1877792 - Part 15: Skip ExposeScriptToDebugger/UpdateDebugMetadata for synthetic modules r=spidermonkey-reviewers,jonco
Differential Revision: https://phabricator.services.mozilla.com/D218562
2024-08-22 14:21:54 +00:00
Jonatan Klemets
8fcdc93c58 Bug 1877792 - Part 14: Return early in ModuleLoaderBase::ResolveRequestedModules for synthetic modules r=spidermonkey-reviewers,jonco
Synthetic modules do not have any dependencies, so calling
`GetRequestedModulesCount` results in cash. This patch fixes this by making
`ResolveRequestedModules` return early for synthetic modules.

Differential Revision: https://phabricator.services.mozilla.com/D218561
2024-08-22 14:21:53 +00:00
Jonatan Klemets
a69b75d81d Bug 1877792 - Part 13: Skip setting/clearing the module private for synthetic modules r=spidermonkey-reviewers,jonco
Synthetic modules do not have a module private.

Differential Revision: https://phabricator.services.mozilla.com/D218560
2024-08-22 14:21:53 +00:00
Jonatan Klemets
939678147a Bug 1877792 - Part 10: Get the module type from the module request r=spidermonkey-reviewers,jonco
Differential Revision: https://phabricator.services.mozilla.com/D218557
2024-08-22 14:21:52 +00:00
Jonatan Klemets
df3d32caa7 Bug 1877792 - Part 9: Add module type to ModuleLoaderBase::{CreateStaticImport,CreateDynamicImport} r=spidermonkey-reviewers,dom-worker-reviewers,dom-core,asuth,jonco,mccr8
This patch adds a module type parameter to
`ModuleLoaderBase::{CreateStaticImport,CreateDynamicImport},` and gets rid of a
bunch of hard-coded `JS::ModuleType::JavaScript.` However, the module type is
still hard-coded when we call `CreateDynamicImport` and `CreateStaticImport`.

Differential Revision: https://phabricator.services.mozilla.com/D218556
2024-08-22 14:21:51 +00:00
Jonatan Klemets
1d65cffc8b Bug 1877792 - Part 8: Add module type to ModuleLoadRequest::NewVisitedSetForTopLevelImport r=spidermonkey-reviewers,dom-worker-reviewers,dom-core,asuth,jonco,mccr8
This patch adds the new parameter to the `NewVisitedSetForTopLevelImport`
method, but we hard-code the module type (which will be addressed in a later
patch)

Differential Revision: https://phabricator.services.mozilla.com/D218555
2024-08-22 14:21:51 +00:00
Jonatan Klemets
fa63416707 Bug 1877792 - Part 7: Add ModuleLoadRequest::mModuleType r=dom-core,spidermonkey-reviewers,dom-worker-reviewers,asuth,jonco,mccr8
This patch gets rid of most hard-coded `JS::ModuleType::JavaScript` in
`js/loader/ModuleLoaderBase.cpp`. However, the module type is still hard-coded
when constructing the `ModuleLoadRequest` (will be addressed in a later patch).

Differential Revision: https://phabricator.services.mozilla.com/D218554
2024-08-22 14:21:50 +00:00
Jonatan Klemets
5855439476 Bug 1877792 - Part 6: Change ModuleLoaderBase::ResolveRequestedModules to handle URL and module type r=spidermonkey-reviewers,jonco
This patch is a small step towards the end goal, so we hardcoded the module
type to `JS::ModuleType::JavaScript`, but that will get changed in a later
patch.

Differential Revision: https://phabricator.services.mozilla.com/D218553
2024-08-22 14:21:50 +00:00
Jonatan Klemets
bf0dcb0282 Bug 1877792 - Part 3: Update module map methods to take ModuleMapKey instead of nsIURI r=spidermonkey-reviewers,jonco
Differential Revision: https://phabricator.services.mozilla.com/D218209
2024-08-22 14:21:49 +00:00
Jonatan Klemets
c0c83bb35e Bug 1877792 - Part 2: Change the module map key to include both URL and module type r=yulia,jonco
The module maps (`mFetchingModules` and `mFetchedModules`) in
`ModuleLoaderBase`, and `VisitedURLSet` were previously only keyed by the URL
and used the `nsURIHashKey` hashtable key class. This is no longer sufficient,
and the key should also contain the module type.

This patch introduces a new hashtable key class called `ModuleMapKey` and
changes `mFetchingModules`, `mFetchedModules`, and `VisitedURLSet` to use the
new key type.

To make this a bit easier to review, this first patch only introduces the new
key type and hard-codes the type to Javascript, where the key is constructed.
The hard-corded module types will be fixed in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D155160
2024-08-22 14:21:48 +00:00
Tooru Fujisawa
adec9d4fda Bug 1907009 - Part 1: Add CacheExpirationTime type. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D217957
2024-08-06 05:38:23 +00:00
Tooru Fujisawa
3f46be92f0 Bug 1896709 - Part 13: Use SharedSubResourceCache in ScriptLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215882
2024-07-18 21:58:14 +00:00
Tooru Fujisawa
dd9a53aa0d Bug 1896709 - Part 9: Add ScriptLoadRequest::CacheEntryFound. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D215878
2024-07-18 21:58:13 +00:00