Commit Graph

1352 Commits

Author SHA1 Message Date
Jan Varga
1fb6fc3d34 Bug 1878841 - Add testing for stopping of connection idle maintenance; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D201060
2024-02-27 17:18:15 +00:00
Jan Varga
d22f86b67e Bug 1878841 - Add support for pausing IndexedDB connection thread during connection idle maintenance; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D200780
2024-02-27 17:18:15 +00:00
Jan Varga
fc9d189f21 Bug 1878841 - Fix madeProgress check in DatabaseConnection::ReclaimFreePagesWhileIdle; r=dom-storage-reviewers,jari
The warn only check is supposed to mach the debug only assertion, but it
is actually not in line with the assertion causing a lot of warnings during
test_connection_idle_maintenance.js execution.

Differential Revision: https://phabricator.services.mozilla.com/D200770
2024-02-27 17:18:15 +00:00
Jan Varga
d2a9f64d41 Bug 1878841 - Add basic testing for connection idle maintenance; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D200765
2024-02-27 17:18:14 +00:00
Jari Jalkanen
5157481604 Bug 1547047 - Annotate argument names for clarity. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D197598
2024-02-27 09:10:31 +00:00
Kelsey Gilbert
49ebda2f49 Bug 1037100 - Scoped.h removed because no outstanding uses. r=glandium,dom-storage-reviewers,jesup,janv
Differential Revision: https://phabricator.services.mozilla.com/D201763
2024-02-14 06:41:58 +00:00
Jan Varga
60c524eb90 Bug 1808294 - Add support for directory lock categories; r=dom-storage-reviewers,aiunusov,jari
Differential Revision: https://phabricator.services.mozilla.com/D193105
2024-02-12 10:24:53 +00:00
Jan Varga
3dd1e04935 Bug 1855142 - Clean up PrincipalInfo type assertions in FactoryOp::Open and FactoryOp::CheckPermission; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D189753
2024-02-07 17:48:41 +00:00
Jan Varga
de50af04c5 Bug 1855142 - Move private browsing checks from FactoryOp::CheckPermission to FactoryOp::Open; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D189752
2024-02-07 17:48:40 +00:00
Jan Varga
b4284d1af4 Bug 1855142 - Move the persistence type assertion from FactoryOp::CheckPermission to FactoryOp::Open; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D189747
2024-02-07 17:48:40 +00:00
Jan Varga
a996ac814c Bug 1855142 - Replace FactoryOp::mContentHandle with mContentParentId; r=dom-storage-reviewers,jari
FactoryOp::mContentHandle was only needed to get a ContentParent to eventually
kill invalid child processes. This is now ensured directly by IPC_FAIL, so
mContentHandle can be safely replaced with mContentParentId which is still
needed for creation of Database objects (which need it for implementation of
Database::IsOwnedByProcess).

Differential Revision: https://phabricator.services.mozilla.com/D189718
2024-02-07 17:48:39 +00:00
Jan Varga
0bbc0a5a98 Bug 1855142 - Check against invalid principals only on the PBackground thread before factory operations are even created; r=dom-storage-reviewers,jari
IPC_FAIL returned in PBackground based parent actors now also asynchronously
kills invalid child processes, so there's no need to do it as a factory operation
step (on the main thread).

Differential Revision: https://phabricator.services.mozilla.com/D189717
2024-02-02 06:13:13 +00:00
Jan Varga
4e70d46acf Bug 1855142 - Remove FactoryOp::mChromeWriteAccessAllowed and Database::mChromeWriteAccessAllowed; r=dom-storage-reviewers,jari
mChromeWriteAccessAllowed is currently either always false for content
principals or always true for the system principal. There's only one check
in Database::AllocPBackgroundIDBTransactionParent which always passes, so
mChromeWriteAccessAllowed can be safely removed.

Differential Revision: https://phabricator.services.mozilla.com/D189715
2024-02-02 06:13:13 +00:00
Jan Varga
2635664c2f Bug 1855142 - Remove FactoryOp::CheckAtLeastOneAppHasPermission; r=dom-storage-reviewers,jari
FactoryOp::CheckAtLeastOneAppHasPermission always returns true after bug
1286190, so it can be safely removed.

Differential Revision: https://phabricator.services.mozilla.com/D189713
2024-02-02 06:13:12 +00:00
Nika Layzell
7db34c95ff Bug 1874739 - Part 4: Make PBackgroundIDBDatabase refcounted, r=dom-storage-reviewers,janv
This is part of removing [ManualDealloc] from all protocols which manage other
protocols.

Differential Revision: https://phabricator.services.mozilla.com/D198614
2024-01-19 20:23:19 +00:00
Jan Varga
aeaf137c6b Bug 1871799 - Fix relevant quota clients to always use QuotaVFS for database access; r=dom-storage-reviewers,asuth
Some quota clients currently use the BaseVFS (instead of QuotaVFS) during
origin initialization which makes sense at first glance (there's no need to
track usage when temporary storage is only being initialized).
However, QuotaVFS provides other important functionality besides quota checks
which is the overridden xFullPathname method. The overridden implementation is
needed to avoid file path normalization on Windows.
This patch changes relevant quota clients to always use QuotaVFS, even during
origin initialization to take advantage of the overriden xFullPathname method.
There will be no quota checks during origin initialization just like before
because the passed directory lock id is -1. GetQuotaObject will return nullptr
in that case.

Depends on D198187

Differential Revision: https://phabricator.services.mozilla.com/D198188
2024-01-10 21:10:14 +00:00
Jari Jalkanen
1552fa27c2 Bug 1860486 - Fix IDB object store clear() performance regression. r=dom-storage-reviewers,janv
Depends on D196579

Differential Revision: https://phabricator.services.mozilla.com/D195204
2024-01-02 16:52:16 +00:00
Natalia Csoregi
38221db05b Backed out 2 changesets (bug 1860486) for causing failures on test_clear_object_store_with_indexes.js. CLOSED TREE
Backed out changeset a7618fbeaa67 (bug 1860486)
Backed out changeset 9fc6ae90cc51 (bug 1860486)
2023-12-22 16:52:44 +02:00
Jari Jalkanen
9b32edd799 Bug 1860486 - Fix IDB object store clear() performance regression. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D195204
2023-12-22 13:34:47 +00:00
Jan Varga
c3f18dd105 Bug 1808294 - Rename EnsureTemporaryStorageIsInitialized to EnsureTemporaryStorageIsInitializedInternal; r=dom-storage-reviewers,asuth
One of the goals of the asynchronous temporary storage initialization is to
call EnsureTemporaryStorageIsInitialized only from InitTemporaryStorageOp.
Calling from other places including quota clients will be disallowed by
changing the method to a private method. The private nature of the method
should be emphasized by adding the Internal suffix.

Differential Revision: https://phabricator.services.mozilla.com/D188332
2023-12-08 05:55:04 +00:00
Dana Keeler
8f7101d02e Bug 1840144 - clean up some TLS socket creation error handling r=jschanck
Differential Revision: https://phabricator.services.mozilla.com/D193722
2023-11-21 16:41:25 +00:00
hsingh
c80ea97d51 Bug 1835298: Encrypt CacheAPI data on disk in PBM.r=dom-storage-reviewers,janv
Depends on D180296

Differential Revision: https://phabricator.services.mozilla.com/D180297
2023-10-27 14:10:08 +00:00
Jari Jalkanen
4593fbfb11 Bug 1791767 - Manage thread serial numbers from IDB ConnectionPool. r=dom-storage-reviewers,janv
Depends on D190599

Differential Revision: https://phabricator.services.mozilla.com/D191295
2023-10-19 07:47:47 +00:00
Jari Jalkanen
c1f6cb6857 Bug 1791767 - Make thread pool event target available in IDB ConnectionPool. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D190599
2023-10-18 15:35:41 +00:00
Jari Jalkanen
84edd2c8ab Bug 1791767 - Use a serial event target to debug IDB connection threads. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D190598
2023-10-13 12:42:47 +00:00
Jari Jalkanen
3a3213fddc Bug 1791767 - Simplify databases complete callbacks. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D190279
2023-10-12 11:05:54 +00:00
Emilio Cobos Álvarez
d02e297b2d 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
Michael van Straten
724c7b9c27 Bug 1855216 - Added missing fallthrough attributes to ToKeyOnlyType r=jari,dom-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D190466
2023-10-09 15:04:56 +00:00
Jan Varga
ab9dac8afb Bug 1857556 - Clear cipher keys during database file manager invalidation; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D190309
2023-10-06 18:47:28 +00:00
Jan Varga
6698caa692 Bug 1749504 - Convert IndexedDB to use the new way to access the storage directory; r=dom-storage-reviewers,jstutte
IndexedDB currently creates a universal directory lock first and then when the
universal directorylock is acquired, it bounces to the QuotaManager I/O thread
where it ensures that storage is initialized. This can be now replaced by just
calling QuotaManager::OpenStorageDirectory.
The elimination of QuotaManager::EnsureStorageIsInitializedInternal calls in
IndexedDB is now complete.

Changes done in this patch:
- replaced QuotaManager::CreateDirectoryLockInternal call with
  QuotaManager::OpenStorageDirectory
- removed QuotaManager::EnsureStorageIsInitializedInternal call from
  Maintenance::DirectoryWork
- changed Maintenance to not inherit from OpenDirectoryListener

Differential Revision: https://phabricator.services.mozilla.com/D186135
2023-09-17 06:37:28 +00:00
Jan Varga
0935354d58 Bug 1749504 - Convert IndexedDB to use the new way to access a client directory; r=dom-storage-reviewers,jstutte
IndexedDB currently creates a client directory lock first and then when the
client directorylock is acquired, it bounces to the QuotaManager I/O thread
where it ensures that storage is initialized. This can be now replaced by just
calling QuotaManager::OpenClientDirectory.
The database maintenance can't use QuotaManager::OpenClientDirectory, a special
method will have to be added to QuotaManager for that.

Changes done in this patch:
- replaced QuotaManager::CreateDirectoryLock calls with
  QuotaManager::OpenClientDirectory calls
- removed QuotaManager::EnsureStorageIsInitializedInternal call from
  OpenDatabaseOp::DoDatabaseWork
- changed FactoryOp to not inherit from OpenDirectoryListener
- changed DeleteFilesRunnable to not inherit from OpenDirectoryListener

Differential Revision: https://phabricator.services.mozilla.com/D186120
2023-09-17 06:37:28 +00:00
Jan Varga
7a036fc598 Bug 1749504 - Simplify signature of QuotaManager::CreateDirectoryLock; r=dom-storage-reviewers,jstutte
CreateDirectoryLock currently takes three separate arguments which can be
expressed as just one argument.

Changes done in this patch:
- QuotaManager::CreateDirectoryLock changed to take just client metadata
- all call sites updated to reflect the changed signature

Differential Revision: https://phabricator.services.mozilla.com/D185568
2023-09-12 12:40:41 +00:00
Jan Varga
6555388d94 Bug 1749504 - Rename EnsureStorageIsInitialized to EnsureStorageIsInitializedInternal; r=dom-storage-reviewers,jstutte
One of the goals of bug 1749504 is to call EnsureStorageIsInitialized only from
InitOp. Calling from other places including quota clients will be disallowed
by changing the method to a private method. The private nature of the method
should be emphasized by adding the Internal suffix.

Changes done in this patch:
- IsStorageInitialized renamed to IsStorageInitializedInternal
- AssertStorageIsInitialized renamed to AssertStorageIsInitializedInternal
- EnsureStorageIsInitialized renamed to EnsureStorageIsInitializedInternal

Differential Revision: https://phabricator.services.mozilla.com/D185547
2023-09-12 12:40:41 +00:00
Cosmin Sabou
f7fda95117 Backed out 2 changesets (bug 1791767) as requested by jjalkanen for further checks. CLOSED TREE
Backed out changeset 6980270f21e4 (bug 1791767)
Backed out changeset e1593dd3fcc0 (bug 1791767)
2023-08-17 09:51:01 +03:00
Jari Jalkanen
d96eaf86dc Bug 1791767 - Stop maintenance when threads are needed or connection is closed. r=dom-storage-reviewers,jstutte
Depends on D160472

Differential Revision: https://phabricator.services.mozilla.com/D165984
2023-08-17 06:29:03 +00:00
Jari Jalkanen
48df34a79c Bug 1791767 - Use task queues on stream transport service for IDB ConnectionPools. r=dom-storage-reviewers,asuth,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D160472
2023-08-17 06:29:02 +00:00
Luca Greco
37275fd27c Bug 1841806 - Explicitly disallow encrypted indexedDB storage to be used for extension page running in privateBrowsing mode. r=asuth,janv
Differential Revision: https://phabricator.services.mozilla.com/D183732
2023-07-21 12:10:19 +00:00
Jari Jalkanen
bb4213b61a Bug 1588068 - Use sqlite3_interrupt to abort database maintenance operation. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D129161
2023-06-08 18:14:16 +00:00
Stanca Serban
b06076b1b3 Backed out changeset da64a3f29eb3 (bug 1588068) for causing xpcshell failures in test_idle_maintenance.js. CLOSED TREE 2023-05-20 01:40:30 +03:00
Jari Jalkanen
6439aca6b3 Bug 1588068 - Use sqlite3_interrupt to abort database maintenance operation. r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D129161
2023-05-19 15:27:08 +00:00
Jan Varga
91b5ab3b8a Bug 1833810 - Speedup origin directory iteration when full origin metadata is not needed; r=hsingh
Differential Revision: https://phabricator.services.mozilla.com/D178419
2023-05-18 17:06:56 +00:00
Jens Stutte
223b310f41 Bug 1829933 - Interrupt vacuum loop if nothing has been freed. r=dom-storage-reviewers,janv
It seems we have currently no test at all for vacuuming maintenance. We should add some testing in general, see bug 1833141

Differential Revision: https://phabricator.services.mozilla.com/D178050
2023-05-16 15:50:13 +00:00
Jan Varga
549e349c26 Bug 1831255 - IDB: Anonymize database file name base on disk for private browsing; r=dom-storage-reviewers,jari,asuth
Differential Revision: https://phabricator.services.mozilla.com/D177133
2023-05-08 19:02:34 +00:00
Jan Varga
dc926465ba Bug 1781201 - Change GetInfoFromValidatedPrincipalInfo to be fallible; r=hsingh
The generation of unique anonynmous origins can fail, so the method needs to be
fallible as well, otherwise the failures couldn't be propagated.

Differential Revision: https://phabricator.services.mozilla.com/D176874
2023-05-03 08:22:56 +00:00
Jan Varga
8cfc1d53bc Bug 1781201 - Convert GetInfoFromValidatedPrincipalInfo to a non-static method; r=hsingh
The method will need to access members of the QuotaManager class, so it can't
be static anymore.

Differential Revision: https://phabricator.services.mozilla.com/D176872
2023-05-03 08:22:55 +00:00
Jan Varga
55ef85416c Bug 1781201 - Stop using GetInfoFromPrincipal in the parent; r=hsingh
Quota clients should use GetInfoFromValidatedPrinciplaInfo in the parent
because that method will eventually generate unique anonymous origins for
private browsing.
This patch also moves some calls from the main thread to the PBackground thread
because GetInfoFromValidatedPrinciplaInfo can run on any thread.

Differential Revision: https://phabricator.services.mozilla.com/D176871
2023-05-03 02:05:11 +00:00
Jan Varga
f6cdec5ef8 Bug 1781201 - Convert GetOriginDirectory/DeleteOriginDirectory arguments into a single argument; r=hsingh
OriginMetadata is a generic type containing relevant information which can be
used for generating unique anonymous origins instead of using original origins
(for example for private browsing).

The patch is partially based on D176751.

Differential Revision: https://phabricator.services.mozilla.com/D176868
2023-05-03 02:05:11 +00:00
Jan Varga
6c4defa86a Bug 1781201 - Rename GetDirectoryForOrigin/DeleteFilesForOrigin to GetOriginDirectory/DeleteOriginDirectory; r=hsingh
This is a preparation for converting the arguments to a singe argument using
more generic OriginMetadata type.

The patch is partially based on D176751.

Differential Revision: https://phabricator.services.mozilla.com/D176867
2023-05-03 02:05:10 +00:00
Jan Varga
1a61bc18b2 Bug 1827377 - Add support for clearing storages in private repository; r=hsingh
Differential Revision: https://phabricator.services.mozilla.com/D175122
2023-04-26 08:23:13 +00:00
Harveer Singh
b1103465d3 Bug 1827376: Introduced a new persistence type 'Private' for PBM.r=janv,dom-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D173422
2023-04-25 11:34:36 +00:00