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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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