1319 Commits

Author SHA1 Message Date
Nika Layzell
31a3ea2fb1 Bug 1966936 - Switch various IPC IDs to 64-bits, r=ipc-reviewers,mccr8,jld a=RyanVM
This changes a few IDs which have historically been 32-bit integers to
instead be 64-bit integers, reducing the chance of the value
overflowing.

Differential Revision: https://phabricator.services.mozilla.com/D250502
2025-06-03 02:57:50 +00:00
Tom Schuster
e709a4d123 Bug 1964754 - Remove nsIContentPolicy TYPE_OBJECT_SUBREQUEST. r=necko-reviewers,webdriver-reviewers,extension-reviewers,devtools-reviewers,valentin,robwu,whimboo,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D250027
2025-05-22 08:27:55 +00:00
serge-sans-paille
bf3516e81e Bug 1964489 - Avoid duplication in NS_DECLARE_STATIC_IID_ACCESSOR / NS_DEFINE_STATIC_IID_ACCESSOR r=nika,necko-reviewers,media-playback-reviewers,places-reviewers,win-reviewers,dom-storage-reviewers,xpcom-reviewers,gstoll,janv,emilio,padenot,valentin,asuth
In modern C++, static constexpr member variables are automatically
inline (aka weak) so the template trick is not needed. This also avoid
duplication and reduces the amount of parsed code. No impact on
generated binary (actually: smaller debuginfo, close to identical
binary).

Differential Revision: https://phabricator.services.mozilla.com/D247825
2025-05-08 08:05:51 +00:00
Jan Varga
7520b08ab6 Bug 1957433 - QM: Adjust tests to disable quota info cache and avoid relying on origin access time updates; r=dom-storage-reviewers,jstutte
Updates several tests to explicitly disable the quota info cache by setting
dom.quotaManager.loadQuotaFromCache to false.

These tests were previously relying on origin access time updates (which set
the "accessed" flag) to trigger full origin scans. This behavior was a side
effect rather than an intentional part of the test logic.

Disabling the quota info cache ensures these tests do not depend on unrelated
behavior and continue to pass even when access time updates are disabled via
the dom.quotaManager.temporaryStorage.updateOriginAccessTime pref.

This is a follow-up to the patch that added the pref for manual testing.

Differential Revision: https://phabricator.services.mozilla.com/D243784
2025-04-17 16:40:56 +00:00
Jan Varga
d5cca7bb2d Bug 1957367 - QM: Convert OpenClientDirectory and its callers to use ClientDirectoryLockHandle; r=dom-storage-reviewers,jstutte
Converts OpenClientDirectory to return ClientDirectoryLockHandle instead of
RefPtr<ClientDirectoryLock>, and updates all its callers accordingly.

ClientDirectoryLockHandle is a move-only RAII wrapper that ensures the lock
is automatically dropped when the handle goes out of scope. This simplifies
ownership semantics and aligns with diagnostic assertions that verify proper
lock dropping.

This patch finalizes the transition for quota clients to use
ClientDirectoryLockHandle instead of client directory locks directly.

Differential Revision: https://phabricator.services.mozilla.com/D243665
2025-04-15 12:25:49 +00:00
Joel Maher
b46dfdb253 Bug 1959284 - clean and sanitize caps|chrome|docshell|dom/**/xpcshell.toml. r=aryx,dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D244838
2025-04-09 14:36:35 +00:00
Florian Quèze
9885783942 Bug 1956726 - remove leftover Telemetry.h includes in .cpp files, r=chutten,geckoview-reviewers,cookie-reviewers,win-reviewers,dom-storage-reviewers,gstoll,valentin,m_kato,janv.
Differential Revision: https://phabricator.services.mozilla.com/D244351
2025-04-08 13:03:02 +00:00
Andrew McCreight
ecb7c82162 Bug 1958405 - Move CachesEnabled out of nsGlobalWindowInner. r=webidl,smaug,asuth
Having this method here means nsGlobalWindowInner needs to be included in a number
of bindings files, and doesn't make a lot of sense. This patch moves it to Cache
and CacheStorage (the latter being a wrapper around the former) to avoid extra
includes.

Differential Revision: https://phabricator.services.mozilla.com/D244443
2025-04-03 22:26:13 +00:00
Jens Stutte
589bee8c53 Bug 1951283 - Invert the default of aCreateDirIfNotExists in BodyIdToFile. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D240769
2025-03-08 22:11:12 +00:00
Jens Stutte
d511cad37c Bug 1951283 - Avoid needless attempt to create the cache directory in BodyMaybeUpdatePaddingSize. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D240741
2025-03-08 22:11:12 +00:00
Jens Stutte
c588855458 Bug 1951283 - Avoid needless attempt to create the cache directory in BodyOpen. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D240740
2025-03-08 22:11:11 +00:00
Jens Stutte
87539771fb Bug 1951283 - Avoid needless attempt to create the cache directory in GetBodyDiskSize. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D240739
2025-03-08 22:11:11 +00:00
Jens Stutte
cc3d66def9 Bug 1951283 - Avoid needless attempt to create the cache directory in BodyFinalizeWrite. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D240738
2025-03-08 22:11:10 +00:00
Jens Stutte
e06739134f Bug 1951283 - Avoid duplicate attempt to create the cache directory in BodyStartWriteStream. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D240737
2025-03-08 22:11:10 +00:00
Jens Stutte
54ccaa7962 Bug 1951283 - Simplify and rename BodyTraverseFiles to BodyTraverseFilesForCleanup. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D240736
2025-03-08 22:11:10 +00:00
Jens Stutte
d24c20e208 Bug 1951283 - Wrap aDirectoryMetadata into Some in BodyDeleteOrphanedFiles. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D240735
2025-03-08 22:11:09 +00:00
Jens Stutte
4506cefa1a Bug 1951283 - Speedup id lookups by using a hash set in BodyDeleteOrphanedFiles. r=dom-storage-reviewers,asuth
The basic functionality remains the same, including the use of
BodyTraverseFile with all its cleanups.

Differential Revision: https://phabricator.services.mozilla.com/D240734
2025-03-08 22:11:09 +00:00
Jens Stutte
968563f972 Bug 1951283 - Simplify BodyDeleteFiles. r=dom-storage-reviewers,asuth
BodyTraverseFile does an expensive directory traversal while we
basically already know, which files we want to delete and can construct
their paths directly from the id.

BodyTraverseFile's additional functionality of deleting folders or
orphaned temp files it encounters while traversing is not resembled
here and we expect the caller to know what should be deleted. However,
we do delete orphaned temp files matching any of the passed ids.

Differential Revision: https://phabricator.services.mozilla.com/D240733
2025-03-08 22:11:08 +00:00
Jan Varga
15fc9d616d Bug 1944805 - Add a marionette testing variant for incremental origin initialization; r=jmaher,releng-reviewers,dom-storage-reviewers,taskgraph-reviewers,jari,bhearsum
Differential Revision: https://phabricator.services.mozilla.com/D236480
2025-02-16 12:28:07 +00:00
Jan Varga
259d749b9f Bug 1944495 - Add a mochitest-browser-chrome testing variant for incremental origin initialization; r=dom-storage-reviewers,jmaher,jari
Differential Revision: https://phabricator.services.mozilla.com/D235970
2025-02-16 07:43:20 +00:00
Jan Varga
9a5e9a32d4 Bug 1942819 - Add a mochitest-plain testing variant for incremental origin initialization; r=dom-storage-reviewers,taskgraph-reviewers,jmaher,hsingh
Differential Revision: https://phabricator.services.mozilla.com/D234969
2025-01-28 10:06:29 +00:00
Jan Varga
63fb99fb1f Bug 1942246 - Add an xpcshell testing variant for incremental origin initialization; r=dom-storage-reviewers,taskgraph-reviewers,jmaher,hsingh
Differential Revision: https://phabricator.services.mozilla.com/D234644
2025-01-26 20:54:04 +00:00
Joel Maher
bcc50efbeb Bug 1940980 - Green up win11-64 opt/debug/asan/ccov. r=aryx,media-playback-reviewers,pip-reviewers,credential-management-reviewers,devtools-reviewers,tabbrowser-reviewers,urlbar-reviewers,aosmond,mconley,ochameau,dimi,jteow,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D233862
2025-01-16 23:02:48 +00:00
Jonatan Klemets
d60f6391b3 Bug 1858078 - Part 1: Add nsIContentPolicy::{TYPE_JSON,TYPE_INTERNAL_JSON_PRELOAD} r=extension-reviewers,webidl,devtools-reviewers,dom-core,smaug,robwu,tschuster,nchevobbe,farre
Differential Revision: https://phabricator.services.mozilla.com/D229524
2024-12-12 17:39:18 +00:00
Harveer Singh
c242346ebd Bug 1898763: An attempt to fix intermittent failing test, test_caches_delete_cleanup_after_shutdown.py.r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D229992
2024-11-29 17:38:48 +00:00
Sylvestre Ledru
2ca9d22cf4 Bug 1921433 - reformat with black 24.8.0 r=linter-reviewers,webdriver-reviewers,perftest-reviewers,taskgraph-reviewers,releng-reviewers,dom-storage-reviewers,janv,jmaher,whimboo,afinder,ahal
Differential Revision: https://phabricator.services.mozilla.com/D223963
2024-11-03 20:28:59 +00:00
Andrew Sutherland
5fa466d4ef Bug 1113522 - Expose ServiceWorker in Workers. r=dom-worker-reviewers,webidl,edenchuang,emilio
We are able to remove ServiceWorkerVisible and instead use
ServiceWorkersEnabled in its place since we are no longer limiting
where ServiceWorker instances are exposed.

The correctness of ExtendableMessageEvent.source is addressed later in
the stack.

Although we enable skip-waiting-installed.https.html here, we also have
to make it expected it will sometimes fail due to an inherent IPC race;
bug 1926641 describes the situation.

Differential Revision: https://phabricator.services.mozilla.com/D180914
2024-10-24 03:02:37 +00:00
Jan Varga
48a999da72 Bug 1904562 - Change DirectoryLockImpl to be topmost class; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D214857
2024-10-21 09:31:27 +00:00
Jan Varga
739a9047a6 Bug 1904562 - Convert CacheAPI to use concrete directory lock type; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D214854
2024-10-21 09:31:25 +00:00
Jan Varga
e3dea7bd08 Bug 1904562 - Move ClientDirectoryLock to separate files and make it inherit from DirectoryLockImpl; r=dom-storage-reviewers,aiunusov
Differential Revision: https://phabricator.services.mozilla.com/D214849
2024-10-21 09:31:23 +00:00
Jan Varga
c5cca70c0a Bug 1904562 - ClientImpl.h shouldn't include DirectoryLock.h; r=dom-storage-reviewers,asuth
Consumers should include corresponding headers for concrete type instead. This
will be especially needed when there will be separate includes for different
types of locks.

Differential Revision: https://phabricator.services.mozilla.com/D214813
2024-10-21 09:31:20 +00:00
Jan Varga
dcedb93285 Bug 1867997 - Simplify signature of QuotaManager::OnOriginClearCompleted; r=dom-storage-reviewers,jari
OnOriginClearCompleted currently takes two separate arguments which can be
expressed as just one argument.

Differential Revision: https://phabricator.services.mozilla.com/D198494
2024-10-18 13:14:03 +00:00
Jan Varga
8cdc63b5d9 Bug 1867997 - Move nsIPrincipal/PrincipalInfo helpers to separate files; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D223992
2024-10-18 01:32:36 +00:00
Jan Varga
dbc9573884 Bug 1867997 - Change QuotaManager::GetInfoFromValidatedPrincipalInfo to be a stacic method; r=dom-storage-reviewers,jari
This is a preparation for moving all nsIPrincipal and PrincipalInfo helpers to separate source files.

Differential Revision: https://phabricator.services.mozilla.com/D223950
2024-10-18 01:32:35 +00:00
Jan Varga
beb966a005 Bug 1866402 - Replace most of QuotaManager::EnsurePersistentOriginIsInitializedInternal and QuotaManager::EnsureTemporaryOriginIsInitializedInternal calls; r=dom-storage-reviewers,jari
QuotaManager::OpenClientDirectory already makes sure that corresponding origin
is initialized so all places where a client directory lock is obtained in such
way can start using QuotaManager::GetOriginDirectory instead of
QuotaManager::EnsurePersistentOriginIsInitializedInternal and
QuotaManager::GetOrCreateTemporaryOriginDirectory instead of
QuotaManager::EnsureTemporaryOriginIsInitializedInternal.

Differential Revision: https://phabricator.services.mozilla.com/D195589
2024-10-13 23:05:25 +00:00
Jan Varga
7783acd7c8 Bug 1866402 - Make it possible to initialize temporary origins without ensuring origin directories; r=dom-storage-reviewers,jari
LSNG already uses some QuotaManager APIs to achieve that origin directories are
not created if they don't exist during datastore preparation, but the feature
is not easy to use and it's also not generalized enough for use in other quota
clients. Besides that, the way how it's currently done in LSNG complicates
removal of QuotaManager::EnsureTemporaryOriginIsInitializedInternal calls from
LSNG. This patch is about generalizing of the feature, making it available to
all quota clients.

Differential Revision: https://phabricator.services.mozilla.com/D195551
2024-10-12 20:58:36 +00:00
Sebastian Hengst
1a2fdf5653 Backed out 7 changesets (bug 1866402) for causing crashes (bug 1762908). a=backout
Backed out changeset 6180f2e753bd (bug 1866402)
Backed out changeset f25dfc157ef7 (bug 1866402)
Backed out changeset d63dac1ee4d4 (bug 1866402)
Backed out changeset 2ab08c49f2b1 (bug 1866402)
Backed out changeset 48781c71d287 (bug 1866402)
Backed out changeset a649d075c9b3 (bug 1866402)
Backed out changeset cc03e4975743 (bug 1866402)
2024-10-11 12:47:35 +02:00
Jan Varga
a426b86e42 Bug 1866402 - Make it possible to initialize temporary origins without ensuring origin directories; r=dom-storage-reviewers,jari
LSNG already uses some QuotaManager APIs to achieve that origin directories are
not created if they don't exist during datastore preparation, but the feature
is not easy to use and it's also not generalized enough for use in other quota
clients. Besides that, the way how it's currently done in LSNG complicates
removal of QuotaManager::EnsureTemporaryOriginIsInitializedInternal calls from
LSNG. This patch is about generalizing of the feature, making it available to
all quota clients.

Differential Revision: https://phabricator.services.mozilla.com/D195551
2024-10-10 12:22:55 +00:00
Jan Varga
cb34e72478 Bug 1866402 - Replace some nsIQuotaManagerService::ResetStoragesForPrincipal calls with nsIQuotaManagerService::ResetStoragesForClient; r=dom-storage-reviewers,jari
There's now a dedicated nsIQuotaManagerService::ResetStoragesForClient method
for resetting storages by client type. All callers of
nsIQuotaManagerService::ResetStoragesForPrincipal which want to reset storages
for a specific client only can be now converted to call the new method.

Differential Revision: https://phabricator.services.mozilla.com/D195509
2024-10-09 11:59:34 +00:00
Jan Varga
fc0786849f Bug 1913561 - Remove QuotaManager::EnsureTemporaryStorageIsInitializedInternal calls from places where a directory lock is obtained via QuotaManager::OpenClientDirectory; r=dom-storage-reviewers,jari
QuotaManager::OpenClientDirectory already makes sure that temporary storage
is initialized so all these calls are now redundant.

Differential Revision: https://phabricator.services.mozilla.com/D195391
2024-10-06 02:01:00 +00:00
Jan Varga
961fede4de Bug 1919507 - Cache: Add an extra check for invalidated directory locks to Context::OnQuotaInit; r=dom-storage-reviewers,asuth
Cache implementation already handles directory locks invalidated during
database initialization by canceling corresponding QuotaInitRunnable, this
patch adds an extra check for that to Context::OnQuotaInit.

Differential Revision: https://phabricator.services.mozilla.com/D220451
2024-10-02 10:34:28 +00:00
Jan Varga
23db1bccc7 Bug 1919507 - Cache: Complete pending actions in Context::OnQuotaInit with correct error code when the context was canceled; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D220405
2024-10-02 10:34:27 +00:00
Jan Varga
34dd53e84c Bug 1919507 - Cache: Allow completion of pending actions in Context::OnQuotaInit when the context was canceled; r=dom-storage-reviewers,asuth
Cache implementation already handles directory locks invalidated during
database initialization, but test_slowDatabaseInitialization.js still hangs.
The issue is that Context::CancelAll currently just clears all pending actions
if the state is STATE_CONTEXT_INIT (the promise for caches.open is never
resolved or rejected). Instead of just clearing pending actions, the pending
actions need to be completed first when QuotaInitRunnable is done and only then
cleared.

Differential Revision: https://phabricator.services.mozilla.com/D220263
2024-10-02 10:34:27 +00:00
Jan Varga
7c17884e4b Bug 1919507 - Add a test for origin clearing requested right after starting database work for Cache; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D220262
2024-10-02 10:34:27 +00:00
Jan Varga
ff90933b7a Bug 1919507 - Cache: Add support for pausing QM IO thread after finishing database initialization; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D220261
2024-10-02 10:34:26 +00:00
Jan Varga
ad672752b7 Bug 1919507 - Cache: Add a new testing only notification for database work starting; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D220260
2024-10-02 10:34:26 +00:00
Jan Varga
76ff5384e2 Bug 1919507 - Set dom.caches.testing.enabled for all Cache xpcshell tests; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D220259
2024-10-02 10:34:25 +00:00
Jan Varga
b90cee3d1f Bug 1917466 - Cache: Add handling for invalidated directory locks; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D219737
2024-09-17 11:11:34 +00:00
Jan Varga
4da2507fe4 Bug 1917466 - Add a test for origin clearing requested right after starting client directory opening for Cache; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D219736
2024-09-17 11:11:34 +00:00
Tom Schuster
87e0cb2fb6 Bug 1773976 - Add a new nsContentPolicyType TYPE_INTERNAL_EXTERNAL_RESOURCE. r=emilio
This is maybe not the best name, but at least it is not a lie.

Differential Revision: https://phabricator.services.mozilla.com/D216789
2024-09-09 12:16:12 +00:00