Closed Bug 1833450 Opened 3 years ago Closed 2 years ago

Reify filepicker commands in preparation for sending them over IPC

Categories

(Core :: Widget: Win32, task, P3)

Desktop
Windows
task

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: rkraesig, Assigned: rkraesig)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

As part of work for bug 1671770, separate deciding what to do with an IFileDialog from actually doing it. This will allow performing the former in the main process and the latter in a utility process.

This should involve no functional changes, just a refactoring of the existing code.

In preparation for moving the file picker dialog's invocation out-of-
process (bug 1671770), create an IPC-compatible Command type -- a
reification of the method calls we actually perform to set up the file
dialog -- along with supporting functionality to apply those commands to
an IFileDialog, as needed.

No functional changes, as this type isn't yet created by anything:
that's left for a later commit in this patchset.

Perform some cleanup on nsFilePicker before refactoring to use the
Command type from the previous commit:

  • Remove stray typedefs/usings.
  • Remove an unused member mFilterList.
  • Eliminate the private class ComDlgFilterSpec, mostly replacing it
    with a plain nsTArray.

Depends on D178202

Convert nsFilePicker to use the Command structs introduced in the
first commit in this patchset. No functional changes -- this should be a
straight reorganization of internal code.

Additionally, remove from WinUtils the now-unused function
GetShellItemPath, whose functionality has been moved into Command's
associated functions' translation unit. (This function was added to
WinUtils in 2012 as part of supporting the Windows Vista file picker
(bug 718374). It's not overtly filepicker-specific, but in the past
eleven years, no other code has ever used it.)

Depends on D178203

Attachment #9334152 - Attachment description: Bug 1833450 - [1/3] Windows nsFilePicker: Add IPC-able Windows-file-dialog commands r=cmartin,gstoll,handyman → Bug 1833450 - [1/4] Windows nsFilePicker: Add IPC-able Windows-file-dialog commands r=cmartin,gstoll,handyman
Attachment #9334153 - Attachment description: Bug 1833450 - [2/3] Windows nsFilePicker: prefatory cleanup r=cmartin,gstoll,handyman → Bug 1833450 - [2/4] Windows nsFilePicker: prefatory cleanup r=cmartin,gstoll,handyman
Attachment #9334154 - Attachment description: Bug 1833450 - [3/3] Windows nsFilePicker: convert to use IPC-able Command structs r=cmartin,gstoll,handyman → Bug 1833450 - [3/4] Windows nsFilePicker: convert to use IPC-able Command structs r=cmartin,gstoll,handyman

The one functional change in this patchset: if a name cannot be
extracted from any IShellItem during multiple-selection, fail the entire
operation instead of only quietly dropping the failed items.

(The vast majority of IShellItem instances have filesystem paths -- even
if they're shell-generated nonce paths, sometimes -- so there's not
likely to be any effective difference here for any end-user.)

Depends on D178204

Pushed by rkraesig@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f94b7ccda1c4 [1/4] Windows nsFilePicker: Add IPC-able Windows-file-dialog commands r=gstoll,handyman https://hg.mozilla.org/integration/autoland/rev/e6da2de25723 [2/4] Windows nsFilePicker: prefatory cleanup r=gstoll,handyman https://hg.mozilla.org/integration/autoland/rev/531f617ab483 [3/4] Windows nsFilePicker: convert to use IPC-able Command structs r=gstoll,handyman https://hg.mozilla.org/integration/autoland/rev/d1510314ee22 [4/4] Windows nsFilePicker: abort on failure to extract names from shell items r=handyman
Regressions: 1833982
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: