Граф коммитов

187 Коммитов

Автор SHA1 Сообщение Дата
Jari Jalkanen 2efa3cfe46 Bug 1816710 - Block shutdown until OPFS writable file streams are closed. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D170937
2023-03-23 17:25:03 +00:00
Jan Varga 013b593892 Bug 1809025 - FileSystemSyncAccessHandle::BeginClose doesn't have to ensure the stream; r=dom-storage-reviewers,jari
Depends on D166175

Differential Revision: https://phabricator.services.mozilla.com/D166272
2023-03-06 08:07:53 +00:00
Jan Varga 116d0b7781 Bug 1816388 - Use NS_AsyncCopy directly in FileSystemWritableFileStream::Write. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D169609
2023-02-13 16:11:36 +00:00
Jan Varga 2afaa47180 Bug 1816093 - Verify WritableFileStream quota management; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D169445
2023-02-10 13:24:05 +00:00
Jari Jalkanen e28074cad0 Bug 1815837 - Deserialize RandomAccessStream on WritableFileStream TaskQueue. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D169226
2023-02-09 08:47:16 +00:00
Jari Jalkanen c49ef032c8 Bug 1798513 - Perform stateful WritableFileStream shutdown. r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D168796
2023-02-09 06:20:28 +00:00
Jari Jalkanen 9e66ddf276 Bug 1798513 - Start using XPCOM streams in WritableFileStream implementation. r=dom-storage-reviewers,janv,ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D161892
2023-02-09 06:20:28 +00:00
Jan Varga a546371a9d Bug 1809064 - Wait for close to be finished in the parent before resolving the promise for FileSystemSyncAccessHandle::BeginClose; r=dom-storage-reviewers,jari
The close in the parent is going to be asynchronous as well, so it won't be
guaranteed anymore that the unlocking happens synchronously immediatelly after
receiving the close message.

Depends on D166343

Differential Revision: https://phabricator.services.mozilla.com/D166344
2023-02-07 08:27:06 +00:00
Jan Varga d794f95ee7 Bug 1809064 - Add PFileSystemAccessHandleControl top level protocol; r=dom-storage-reviewers,jari
Sync access handle methods need to run sync loops to block the thread until a
result is available. The main protocol PFileSystemManager and its subprotocol
PFileSystemAccessHandle is bound to the main worker event queue, so incoming
IPC messages from the parent can't be processed until a sync loop is finished.
This becomes a problem when we want to wait for a response from the parent
during the asynchronous closing. Fortunatelly, we can add a new top level
protocol which will be bound to WorkerPrivate::ControlEventTargret, so incoming
IPC messages will be processed even when a sync loop is active.

Differential Revision: https://phabricator.services.mozilla.com/D166343
2023-02-07 08:27:06 +00:00
Jan Varga 3745210065 Bug 1809064 - Use managed endpoints for PFileSystemAccessHandle construction; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D166342
2023-02-06 15:10:34 +00:00
Kagami Sascha Rosylight 98c86fef45 Bug 1811538 - Part 3: Remove ErrorResult that became redundant r=smaug
Some spec comments now matches the implementations (as `Perform ! Foo()` means Foo can't fail).

This only covers a small part of actual redundant ErrorResult parameters because:

1. This patch stack only covers Promise::CreateFallible and does not cover helper functions e.g. Promise::CreateResolvedWithUndefined.
2. All callback calls still require ErrorResult as the IDL layer uses the existing Promise::Create

Differential Revision: https://phabricator.services.mozilla.com/D167701
2023-01-31 19:21:35 +00:00
Kagami Sascha Rosylight d377991e6f Bug 1812315 - Part 1: Implement WritableStream::SetUpNative for File System r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D167824
2023-01-31 17:31:08 +00:00
Iulian Moraru a8e5bce81b Backed out 3 changesets (bug 1811538) for causing build bustages on Promise.cpp. CLOSED TREE
Backed out changeset 0a665be7896a (bug 1811538)
Backed out changeset b949053bae31 (bug 1811538)
Backed out changeset 57d4dbe88611 (bug 1811538)
2023-01-31 19:00:59 +02:00
Kagami Sascha Rosylight 19a91ef6e4 Bug 1811538 - Part 3: Remove ErrorResult that became redundant r=smaug
Some spec comments now matches the implementations (as `Perform ! Foo()` means Foo can't fail).

This only covers a small part of actual redundant ErrorResult parameters because:

1. This patch stack only covers Promise::CreateFallible and does not cover helper functions e.g. Promise::CreateResolvedWithUndefined.
2. All callback calls still require ErrorResult as the IDL layer uses the existing Promise::Create

Differential Revision: https://phabricator.services.mozilla.com/D167701
2023-01-31 15:49:08 +00:00
Christian Holler 5b870963c1 Bug 1810221 - Add missing libFuzzer instrumenation to dom/fs/api/. r=janv
Differential Revision: https://phabricator.services.mozilla.com/D166818
2023-01-18 08:50:50 +00:00
Jan Varga 0512c7496a Bug 1806490 - Make it possible to track all CreateFileSystemManagerChild requests in FileSystemManager; r=dom-storage-reviewers,jari
It can happen that BeginRequest is called multiple times when the actor doesn't
exist yet. Such situations can't be handled by a single MozPromiseRequestHolder.

Differential Revision: https://phabricator.services.mozilla.com/D165153
2023-01-16 14:46:20 +00:00
Jari Jalkanen 64a6072483 Bug 1798513 - Replace USVString with UTF8String in union types with Blob getter. r=nika
Depends on D165730

Differential Revision: https://phabricator.services.mozilla.com/D165731
2023-01-11 08:33:47 +00:00
Noemi Erli 5b55c170dc Backed out 2 changesets (bug 1798513, bug 1808009) for causing failures in FileSystemDirectoryHandle-removeEntry.https.any.worker.html CLOSED TREE
Backed out changeset 428ea11e738d (bug 1798513)
Backed out changeset 3e69320f3e5c (bug 1808009)
2023-01-10 22:11:45 +02:00
Jari Jalkanen e4595e9483 Bug 1798513 - Replace USVString with UTF8String in union types with Blob getter. r=nika
Depends on D165730

Differential Revision: https://phabricator.services.mozilla.com/D165731
2023-01-10 19:08:22 +00:00
Jan Varga ce04dd7fc3 Bug 1808687 - FileSystemSyncAccessHandle::BeginClose should use WorkerPrivate::ControlEventTarget instead of GetCurrentSerialEventTarget; r=dom-storage-reviewers,jari
Differential Revision: https://phabricator.services.mozilla.com/D166047
2023-01-05 18:44:12 +00:00
Jan Varga 9c67dedd7e Bug 1803062 - Deserialize streams only on the task queue; r=dom-storage-reviewers,jesup
Quota file stream wrappers will bind an actor to the thread where
the stream deserialization is done (the actor is needed for proxying quota
checks to the parent process), so we can't deserialize the stream on the worker
thread anymore because the stream is used off the worker thread (on the IO task
queue).

Differential Revision: https://phabricator.services.mozilla.com/D163944
2022-12-16 06:38:11 +00:00
Jan Varga cfcee7d45e Bug 1803062 - Use mStream in ReadOrWrite only on the task queue; r=dom-storage-reviewers,jari
This is a preparation for lazy deserialization of the stream on the IO task
queue. After that, we won't be able to touch mStream directly on the worker
thread.

Differential Revision: https://phabricator.services.mozilla.com/D163943
2022-12-16 06:38:11 +00:00
Jan Varga 8784d5e561 Bug 1803062 - Change the complete callback of AsyncCopy to MoveOnlyFunction; r=dom-storage-reviewers,jesup
This is needed to prevent build errors when AsyncCopy is called inside of a
lambda function.

Differential Revision: https://phabricator.services.mozilla.com/D163942
2022-12-16 06:38:10 +00:00
Jan Varga 399614ae7b Bug 1803062 - Truncate, GetSize and Flush on the task queue; r=dom-storage-reviewers,jari
Instead of doing IO directly on the worker thread, these methods now instead
dispatch a task on the IO task queue and block the worker by spinning a nested
event loop (worker control runnables can be processed).

Differential Revision: https://phabricator.services.mozilla.com/D163941
2022-12-16 06:38:10 +00:00
Jan Varga 41e58b31bb Bug 1803062 - Read, write and close streams on the task queue; r=dom-storage-reviewers,jesup
This patch adds the last required piece for having fully async close of
FileSystemSyncAccessHandles.

Differential Revision: https://phabricator.services.mozilla.com/D163939
2022-12-16 06:38:09 +00:00
Jan Varga 4472bb0420 Bug 1803062 - Create a task queue on top of the STS for each FileSystemSyncAccessHandle; r=dom-storage-reviewers,jesup
The new task queue is not yet used.

Differential Revision: https://phabricator.services.mozilla.com/D163937
2022-12-16 06:38:08 +00:00
Jan Varga 8bb2e3b9d4 Bug 1803062 - Change FileSystemSyncAccessHandle::Close to be async; r=dom-storage-reviewers,jesup
This patch adds all remaining infrastructure for handling async close calls
without actually closing the stream on the IO task queue.

Differential Revision: https://phabricator.services.mozilla.com/D163842
2022-12-16 06:38:08 +00:00
Jan Varga 1e360a7a84 Bug 1803062 - Prepare a way for using other FileSystemSyncAccessHandle states besides the open/closed state; r=dom-storage-reviewers,jesup
Async Close will have to close the stream on the IO task queue which introduces
a new state of the object which can't be controlled by a bool member.

Differential Revision: https://phabricator.services.mozilla.com/D163565
2022-12-16 06:38:07 +00:00
Jan Varga d5251f60a7 Bug 1803062 - Don't call FileSystemSyncAccessHandle::Close when the object is already closed; r=dom-storage-reviewers,jesup
The Close method will return a MozPromise. Calling such method if the object is
already closed would uselessly allocate a MozPromise and dispatch a runnable
for the MozPromise resolving. So it's better to call Close only if the object
is not yet closed.

Differential Revision: https://phabricator.services.mozilla.com/D163564
2022-12-16 06:38:07 +00:00
Jan Varga 3042af06bf Bug 1803062 - Expose the sync close operation using a dedicated method; r=smaug
This is a preparation for changing the internal Close method to be async.

Differential Revision: https://phabricator.services.mozilla.com/D164192
2022-12-16 06:38:06 +00:00
Jan Varga fe224998ea Bug 1803062 - Prevent worker shutdown until FileSystemSyncAccessHandles are closed; r=dom-storage-reviewers,jesup
This is a preparation for an async closing of FileSystemSyncAccessHandles which
requires finising of the operation on a live worker thread (after closing the
stream on the IO task queue, we need to send an IPC message to the parent
process).

Differential Revision: https://phabricator.services.mozilla.com/D163563
2022-12-16 06:38:06 +00:00
Jan Varga 11bba396db Bug 1803062 - Add a fallible way to create FileSystemSyncAccessHandle objects; r=dom-storage-reviewers,jari
This is a preparation for creating a task queue and a strong worker ref during
FileSystemSyncAccessHandle construction.

Differential Revision: https://phabricator.services.mozilla.com/D163562
2022-12-16 06:38:05 +00:00
Jan Varga 39e6e07c86 Bug 1805135 - Fix FileSystemWritableFileStream to use the default writer for all IO operations; r=dom-storage-reviewers,webidl,smaug,jari
Differential Revision: https://phabricator.services.mozilla.com/D164444
2022-12-14 13:20:45 +00:00
Jan Varga 7217c03413 Bug 1751681 - Cleanup FileSystemHandle serialization/deserialization; r=dom-storage-reviewers,jesup
This patch also cleanups the StorageManager public interface a bit.

Differential Revision: https://phabricator.services.mozilla.com/D164453
2022-12-13 19:23:35 +00:00
Randell Jesup ba863219b6 Bug 1751681: Connect up de-serialization of OPFS handles to IPC actors r=nika,dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D149264
2022-12-13 19:23:35 +00:00
Narcis Beleuzu f213a8e9c1 Backed out changeset 0e5d5b851391 (bug 1805135) for Hazard bustages on FileSystemWritableFileStream.cpp . CLOSED TREE 2022-12-13 15:25:18 +02:00
Jan Varga 857acd9daa Bug 1805135 - Fix FileSystemWritableFileStream to use the default writer for all IO operations; r=dom-storage-reviewers,webidl,smaug,jari
Differential Revision: https://phabricator.services.mozilla.com/D164444
2022-12-13 06:43:55 +00:00
Jan Varga 860132797b Bug 1803062 - Switch from ordinary bool errors to nsresult errors in code for handling sync loops; r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D163559
2022-12-12 16:09:12 +00:00
Randell Jesup ec36412f03 Bug 1797579: Make SyncAccessHandle fully sync r=webidl,smaug
Differential Revision: https://phabricator.services.mozilla.com/D163396
2022-12-07 13:00:56 +00:00
Olli Pettay 73ed00444f Bug 1800470, make it possible to extend WritableStream with another cycle collectable class, r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D162287
2022-11-24 13:58:39 +00:00
Jan Varga b1055977ce Bug 1798773 - Always shutdown FileSystemManager; r=dom-worker-reviewers,smaug
Differential Revision: https://phabricator.services.mozilla.com/D162200
2022-11-24 13:58:38 +00:00
Randell Jesup 89f63f7a7d Bug 1785125: Disable OriginPrivateFileSystem (OPFS) in Private Browsing r=asuth,dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D154823
2022-11-23 02:07:32 +00:00
Stanca Serban 2798391322 Backed out changeset d9c663333d4f (bug 1785125) for causing bp-hybrid bustages on FileSystemManager. CLOSED TREE 2022-11-23 01:24:02 +02:00
Randell Jesup 7910263f25 Bug 1785125: Disable OriginPrivateFileSystem (OPFS) in Private Browsing r=asuth,dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D154823
2022-11-22 21:58:16 +00:00
Stanca Serban 427b298339 Backed out changeset be010fc803d9 (bug 1785125) for causing bp-hybrid bustages on FileSystemManager. CLOSED TREE 2022-11-22 22:57:44 +02:00
Randell Jesup ad0a885703 Bug 1785125: Disable OriginPrivateFileSystem (OPFS) in Private Browsing r=asuth,dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D154823
2022-11-22 18:37:38 +00:00
Cosmin Sabou 0480c1ce93 Backed out changeset 779cf97ae5de (bug 1800470) for crashtest failures on 1800470.html. CLOSED TREE 2022-11-18 01:09:55 +02:00
Olli Pettay 7042f2454c Bug 1800470, make it possible to extend WritableStream with another cycle collectable class, r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D162287
2022-11-17 21:32:57 +00:00
Jan Varga 7390297678 Bug 1790207 - Fix the function for comparing storage keys; r=dom-storage-reviewers,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D162089
2022-11-15 17:13:02 +00:00
Jan Varga f40ce49b02 Bug 1790207 - Forward declaration of mozilla::Result in nsIGlobalObject.h and other cleanup; r=dom-storage-reviewers,jesup
Depends on D162087

Differential Revision: https://phabricator.services.mozilla.com/D162088
2022-11-15 17:13:02 +00:00