Commit Graph

553 Commits

Author SHA1 Message Date
Jan Varga
1627627fc9 Bug 1912414 - Execute test operations on the right thread; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D194485
2024-08-10 22:29:07 +00:00
Jan Varga
ba2be433e4 Bug 1912414 - Replace FileSystemQuotaClient::InitOrigin calls with FileSystemDatabaseManager::GetUsage calls; r=dom-storage-reviewers,jari
FileSystemQuotaClient::InitOrigin shouldn't be called when temporary storage is
already initialized. It shouldn't be called when there's already active storage
connection for the OPFS database either.

Differential Revision: https://phabricator.services.mozilla.com/D194467
2024-08-10 22:29:06 +00:00
Jan Varga
ac3eed88db Bug 1912414 - Init quota manager fixture only once during TestFileSystemUsageTracking test suite; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D194466
2024-08-10 22:29:06 +00:00
Jan Varga
1bffefad98 Bug 1912414 - Introduce TestFileSystemUsageTracking.cpp; r=dom-storage-reviewers,jari
The new test suite is intended for integration tests which verify usage
tracking without any restart in between. The suite is based on the existing
TestFileSystemQuotaClient suite except the test which in theory request a
restart in between: TrackedFilesOnInitOriginShouldCauseRescan.

TestFileSystemQuotaClient.cpp will get removed after some additional
refactoring.

Differential Revision: https://phabricator.services.mozilla.com/D194465
2024-08-10 06:56:49 +00:00
Jan Varga
2b727707d5 Bug 1912414 - Move parent test helpers to separate files; r=dom-storage-reviewers,jari
Some helper methods have been also generalized to work with any origin.

Differential Revision: https://phabricator.services.mozilla.com/D194463
2024-08-10 06:56:49 +00:00
Jan Varga
8b7311fa3f Bug 1912414 - Clean up include declarations in TestFileSystemQuotaClient.cpp; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D194462
2024-08-10 06:56:49 +00:00
Jan Varga
90601c9329 Bug 1912414 - Add TEST_TRY macro; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D194365
2024-08-10 06:56:48 +00:00
Jan Varga
686650a4e1 Bug 1912414 - Add FileSystemDatabaseManager::GetUsage non-static method; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D194362
2024-08-10 06:56:48 +00:00
Jan Varga
49b0ea6200 Bug 1904143 - Change the checking policy for FileSystemDataManager; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D217676
2024-07-30 18:03:17 +00:00
Jan Varga
0dd630db14 Bug 1906041 - Rename Ensure(Persistent|Temporary)OriginIsInitialized to Ensure(Persistent|Temporary)OriginIsInitializedInternal; r=dom-storage-reviewers,jari
One of the goals of the asynchronous temporary storage initialization is to
call Ensure(Persistent|Temporary)OriginIsInitialized only from
Initialize(Persistent|Temporary)OriginOp. 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/D192150
2024-07-16 10:43:40 +00:00
Jan Varga
1c487986b7 Bug 1906041 - Simplify signature of QuotaManager::EnsureTemporaryOriginIsInitialized; r=dom-storage-reviewers,jari
EnsureTemporaryOriginIsInitialized currently takes two separate arguments which
can be expressed as just one argument.

Differential Revision: https://phabricator.services.mozilla.com/D192149
2024-07-16 10:43:39 +00:00
Jan Varga
602d21513c Bug 1883353 - Require to always drop directory locks explicitly; r=dom-storage-reviewers,jari
Until now, directory locks were dropped when the last strong reference was
removed or after calling Drop explicitly. The dependency on ref-counting makes
it less obvious when directory locks are dropped for real and it's also
difficult to release them asynchronously eventually. This patch removes the
directory lock unregistration from the destructor, so from now on, directory
locks must be always dropped explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D197294
2024-06-14 07:21:24 +00:00
Ray Kraesig
e2ee2f11df Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio
All present uses of the call-site arguments to MozPromise's methods
supply static strings. However, this is nowhere enforced. Do so.

Additionally, since this is the third or fourth time the present author
alone has personally implemented such an enforcement mechanism, create a
helper class to simplify doing so.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D207462
2024-04-24 17:02:49 +00:00
Kagami Sascha Rosylight
d56e700caf Bug 1863765 - Part 2: Close the stream when the type error happens r=jari,janv
Differential Revision: https://phabricator.services.mozilla.com/D195777
2024-04-04 17:50:10 +00:00
Kagami Sascha Rosylight
e57e4b6fa0 Bug 1863765 - Part 1: Wrap WriteCallback in UnderlyingSinkAlgorithmsWrapper r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D193092
2024-04-04 17:50:10 +00:00
Jan Varga
8406985121 Bug 1874334 - Abort open writable file streams during xpcom-will-shutdown shutdown phase; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D205687
2024-03-27 12:47:16 +00:00
Jari Jalkanen
2e530eeede Bug 1874334 - Update cached quota usage when OPFS temporary file is copied. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D204780
2024-03-27 12:47:15 +00:00
Jan Varga
1a79df5a9b Bug 1874334 - Add worker related fuzzing finding to OPFS crashtest suite; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D205574
2024-03-27 12:47:15 +00:00
Jari Jalkanen
fe3b09f3b6 Bug 1874334 - Add fuzzing finding to OPFS crashtest suite. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D204779
2024-03-27 12:47:14 +00:00
Razvan Cojocaru
1b9ff1e6cc Bug 1877649 - Remove unused storage access flag eSessionScoped. r=pbz,dom-storage-reviewers,janv,webidl,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D201656
2024-03-21 10:18:49 +00:00
Peter Van der Beken
62bdf442eb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-02 07:50:25 +00:00
Natalia Csoregi
8c2521e9d5 Backed out 13 changesets (bug 1640839) for causing bustage on Element.cpp CLOSED TREE
Backed out changeset 179ceb82c9e5 (bug 1640839)
Backed out changeset 73f498a821f0 (bug 1640839)
Backed out changeset dc2d3d0e0365 (bug 1640839)
Backed out changeset ddc989ac0509 (bug 1640839)
Backed out changeset e595bb3feea8 (bug 1640839)
Backed out changeset c85aca04e27f (bug 1640839)
Backed out changeset 98e8e3a4047a (bug 1640839)
Backed out changeset 59ef180517db (bug 1640839)
Backed out changeset af2f5e293662 (bug 1640839)
Backed out changeset 89aa6d9dc598 (bug 1640839)
Backed out changeset 67b722a722f9 (bug 1640839)
Backed out changeset 24a9665c6ced (bug 1640839)
Backed out changeset d93f199385e9 (bug 1640839)
2024-03-01 18:23:08 +02:00
Peter Van der Beken
763356e4fb Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
2024-03-01 14:31:15 +00:00
Jari Jalkanen
5c00746ef4 Bug 1840184 - Remove redundant FileSystemWritableFileStreamChild shutdown check. r=dom-storage-reviewers,janv
Both use cases of the getter of the WritableFileStream pointer are already handling the case where the result is null. In the debug-only check of whether all streams are closed, null result is possible, as evidenced by the bug. When the streams are closed at shutdown, we assume that closing takes place only once and the result is not null but since the second closing can be handled as a no-op, it is not necessary enforce this expectation, following declarative API design.

Differential Revision: https://phabricator.services.mozilla.com/D202589
2024-02-28 08:48:57 +00:00
Nika Layzell
ad9bb1e2c4 Bug 1867360 - Require toplevel protocols to specify which processes they expect to be bound in, r=decoder,ipc-reviewers,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,aosmond,rkraesig,mccr8,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D195485
2024-01-18 23:07:18 +00:00
Jan Varga
8ca630b297 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
Jan Varga
014758387a Bug 1871799 - Remove redundant GetStorageConnection overload; r=dom-storage-reviewers,asuth
There are two similar GetStorageConnection overloads. The only difference is
that they use different mozIStorageService methods for database opening.
The overloads can be easilly merged into just one method, so database opening
will be done using mozIStorageService::GetDatabaseFileURL even when called
from FileSystemQuotaClient::InitOrigin.

Depends on D194519

Differential Revision: https://phabricator.services.mozilla.com/D198186
2024-01-10 21:10:14 +00:00
Jan Varga
ef64423664 Bug 1871799 - Expose GetStorageConnection via FileSystemDataManager.h; r=dom-storage-reviewers,asuth
Some tests will need to create a connection to check usage when storage is not
initialized.

Differential Revision: https://phabricator.services.mozilla.com/D194519
2024-01-10 21:10:13 +00:00
Natalia Csoregi
b2289eef93 Backed out changeset 9c4ce17422de (bug 1867360) for causing crashes on PRemoteQuotaObjectChild. CLOSED TREE 2024-01-08 23:18:19 +02:00
Nika Layzell
c4aa6e4813 Bug 1867360 - Require toplevel protocols to specify which processes they expect to be bound in, r=decoder,ipc-reviewers,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,aosmond,rkraesig,mccr8,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D195485
2024-01-08 19:48:23 +00:00
Butkovits Atila
a28566bdd4 Backed out changeset 30210e0efac1 (bug 1867360) for causing failures at PIPDLUnitTestChild.cpp. CLOSED TREE 2023-12-19 02:28:52 +02:00
Nika Layzell
3bf610ffc2 Bug 1867360 - Require toplevel protocols to specify which processes they expect to be bound in, r=decoder,ipc-reviewers,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,aosmond,rkraesig,mccr8,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D195485
2023-12-18 23:24:26 +00:00
Jan Varga
938370b55e 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
Joel Maher
28be3ac6b4 Bug 1859890 - batch 14 convert xpcshell.ini -> .toml. r=aryx,dom-storage-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D194162
2023-11-28 01:02:01 +00:00
Jan Varga
6911827cdd Bug 1858820 - Handle other FileSystemWritableFileStream states in FileSystemWritableFileStream::Write; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190912
2023-10-19 11:25:30 +00:00
Sylvestre Ledru
d0f6c7fc66 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
6a90f5eded Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
cc8a0ee742 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Jan Varga
7a7f6bd63c Bug 1808294 - Create a dedicated factory for FileSystemQuotaClient; r=dom-storage-reviewers,jari
The new class supports setting a custom factory, so tests can use it for
overriding the quota client implementation.

Differential Revision: https://phabricator.services.mozilla.com/D165851
2023-10-14 05:12:05 +00:00
Jan Varga
a50349fed6 Bug 1857155 - Remove custom ResolveCallback for FileSystemGetWritableFileStreamResponse; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190181
2023-10-09 21:42:27 +00:00
Jan Varga
7187317ce3 Bug 1857155 - Remove redundant build worker ref; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D190175
2023-10-09 21:42:27 +00:00
Jan Varga
b9b4cf05c2 Bug 1857155 - Change FileSystemWritableFileStream::Create to return constructed streams synchronously; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190173
2023-10-09 21:42:26 +00:00
Jan Varga
b604e1d9c4 Bug 1857155 - Deserialize stream for FileSystemWritableFileStream lazily; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190172
2023-10-09 21:42:26 +00:00
Jan Varga
07c537ddc2 Bug 1857155 - Make sure FileSystemWritableFileStream can't go away during Seek, Truncate and Close/Abort; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D190168
2023-10-09 21:42:25 +00:00
Jan Varga
3146505a67 Bug 1857155 - Move WriteImpl to FileSystemWritableFileStream; r=dom-storage-reviewers,aiunusov,jari
Differential Revision: https://phabricator.services.mozilla.com/D190163
2023-10-09 21:42:25 +00:00
Jari Jalkanen
6955346ac7 Bug 1844619 - Update assert to account for OPFS temporary files. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D188461
2023-10-04 08:22:04 +00:00
Tom Marble
1ca03b1818 Bug 1855295 convert .ini manifests to .toml: batch 8 dom/[a-l]**/mochitest.ini r=jmaher,jgilbert,extension-reviewers,credential-management-reviewers,robwu,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D189381
2023-10-02 17:18:28 +00:00
Jan Varga
ed1fb04885 Bug 1841702 - Add proper handling for failed worker refs; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D188431
2023-09-21 17:37:14 +00:00
Peter Van der Beken
627ac90e0c Bug 1690111 - Use new TypedArray APIs for processing data. r=farre,media-playback-reviewers,padenot,chunmin,sfink
Depends on D152497

Differential Revision: https://phabricator.services.mozilla.com/D152498
2023-09-20 09:42:02 +00:00
Peter Van der Beken
c49b5c3f78 Bug 1690111 - Use new TypedArray APIs for creating a container with a copy of the data. r=necko-reviewers,farre,kershaw
Depends on D152496

Differential Revision: https://phabricator.services.mozilla.com/D152497
2023-09-20 09:42:02 +00:00