Commit Graph

1368 Commits

Author SHA1 Message Date
Jan Varga
76fdcdc728 Bug 934640 - Add support for factory operations which are not tied up with a specific database; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D188979
2024-03-04 17:35:44 +00:00
Jan Varga
fae32db168 Bug 934640 - Create a new base for factory operations communicating using PBackgroundIDBFactoryRequest; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D188975
2024-03-04 17:35:44 +00:00
Jan Varga
f15235b613 Bug 1855142 - Simplify PrincipalInfo handling in FactoryOp::Open; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D189910
2024-02-29 15:28:51 +00:00
Jan Varga
278747f0c9 Bug 1855142 - Align PERSISTENCE_TYPE_PERSISTENT checks between parent and child; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D189907
2024-02-29 15:28:50 +00:00
Jan Varga
340b8ae654 Bug 1855142 - Merge FactoryOp::Open and FactoryOp::FinishOpen; r=dom-storage-reviewers,jari
Both methods now run on the PBackground thread, there's no need to have these as
separate methods anymore. The extra state can be now removed as well. This opens
the door for some further optimizations.

Differential Revision: https://phabricator.services.mozilla.com/D189757
2024-02-29 15:28:49 +00:00
Jan Varga
8f20b6a335 Bug 1855142 - Switch FactoryOp::Open from running on the main thrad to running on the PBackground thread; r=dom-storage-reviewers,jari
FactoryOp::Open now contains no code which can only run on the main thread, so
it can be safely switched to running on the PBackground thread.

Differential Revision: https://phabricator.services.mozilla.com/D189756
2024-02-29 15:28:48 +00:00
Jan Varga
b5a406a328 Bug 1855142 - Move IndexedDatabaseManager main thread initialization from FactoryOp::Open to InitializeQuotaManager; r=dom-storage-reviewers,jari
InitializeQuotaManager already initializes the storage service on the main
thread, so the initialization in FactoryOp::Open can be just removed.

Differential Revision: https://phabricator.services.mozilla.com/D189755
2024-02-29 15:28:48 +00:00
Jan Varga
492e6f8efc Bug 1855142 - Ensure IndexedDabaseManager::mLocale separately; r=dom-storage-reviewers,jari
mLocale is currently initialized in IndexedDatabaseManager::Init which is
called from IndexedDatabaseManager::GetOrCreate if the manager doesn't exist.
This can be a problem when IndexedDatabaseManager::GetOrCreate is called very
early,for example in nsLayoutStatics::Initialize in the parent process.

This is a preparation for moving IndexedDatabaseManager::GetOrCreate from
FactoryOp::Open to InitializeQuotaManager.

Differential Revision: https://phabricator.services.mozilla.com/D189891
2024-02-29 15:28:47 +00:00
Jan Varga
1e0a547b71 Bug 1855142 - Remove FactoryOp::CheckPermission method; r=dom-storage-reviewers,jari
FactoryOp::CheckPermission now contains only permission related code and it
always returns PermissionValue::kPermissionAllowed so it can be safely removed.

Differential Revision: https://phabricator.services.mozilla.com/D189754
2024-02-29 15:28:46 +00:00
Jan Varga
d5ccde0089 Bug 1879493 - Add a reference to idle connection runnable; r=dom-storage-reviewers,jari
The reference can be later used to stop already running maintenance (instead of
dispatching a dummy runnable to the connection thread).

Differential Revision: https://phabricator.services.mozilla.com/D201199
2024-02-28 19:49:22 +00:00
Jan Varga
a65637be3e Bug 1879493 - Make it possible to track other properties of connection idle maintenances; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D201198
2024-02-28 19:49:21 +00:00
Jan Varga
1581e4881c 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 20:59:25 +00:00
Jan Varga
e3b86f1e7c 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 20:59:25 +00:00
Jan Varga
5b61291d0b 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 20:59:24 +00:00
Jan Varga
1106ac176b 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 20:59:24 +00:00
Iulian Moraru
f546759166 Backed out 4 changesets (bug 1878841) for causing xpcshell failures on test_connection_idle_maintenance.js.
Backed out changeset 6dd4ac119065 (bug 1878841)
Backed out changeset 4001ea4b11b0 (bug 1878841)
Backed out changeset 40a429fa8f49 (bug 1878841)
Backed out changeset f22be1e1752b (bug 1878841)
2024-02-27 20:40:48 +02:00
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