Commit Graph

1352 Commits

Author SHA1 Message Date
Jari Jalkanen
3f212919f2 Bug 1404276 - Support IDB key extraction with autoincremented primary key. r=dom-storage-reviewers,janv
This patch is originally authored by Bevis Tseng.

Differential Revision: https://phabricator.services.mozilla.com/D204361
2024-04-08 15:25:27 +00:00
Jari Jalkanen
bdeadb32ac Bug 1791767 - Use task queues on nsThreadPool for IDB connections. r=dom-storage-reviewers,janv
With this patch, IDB connection pool begins to run transactions and idle maintenance on task queue event targets on top of a thread pool. The underlying thread pool will take over all thread management.

Differential Revision: https://phabricator.services.mozilla.com/D191296
2024-04-03 14:41:53 +00:00
Cristian Tuns
b7957e544a Backed out 2 changesets (bug 1791767) for causing build bustages in ActorsParent.cpp CLOSED TREE
Backed out changeset 01eef2ce9d20 (bug 1791767)
Backed out changeset df9f354630cf (bug 1791767)
2024-04-02 11:42:55 -04:00
Jari Jalkanen
c3512cb860 Bug 1791767 - Use task queues on nsThreadPool for IDB connections. r=dom-storage-reviewers,janv
With this patch, IDB connection pool begins to run transactions and idle maintenance on task queue event targets on top of a thread pool. The underlying thread pool will take over all thread management.

Differential Revision: https://phabricator.services.mozilla.com/D191296
2024-04-02 12:42:29 +00:00
Jan Varga
a3b830f02b Bug 1888006 - Allow one single factory operation to block multiple factory operations; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D206193
2024-04-01 18:16:51 +00:00
Jan Varga
39166cad12 Bug 1888006 - Allow Maintenance::WaitForCompletion to be called multiple times; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D205829
2024-03-28 05:31:37 +00:00
Jari Jalkanen
9b668cc088 Bug 1878143 - Add durability hint to IDB transaction properties. r=dom-storage-reviewers,webidl,saschanaz,janv,smaug
Differential Revision: https://phabricator.services.mozilla.com/D202732
2024-03-27 17:34:01 +00:00
Jan Varga
d755186948 Bug 934640 - Save current database versions for already touched databases before GetDatabaseOp gets unblocked by an existing factory operation; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D190199
2024-03-25 10:54:34 +00:00
Jan Varga
6a00e6f225 Bug 934640 - Implement IDBFactory.databases() to enumerate IndexedDB databases; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D190053
2024-03-25 10:54:33 +00:00
Jan Varga
01d34a4d7c Bug 934640 - Add database version to database file managers; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190052
2024-03-25 10:54:32 +00:00
Jan Varga
628bc93770 Bug 934640 - Add a way to get database file managers by database file path; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190049
2024-03-25 10:54:31 +00:00
Jan Varga
d5b5c3d711 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-25 10:54:30 +00:00
Jan Varga
98f7fe1faf 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-25 10:54:30 +00:00
Jan Varga
290c4ef7ac Bug 1799374 - Start using request ids for deciding if an explicitly committed transaction needs to be aborted; r=dom-storage-reviewers,asuth
Explicitly committed transactions are aborted in case of a failed request. This
is achieved by tracking order of requests. The order of requests is currently
tracked by storing request serial numbers. However, request serial numbers are
not always in sync between parent and child, so they are only suitable for
logging purposes. This patch switches from request serial numbers to request
ids which are only generated by the child side and thus always in sync between
parent and child.

Differential Revision: https://phabricator.services.mozilla.com/D204200
2024-03-24 00:52:04 +00:00
Jan Varga
fd37799016 Bug 1799374 - Add support for tracking request ids to cursor continue operation; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D204195
2024-03-23 08:42:40 +00:00
Jan Varga
8047aa1ecd Bug 1799374 - Add support for tracking request ids to cursor opening operation; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D204193
2024-03-23 08:42:40 +00:00
Jan Varga
be2e9f5ac4 Bug 1799374 - Add support for tracking request ids to normal transaction operations; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D204192
2024-03-23 08:42:40 +00:00
Jan Varga
0eaa021e33 Bug 1799374 - Add initial support for tracking request ids; r=dom-storage-reviewers,asuth
This patch adds only new member variables, actual support for sending ids will
be added in individual patches (all ids are set to zero for now). The idea is
to have only one source of truth, so an id used in the parent and child is
always the same.

Differential Revision: https://phabricator.services.mozilla.com/D204025
2024-03-23 08:42:39 +00:00
Jens Stutte
3d898a3c72 Bug 1863129 - Discard pending file deletions on shutdown but block shutdown for running deletions. r=dom-storage-reviewers,janv
In case we did start a DeleteFilesRunnable before shutdown we should ensure it is going to be executed before we leave our QM shutdown barrier, but we can ignore pending but not yet started deletions completely as PBM origins are deleted entirely by other means.

Differential Revision: https://phabricator.services.mozilla.com/D203502
2024-03-18 13:57:53 +00:00
Jari Jalkanen
d80af0af87 Bug 1791767 - Interrupt IDB idle maintenance with atomic flag. r=janv,dom-storage-reviewers,jstutte
Previously, idle maintenance was interrupted whenever a new runnable was
posted to the executing thread. Here we replace this interrupt signal with
an explicit boolean flag in order to support task queue event targets.

Differential Revision: https://phabricator.services.mozilla.com/D165984
2024-03-05 17:44:00 +00:00
Cristian Tuns
7295aff223 Backed out 12 changesets (bug 934640) for causing wpt failures in idb-explicit-commit.any.html CLOSED TREE
Backed out changeset f842e5594224 (bug 934640)
Backed out changeset 3cf1e31d16ba (bug 934640)
Backed out changeset ba85838ef7cd (bug 934640)
Backed out changeset a2769ba4c0ab (bug 934640)
Backed out changeset 3a2af6a310ab (bug 934640)
Backed out changeset 8bbe6f8fb695 (bug 934640)
Backed out changeset 184282e69b59 (bug 934640)
Backed out changeset f3b863806999 (bug 934640)
Backed out changeset ed5bb2e976ef (bug 934640)
Backed out changeset f315683fd3ba (bug 934640)
Backed out changeset 30dbc38c3e9a (bug 934640)
Backed out changeset ef90771d141d (bug 934640)
2024-03-05 13:17:12 -05:00
Jan Varga
402994616e Bug 934640 - Save current database versions for already touched databases before GetDatabaseOp gets unblocked by an existing factory operation; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D190199
2024-03-05 13:47:55 +00:00
Jan Varga
8e8e4a1e8d Bug 934640 - Implement IDBFactory.databases() to enumerate IndexedDB databases; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D190053
2024-03-05 13:47:54 +00:00
Jan Varga
9c5f94f72c Bug 934640 - Add database version to database file managers; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190052
2024-03-05 13:47:53 +00:00
Jan Varga
fb4cb9b664 Bug 934640 - Add a way to get database file managers by database file path; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190049
2024-03-05 13:47:52 +00:00
Jan Varga
5c866369ed 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-05 13:47:51 +00:00
Jan Varga
b2c9a27041 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-05 13:47:51 +00:00
Norisz Fay
8886f97d29 Backed out changeset 520bd9381f15 (bug 1791767) for causing bustages on ActorsParent.cpp CLOSED TREE 2024-03-05 14:56:43 +02:00
Jari Jalkanen
91a46f13b0 Bug 1791767 - Interrupt IDB idle maintenance with atomic flag. r=janv,dom-storage-reviewers,jstutte
Previously, idle maintenance was interrupted whenever a new runnable was
posted to the executing thread. Here we replace this interrupt signal with
an explicit boolean flag in order to support task queue event targets.

Differential Revision: https://phabricator.services.mozilla.com/D165984
2024-03-05 12:26:48 +00:00
pstanciu
230e61e928 Backed out 12 changesets (bug 934640) for causing xpcshell failures on test_Store.js. CLOSED TREE
Backed out changeset b9130d0d185f (bug 934640)
Backed out changeset f607e117912b (bug 934640)
Backed out changeset 74b616bdd9ca (bug 934640)
Backed out changeset b4ee14550d3c (bug 934640)
Backed out changeset 133d11049a61 (bug 934640)
Backed out changeset 392886344471 (bug 934640)
Backed out changeset 189686b6ccfa (bug 934640)
Backed out changeset 067b6058bf70 (bug 934640)
Backed out changeset 9b5fbc925fe5 (bug 934640)
Backed out changeset 2e53225b5d81 (bug 934640)
Backed out changeset ffdb716cfa3f (bug 934640)
Backed out changeset fb741c8c2cb6 (bug 934640)
2024-03-05 00:13:09 +02:00
Jan Varga
28a0df337d Bug 934640 - Save current database versions for already touched databases before GetDatabaseOp gets unblocked by an existing factory operation; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D190199
2024-03-04 17:35:48 +00:00
Jan Varga
40f49ab42c Bug 934640 - Implement IDBFactory.databases() to enumerate IndexedDB databases; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D190053
2024-03-04 17:35:47 +00:00
Jan Varga
f2be125d08 Bug 934640 - Add database version to database file managers; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190052
2024-03-04 17:35:46 +00:00
Jan Varga
a8ab219e8f Bug 934640 - Add a way to get database file managers by database file path; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190049
2024-03-04 17:35:45 +00:00
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