Async Win32 file-picker
Categories
(Core :: Widget: Win32, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox122 | --- | fixed |
People
(Reporter: rkraesig, Assigned: rkraesig)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
Attachments
(10 files, 3 obsolete files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Our internal file-picker interface is already mostly async. However, the Win32 file dialog itself is synchronous and modal; it will need to be placed on a separate thread to avoid blocking the main event loop.
(This is formally orthogonal to moving it out-of-process, per bug 1837079, but the two tasks touch enough of the same code that in practice they have to be sequenced somehow.)
Assignee | ||
Comment 1•10 months ago
|
||
Updated•10 months ago
|
Assignee | ||
Comment 2•10 months ago
|
||
We're about to add some code that will actually create a file dialog,
rather than just the actor, asynchronously. Rename this function to make
it clear which of those it does.
(That it does so asynchronously is probably sufficiently communicated by
the return type.)
Depends on D193732
Assignee | ||
Comment 3•10 months ago
|
||
These functions are essentially sprues, left over from earlier
development. Trim them away.
No functional changes.
Depends on D193733
Assignee | ||
Comment 4•10 months ago
|
||
Introduce functions which create and invoke the Windows file-picker in a
separate thread.
Technically, no functional changes: these functions aren't actually
invoked yet. (That will occur in an upcoming commit.)
Depends on D193734
Assignee | ||
Comment 5•10 months ago
|
||
When opening a file picker in a utility process, do so off the utility
process's main thread, allowing multiple dialogs to resolve in parallel.
The relevant IPC calls are already formally async, so this suffices to
convert them to being functionally async as well. (While this is
technically a functional change, it's not yet a user-visible one: the
parent-process code is still synchronous.)
Depends on D193735
Assignee | ||
Comment 6•10 months ago
|
||
When opening a file dialog locally (that is, in the parent process), do
so asynchronously on a separate thread.
Since the calling code is still synchronous, this necessitates adding
new calls to ImmorallyDrivePromiseToCompletion
at the sync-to-async
boundary. These are very temporary -- they'll be removed before this
patchset is done.
Depends on D193736
Assignee | ||
Comment 7•10 months ago
|
||
Pull the sync-to-async boundary up one function-call layer, from
ShowXxxPicker{Local,Remote}
to ShowXxxPicker
. This coalesces the
remote and local sync-to-async boundaries.
Additionally, standardize on exclusive MozPromises, since none of them
happen to need multiple listeners.
This is arguably, but not practically, a functional change, as a tiny
bit of glue code is now executed on a different thread.
(N.B.: While this reduces the total number of sync-to-async boundaries
back down to two, this is not the removal promised in the previous
commit summary.)
Depends on D193737
Assignee | ||
Comment 8•10 months ago
|
||
Pull the sync-to-async boundary up another function-call layer. This
unifies the file- and folder-picker sync-to-async boundaries.
Again, no functional changes except for the migration of a tiny bit of
glue code.
Depends on D193738
Assignee | ||
Comment 9•10 months ago
|
||
Pull the async-to-sync transition down one (or two) class-layers, while
pulling the sync-to-async transition up one more function layer. This
allows them to meet in a single function -- where they cleanly annihilate.
This is a significant functional change, as it leaves the file-dialog
implementation fully asynchronous on Windows! \o/
Depends on D193739
Assignee | ||
Comment 10•10 months ago
|
||
This is no longer needed on Windows, so #ifdef it out.
Depends on D193740
Assignee | ||
Comment 11•10 months ago
|
||
For clarity, separate out decoding what the preference says to do (which
is not as trivial as might be desired) from actually doing it (ditto).
Depends on D193741
Assignee | ||
Comment 12•10 months ago
|
||
Add a lint (paralleling the existing lint for CoInitializeEx
) for new
uses of the utility classes defined in ApartmentRegion.h.
Depends on D194302
Comment 13•10 months ago
|
||
Comment on attachment 9364851 [details]
Bug 1858225 - [2/2] Add lint for ApartmentRegion and derivatives r?handyman!
Revision D194303 was moved to bug 1865867. Setting attachment 9364851 [details] to obsolete.
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
Comment 14•10 months ago
|
||
Assignee | ||
Comment 15•10 months ago
|
||
Comment 16•10 months ago
|
||
Comment 17•10 months ago
|
||
Backed out for causing build bustages on nsFilePicker.cpp.
Failure logs:
- https://treeherder.mozilla.org/logviewer?job_id=438369662&repo=autoland
- https://treeherder.mozilla.org/logviewer?job_id=438379399&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/666eeec4bdca3f9b7f4e03e2e85b3e6ceadaacea
Updated•10 months ago
|
Assignee | ||
Comment 18•10 months ago
|
||
Reresolved the misresolved merge conflict, then ran git rebase -i central --exec './mach build'
with the clang-plugin active; all green.
A current try-job is also green so far, except for known intermittents. Attempting a reland shortly...
Comment 19•10 months ago
|
||
Comment 20•10 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6b56a5c339c3
https://hg.mozilla.org/mozilla-central/rev/54e12c84d094
https://hg.mozilla.org/mozilla-central/rev/32f455e67029
https://hg.mozilla.org/mozilla-central/rev/1c7b0f8d1e8d
https://hg.mozilla.org/mozilla-central/rev/1a25d0d1161b
https://hg.mozilla.org/mozilla-central/rev/d08b97ae0098
https://hg.mozilla.org/mozilla-central/rev/e66d99182863
https://hg.mozilla.org/mozilla-central/rev/735ce96c3325
https://hg.mozilla.org/mozilla-central/rev/1c6cd3fa8c52
https://hg.mozilla.org/mozilla-central/rev/3e082a66c721
Description
•