mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
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
This commit is contained in:
parent
c8d644cead
commit
8ca630b297
6
dom/cache/DBAction.cpp
vendored
6
dom/cache/DBAction.cpp
vendored
@ -160,10 +160,8 @@ Result<nsCOMPtr<mozIStorageConnection>, nsresult> OpenDBConnection(
|
||||
NewFileURIMutator, &aDBFile));
|
||||
|
||||
const nsCString directoryLockIdClause =
|
||||
aDirectoryMetadata.mDirectoryLockId >= 0
|
||||
? "&directoryLockId="_ns +
|
||||
IntToCString(aDirectoryMetadata.mDirectoryLockId)
|
||||
: EmptyCString();
|
||||
"&directoryLockId="_ns +
|
||||
IntToCString(aDirectoryMetadata.mDirectoryLockId);
|
||||
|
||||
const auto keyClause = [&aMaybeCipherKey] {
|
||||
nsAutoCString keyClause;
|
||||
|
@ -243,10 +243,8 @@ Result<nsCOMPtr<nsIFileURL>, QMResult> GetDatabaseFileURL(
|
||||
// initialized yet. At that time, the in-memory objects (e.g. OriginInfo) are
|
||||
// only being created so it doesn't make sense to tunnel quota information to
|
||||
// QuotaVFS to get corresponding QuotaObject instances for SQLite files.
|
||||
const auto directoryLockIdClause =
|
||||
aDirectoryLockId >= 0
|
||||
? "&directoryLockId="_ns + IntToCString(aDirectoryLockId)
|
||||
: EmptyCString();
|
||||
const nsCString directoryLockIdClause =
|
||||
"&directoryLockId="_ns + IntToCString(aDirectoryLockId);
|
||||
|
||||
nsCOMPtr<nsIFileURL> result;
|
||||
QM_TRY(QM_TO_RESULT(NS_MutateURI(mutator)
|
||||
|
@ -586,10 +586,8 @@ Result<nsCOMPtr<nsIFileURL>, nsresult> GetDatabaseFileURL(
|
||||
// - from DeleteDatabaseOp::LoadPreviousVersion, since this might require
|
||||
// temporarily exceeding the quota limit before the database can be
|
||||
// deleted.
|
||||
const auto directoryLockIdClause =
|
||||
aDirectoryLockId >= 0
|
||||
? "&directoryLockId="_ns + IntToCString(aDirectoryLockId)
|
||||
: EmptyCString();
|
||||
const nsCString directoryLockIdClause =
|
||||
"&directoryLockId="_ns + IntToCString(aDirectoryLockId);
|
||||
|
||||
const auto keyClause = [&aMaybeKey] {
|
||||
nsAutoCString keyClause;
|
||||
|
Loading…
x
Reference in New Issue
Block a user