Commit Graph

541 Commits

Author SHA1 Message Date
Ray Kraesig
286effabaf 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
f356d7984d 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
e1789bcded 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
d00a567f12 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
183a96075c 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
b7d4d47ca8 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
a25762c862 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
d6044f073a 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
9e9199880e 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
10b9ceb789 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
e0fa109cb0 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
2108ac7eda 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
bd593b4dfa 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
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
Jan Varga
0370aa541b 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
812a88e7f9 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
199a9020c7 Backed out changeset 9c4ce17422de (bug 1867360) for causing crashes on PRemoteQuotaObjectChild. CLOSED TREE 2024-01-08 23:18:19 +02:00
Nika Layzell
5d33ff1a48 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
841c471153 Backed out changeset 30210e0efac1 (bug 1867360) for causing failures at PIPDLUnitTestChild.cpp. CLOSED TREE 2023-12-19 02:28:52 +02:00
Nika Layzell
aedf0adb86 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
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
Joel Maher
9fc7cbc7bf 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
0c151e57a0 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
b0fe72dee5 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
7388749830 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
4a97019e39 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
0191af54d9 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
a221df285c 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
fff795de17 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
6d66cbc74c 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
ac16524bf4 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
65a87df96d 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
32693b823d 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
f923ba8a25 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
c47238b5ac 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
0031a503da 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
e664ec3758 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
53143196f3 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
Kagami Sascha Rosylight
563984d576 Bug 1842007 - Part 2: Replace DomPromiseListener use with Promise method in DoubleBufferQueueImpl r=dom-storage-reviewers,janv,asuth
AddCallbacksWithCycleCollectedArgs prevents potential cycle. (I'm assuming `this` and `newPage` cannot make cycle here)

Also making FileSystemDirectoryIterator::Impl as refcountable to safely capture `this`.

Differential Revision: https://phabricator.services.mozilla.com/D182940
2023-09-19 09:58:00 +00:00
Jan Varga
7d45f43ded Bug 1841702 - Add a new test; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D187429
2023-09-15 19:52:13 +00:00
Jan Varga
5d0ec74c71 Bug 1749504 - Convert OPFS to use the new way to access a client directory; r=dom-storage-reviewers,jstutte
OPFS 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.

Changes done in this patch:
- replaced QuotaManager::CreateDirectoryLock call with
  QuotaManager::OpenClientDirectory
- removed EnsureStorageIsInitializedInternal call from
  EnsureFileSystemDirectory

Differential Revision: https://phabricator.services.mozilla.com/D186114
2023-09-14 04:04:29 +00:00
Jan Varga
e01184c301 Bug 1749504 - Remove redundant storage initialization from TestFileSystemQuotaClient tests; r=dom-storage-reviewers,jstutte
TestFileSystemQuotaClient tests currently call InitializeStorage before calling
CreateRegisteredDataManager. However, CreateRegisteredDataManager calls
FileSystemDataManager::GetOrCreateFileSystemDataManager which ensures storage
is initialized, so the prior InitializeStorage call can be removed.

Changes done in this patch:
- removed all calls to InitializeStorage
- removed InitializeStorage method

Differential Revision: https://phabricator.services.mozilla.com/D186113
2023-09-14 04:04:28 +00:00
Jan Varga
28a813ff73 Bug 1749504 - Change OriginOperationBase to use a MozPromise chain; r=dom-storage-reviewers,jstutte
OriginOperationBase currently uses manual dispatching of runnables controlled
by a state machine which is not that easy to understand and requires many
helper methods. Additionally, OriginOperationBase can be destroyed off the
PBackground thread which makes it hard to hold PBackground only objects.

Changes done in this patch:
- changed OriginOperationBase to not inherit from Runnable
- changed OriginOperationBase to be created and destroyed on the PBackground thread only
- replaced the manual dispatching of runnables with a MozPromise chain
- removed OriginOperationBase::Dispatch
- changed pure virtual method OriginOperationBase::Open to return a MozPromise
- changed FinalizeOriginEvictionOp to be always created on the PBackground
  thread only (as a consequence of similar changes done to OriginOperationBase)

Differential Revision: https://phabricator.services.mozilla.com/D185641
2023-09-13 16:41:57 +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
c3effd7450 Backed out 13 changesets (bug 1690111) for causing fetch related crashes.
Backed out changeset 5f2c25d194ad (bug 1690111)
Backed out changeset 76c408bcd053 (bug 1690111)
Backed out changeset 6d0649fdafff (bug 1690111)
Backed out changeset c1330b5e8c43 (bug 1690111)
Backed out changeset 5fa36d8fd2a5 (bug 1690111)
Backed out changeset daf7d747853a (bug 1690111)
Backed out changeset f70e09a7f5c6 (bug 1690111)
Backed out changeset 40c6d6eed7f8 (bug 1690111)
Backed out changeset 692f2a759573 (bug 1690111)
Backed out changeset 7140866dd9f6 (bug 1690111)
Backed out changeset 2865fe682139 (bug 1690111)
Backed out changeset 9dcd2416f8a5 (bug 1690111)
Backed out changeset 9c411bf84079 (bug 1690111)
2023-09-11 17:55:24 +03:00
Peter Van der Beken
312137a408 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-11 12:52:20 +00:00
Peter Van der Beken
42b81cb95f 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-11 12:52:20 +00:00
Jan Varga
95753f146b Bug 1841702 - Add proper handling for failed build worker refs; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D187428
2023-09-11 11:52:44 +00:00
Jan Varga
40325aa273 Bug 1839243 - Add debugging assertions; r=dom-storage-reviewers,jstutte. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D181737
2023-09-06 10:23:51 +00:00