Commit Graph
77 Commits
Author SHA1 Message Date
agoloman c75e2e420f Revert "Bug 2020707, Bug 2020704 - Part 6: Update test expectations now that speculationrules scripts are supported. r=dom-core-reviewers,jjaschke" for causing bc failures @browser_misused_characters_in_strings.js.
This reverts commit 524a1fc191.

Revert "Bug 2020707 - Part 5: Gate speculation rules script support behind a pref. r=dom-core-reviewers,jjaschke"

This reverts commit 11741d18ad.

Revert "Bug 2020707 - Part 4: Unregister speculation rules when their script element is removed. r=dom-core-reviewers,hsivonen"

This reverts commit 5202943dc9.

Revert "Bug 2020707 - Part 3: Report an exception if speculation rules parsing fails. r=dom-core-reviewers,jjaschke"

This reverts commit 70c5aa5425.

Revert "Bug 2020707 - Part 2: Add support for speculationrules script type. r=dom-core-reviewers,jjaschke"

This reverts commit 65b30a350b.

Revert "Bug 2020707 - Part 1: Allow speculation rules to be registered to the document from scripts. r=hsivonen,jjaschke"

This reverts commit 28c7050de9.

Revert "Bug 2020704 - Part 2: Add parser for speculation rule sets. r=hsivonen,jjaschke"

This reverts commit eabb8c6eb3.

Revert "Bug 2020704 - Part 1: Add speculation rules crate. r=dom-core-reviewers,jjaschke"

This reverts commit cd65bed005.
2026-06-12 06:28:05 +00:00
Adam Vandolder 65b30a350b Bug 2020707 - Part 2: Add support for speculationrules script type. r=dom-core-reviewers,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D286178
2026-06-12 04:48:27 +00:00
Tooru Fujisawa 036a7339ad Bug 2036190 - Convert ModuleScript to LoadedScript before caching. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D297797
2026-05-04 18:20:22 +00:00
Tooru Fujisawa 32c2970f79 Bug 2036042 - Handle invalidated cached stencil also as cached case. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D297796
2026-05-04 18:20:20 +00:00
Tooru Fujisawa c8f3bfcd6a Bug 2031077 - Part 5: Invalidate LoadedScript stencil cache on memory pressure. r=bthrall,firefox-style-system-reviewers,emilio
Even after the SharedScriptCache is cleared on memory pressure,
there can be other references to the LoadedScript, such as the imported modules.
The stencil references are no longer necessary, and the pointers should be cleared.

Differential Revision: https://phabricator.services.mozilla.com/D294602
2026-04-25 04:54:38 +00:00
Tooru Fujisawa c05d81a70a Bug 2031077 - Part 4: Add invalidated cache state for LoadedScript. r=bthrall
On memory pressure, the stencil held only for the cache should be released.
In that situation, the LoadedScript instances can still be held by
ScriptLoadRequest etc, and thus the LoadedScript instance itself should be kept
alive, while the stencil pointer being released.

Differential Revision: https://phabricator.services.mozilla.com/D294601
2026-04-25 04:54:34 +00:00
Tooru Fujisawa 7e75539d07 Bug 2031077 - Part 3: Repurpose LoadedScript::mStencil only for the cached case. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294600
2026-04-25 04:54:31 +00:00
Tooru Fujisawa edcea6935f Bug 2031200 - Part 11: Repurpose LoadedScript::mReferrerPolicy for the cached case. r=bthrall
Same as base URL, the mReferrerPolicy reflects the server response, and it
need to be retained for the cached case.
The existing consumers use the ScriptFetchInfo field.

Differential Revision: https://phabricator.services.mozilla.com/D294343
2026-04-22 04:12:44 +00:00
Tooru Fujisawa 60050df3f8 Bug 2031200 - Part 9: Add ScriptLoadRequest::FetchOptions() accessor and remove LoadedScript::mFetchOptions. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294341
2026-04-22 04:12:37 +00:00
Tooru Fujisawa 24365da24e Bug 2031200 - Part 8: Remove ScriptHashKey constructor with LoadedScript. r=bthrall
The subsequent patches will remove the fields from LoadedScript, and then
use the ScriptLoadRequest::mFetchInfo instead.
The LoadedScript variant of ScriptHashKey is no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D294340
2026-04-22 04:12:33 +00:00
Alexandru Marc bcdf79e032 Revert "Bug 2031200 - Part 12: Remove ModuleScript::mForPreload. r=allstarschh" for causing hazard bustages @ ModuleLoaderBase
This reverts commit 260ad06a2e.

Revert "Bug 2031200 - Part 11: Repurpose LoadedScript::mReferrerPolicy for the cached case. r=bthrall"

This reverts commit cedffcba4e.

Revert "Bug 2031200 - Part 10: Repurpose LoadedScript::mBaseURL for the cached case. r=bthrall"

This reverts commit a4fd83ce4d.

Revert "Bug 2031200 - Part 9: Add ScriptLoadRequest::FetchOptions() accessor and remove LoadedScript::mFetchOptions. r=bthrall"

This reverts commit 66bc9492b3.

Revert "Bug 2031200 - Part 8: Remove ScriptHashKey constructor with LoadedScript. r=bthrall"

This reverts commit 5bb4928c8f.

Revert "Bug 2031200 - Part 7: Use ScriptFetchInfo for the script private and module private instead of LoadedScript. r=bthrall,allstarschh,dom-worker-reviewers,asuth"

This reverts commit 0011dfbdcc.

Revert "Bug 2031200 - Part 6: Do not pass private value to JS::UpdateDebugMetadata. r=bthrall"

This reverts commit 0e8a2f1032.

Revert "Bug 2031200 - Part 5: Sync ModuleScript::mForPreload and ScriptFetchInfo::mIsForModulePreload. r=bthrall"

This reverts commit 0f69b1fb94.

Revert "Bug 2031200 - Part 4: Sync LoadedScript::mBaseURL and ScriptFetchInfo::mBaseURL. r=bthrall,dom-worker-reviewers,asuth"

This reverts commit 472f447c9e.

Revert "Bug 2031200 - Part 3: Sync LoadedScript::mReferrerPolicy and ScriptFetchInfo::mReferrerPolicy. r=bthrall"

This reverts commit b5410280f5.

Revert "Bug 2031200 - Part 2: Remove obsolete code to sync the exact same field. r=bthrall"

This reverts commit 2b784b6e6f.

Revert "Bug 2031200 - Part 1: Add ScriptFetchInfo class and ScriptLoadRequest::mFetchInfo field. r=bthrall"

This reverts commit fc8d3b6c48.
2026-04-21 21:28:08 +00:00
Tooru Fujisawa cedffcba4e Bug 2031200 - Part 11: Repurpose LoadedScript::mReferrerPolicy for the cached case. r=bthrall
Same as base URL, the mReferrerPolicy reflects the server response, and it
need to be retained for the cached case.
The existing consumers use the ScriptFetchInfo field.

Differential Revision: https://phabricator.services.mozilla.com/D294343
2026-04-21 15:58:13 +00:00
Tooru Fujisawa 66bc9492b3 Bug 2031200 - Part 9: Add ScriptLoadRequest::FetchOptions() accessor and remove LoadedScript::mFetchOptions. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D294341
2026-04-21 15:58:06 +00:00
Tooru Fujisawa 5bb4928c8f Bug 2031200 - Part 8: Remove ScriptHashKey constructor with LoadedScript. r=bthrall
The subsequent patches will remove the fields from LoadedScript, and then
use the ScriptLoadRequest::mFetchInfo instead.
The LoadedScript variant of ScriptHashKey is no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D294340
2026-04-21 15:58:03 +00:00
Tooru Fujisawa 887029b44e Bug 2030623 - Delay the disk cache save to avoid overlapping with performance-sensitive timing. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D293148
2026-04-16 08:58:21 +00:00
Tooru Fujisawa 813e954edf Bug 2024970 - Enable stencil navigation code on all branches, behind the pref. r=nbp,extension-reviewers,devtools-reviewers,whimboo,robwu,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D291096
2026-04-01 08:03:58 +00:00
Atila Butkovits ff6ad8cf18 Revert "Bug 2027803 - Enable stencil navigation cache on nightly. r=nbp" for causing high frequency failures at browser_dbg-event-breakpoints.js.
This reverts commit 6990290e13.

Revert "Bug 2024970 - Enable stencil navigation code on all branches, behind the pref. r=nbp,extension-reviewers,devtools-reviewers,whimboo,robwu,nchevobbe"

This reverts commit d2dd54d562.
2026-03-31 16:15:18 +00:00
Tooru Fujisawa d2dd54d562 Bug 2024970 - Enable stencil navigation code on all branches, behind the pref. r=nbp,extension-reviewers,devtools-reviewers,whimboo,robwu,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D291096
2026-03-31 11:47:13 +00:00
Tooru Fujisawa 3670c42b92 Bug 2024971 - Hide the navigation cache pref on non-nightly. r=nbp,devtools-reviewers,Sasha,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D289997
2026-03-27 10:24:28 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Tooru Fujisawa 3133642cd0 Bug 2019337 - Part 3: Collect per-process SharedScriptCache usage telemetry. r=nbp,denispal
Differential Revision: https://phabricator.services.mozilla.com/D285647
2026-03-06 08:28:54 +00:00
Tooru Fujisawa 4440b61f19 Bug 2019880 - Part 1: Do not put nonce in the ScriptHashKey. r=nbp,devtools-reviewers,jdescottes
Also modified the ChromeUtils.getCachedJavaScriptSource not to receive the
nonce parameter, and updated the consumers.

Differential Revision: https://phabricator.services.mozilla.com/D285204
2026-03-02 12:25:04 +00:00
Tooru Fujisawa 14aace83bc Bug 2017100 - Part 6: Add SharedScriptCache::GetCachedScriptSource. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D283564
2026-02-24 10:06:58 +00:00
Tooru Fujisawa 5771ff9a91 Bug 2017100 - Part 1: Add ScriptHashKey::{ToStringForLookup,FromStringsForLookup}. r=nbp
ToStringForLookup stringifies a subset of ScriptHashKey fields, which cannot be
directly extracted from the channel on the DevTools side.

Differential Revision: https://phabricator.services.mozilla.com/D283559
2026-02-24 10:06:45 +00:00
Tooru Fujisawa 2569e00696 Bug 2017052 - Part 3: Remove SRIMetadata from ScriptCacheKey. r=nbp
Given SRIMetadata is partially ordered, using it in a key makes the logic complex and too strict.
Move the SRIMetadata validation after the lookup.

Differential Revision: https://phabricator.services.mozilla.com/D283542
2026-02-24 02:24:27 +00:00
Tooru Fujisawa e67d277ab2 Bug 2014418 - Part 2: Clear SharedScriptCache and SharedStyleSheetCache on memory pressure. r=nbp,emilio,firefox-style-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D281957
2026-02-12 04:31:56 +00:00
Tooru Fujisawa da2d987339 Bug 1907011 - Part 3: Rename LoadedScript::DropBytecode to LoadedScript::DropSRIOrSRIAndSerializedStencil. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273956
2025-11-26 04:13:15 +00:00
Tooru Fujisawa dee0f66355 Bug 1907011 - Part 2: Split LoadedScript::SRIAndBytecode into LoadedScript::SRI and LoadedScript::SRIAndSerializedStencil for each cosnumer. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273955
2025-11-26 04:13:12 +00:00
Tooru Fujisawa d2fc907d62 Bug 2001368 - Add notification for the SharedScriptCache invalidation. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273441
2025-11-21 12:36:11 +00:00
Tooru Fujisawa a2e5b3c887 Bug 1999649 - Part 3: Reorder ScriptHashKey fields and the KeyEquals logic to match the order between them. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D272506
2025-11-19 03:49:52 +00:00
Tooru Fujisawa 2c34563229 Bug 1999649 - Part 2: Remove unused mIsLinkRelPreload field. r=bthrall
Preload or not is unrelated to the cache content.

Differential Revision: https://phabricator.services.mozilla.com/D272505
2025-11-19 03:49:50 +00:00
Tooru Fujisawa 15bece78c5 Bug 1999649 - Part 1: Reflect ReferrerPolicy to the ScriptHashKey. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D272504
2025-11-19 03:49:47 +00:00
Tooru Fujisawa e697a404bb Bug 1998925 - Part 2: Add ChromeUtils.invalidateResourceCache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D271876
2025-11-19 03:47:17 +00:00
Tooru Fujisawa 1dd3500848 Bug 1997870 - Part 4: Perform the encoding and the compression off main thread. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271035
2025-11-11 08:28:36 +00:00
Tooru Fujisawa 707e3dbad3 Bug 1997870 - Part 3: Split EncodeBytecodeAndSave into two steps. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271034
2025-11-11 08:28:34 +00:00
Cristian Tuns adb38904a5 Revert "Bug 1997870 - Part 4: Perform the encoding and the compression off main thread. r=bthrall" for causing build bustages in SharedScriptCache.cpp
This reverts commit c6b62c4029.

Revert "Bug 1997870 - Part 3: Split EncodeBytecodeAndSave into two steps. r=bthrall"

This reverts commit f6fed9057d.

Revert "Bug 1997870 - Part 2: Make BytecodeMimeTypeFor methods take const. r=bthrall"

This reverts commit 751adfcc4b.

Revert "Bug 1997870 - Part 1: Remove obsolete comment. r=bthrall"

This reverts commit cc15fbf365.
2025-11-10 12:12:57 +00:00
Tooru Fujisawa c6b62c4029 Bug 1997870 - Part 4: Perform the encoding and the compression off main thread. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271035
2025-11-10 11:32:38 +00:00
Tooru Fujisawa f6fed9057d Bug 1997870 - Part 3: Split EncodeBytecodeAndSave into two steps. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D271034
2025-11-10 11:32:36 +00:00
Tooru Fujisawa f70e74238b Bug 1980154 - Part 4: Use SharedScriptCache for disk cache handling when navigation cache is enabled. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270524
2025-10-31 05:24:30 +00:00
Tooru Fujisawa f211bee4de Bug 1980154 - Part 3: Add SharedScriptCache::UpdateDiskCache that saves cached stencils into the disk cache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D270523
2025-10-31 05:24:28 +00:00
Tooru Fujisawa 4998e85111 Bug 1991629 - Reorder ScriptHashKey fields. r=bthrall
Differential Revision: https://phabricator.services.mozilla.com/D267362
2025-10-23 04:19:06 +00:00
Tooru Fujisawa cde6c638b3 Bug 1991607 - Part 10: Remove ScriptLoadRequest::mURI. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267359
2025-10-22 11:20:59 +00:00
Tooru Fujisawa 9cd82d3aa1 Bug 1991607 - Part 8: Remove ScriptLoadRequest::mFetchOptions. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267357
2025-10-22 11:20:53 +00:00
Tooru Fujisawa 64ff55f333 Bug 1991607 - Part 1: Let ScriptHashKey and ScriptLoadData receive LoadedScript-related parameters separately. r=bthrall
This is a preparation for the later patches.

ScriptFetchOptions and URI fields are duplicated between ScriptLoadRequest and
LoadedScript, and this patch stack is going to remove them from
ScriptLoadRequest.

At the point of ScriptLoader::TryUseCache, LoadedScript is not yet created,
and ScriptHashKey needs to receive ScriptFetchOptions and URI in addition to
ScriptLoadRequest.

In order to avoid misuse, ScriptHashKey constructor is split into two variants.
One receives ScriptLoadRequest+ScriptFetchOptions+nsIURI, which is for
the case LoadedScript is not yet created,
and the other receives ScriptLoadRequest+LoadedScript, which is for the case
LoadedScript is already created.

Differential Revision: https://phabricator.services.mozilla.com/D267349
2025-10-22 11:20:36 +00:00
Atila Butkovits 13ff5f1bad Revert "Bug 1991607 - Part 12: Reorder ScriptLoadRequest/ModuleLoadRequest fields. r=bthrall" for causing bustages at LoadedScript.cpp.
This reverts commit 30499d5cdc.

Revert "Bug 1991607 - Part 11: Remove ScriptLoadRequest::mBaseURL. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 85324622ab.

Revert "Bug 1991607 - Part 10: Remove ScriptLoadRequest::mURI. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 3b1afd5ca0.

Revert "Bug 1991607 - Part 9: Pass URI to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 10dc4e2bc0.

Revert "Bug 1991607 - Part 8: Remove ScriptLoadRequest::mFetchOptions. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit b4c09eb6e1.

Revert "Bug 1991607 - Part 7: Pass FetchOptions to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit f48d2160e1.

Revert "Bug 1991607 - Part 6: Remove ScriptLoadRequest::mReferrerPolicy. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit a6901c3f1d.

Revert "Bug 1991607 - Part 5: Pass ReferrerPolicy to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit c2b5cb885a.

Revert "Bug 1991607 - Part 4: Add ImportMapScript subclass for LoadedScript. r=bthrall"

This reverts commit 09b8ae44b8.

Revert "Bug 1991607 - Part 3: Make LoadedScript::mKind field const. r=bthrall"

This reverts commit 3eebccc479.

Revert "Bug 1991607 - Part 2: Let ScriptLoader::CheckContentPolicy receive LoadedScript-related parameters separately. r=bthrall"

This reverts commit dd8530cb71.

Revert "Bug 1991607 - Part 1: Let ScriptHashKey and ScriptLoadData receive LoadedScript-related parameters separately. r=bthrall"

This reverts commit b4a4f94096.
2025-10-22 05:40:38 +00:00
Tooru Fujisawa 3b1afd5ca0 Bug 1991607 - Part 10: Remove ScriptLoadRequest::mURI. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267359
2025-10-22 04:38:17 +00:00
Tooru Fujisawa b4c09eb6e1 Bug 1991607 - Part 8: Remove ScriptLoadRequest::mFetchOptions. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267357
2025-10-22 04:38:11 +00:00
Tooru Fujisawa b4a4f94096 Bug 1991607 - Part 1: Let ScriptHashKey and ScriptLoadData receive LoadedScript-related parameters separately. r=bthrall
This is a preparation for the later patches.

ScriptFetchOptions and URI fields are duplicated between ScriptLoadRequest and
LoadedScript, and this patch stack is going to remove them from
ScriptLoadRequest.

At the point of ScriptLoader::TryUseCache, LoadedScript is not yet created,
and ScriptHashKey needs to receive ScriptFetchOptions and URI in addition to
ScriptLoadRequest.

In order to avoid misuse, ScriptHashKey constructor is split into two variants.
One receives ScriptLoadRequest+ScriptFetchOptions+nsIURI, which is for
the case LoadedScript is not yet created,
and the other receives ScriptLoadRequest+LoadedScript, which is for the case
LoadedScript is already created.

Differential Revision: https://phabricator.services.mozilla.com/D267349
2025-10-22 04:37:52 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00