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