Closed Bug 1658300 Opened 4 years ago Closed 4 years ago

Implement a Promise returning nsIPrinterList.getNamedOrDefaultPrinter(lastUsedPrinterName)

Categories

(Core :: Printing: Setup, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: jwatt, Assigned: alaskanemily)

References

(Blocks 1 open bug)

Details

(Whiteboard: [print2020_v81])

Attachments

(3 files)

Right now the frontend code has to wait for the entire list of printers to be fetched in order to iterate over that list and check whether the last used printer is still available. Fetching the entire list can potentially take a long time. It seems likely that it may be much better if the frontend code could do:

  let lastUsedPrinterName = printSettingsService.lastUsedPrinterName;
  let printer = await printerList.getNamedOrDefaultPrinter(lastUsedPrinterName);
  let printerName = printer.name;
  // ...

That way there will be less delay before it can get hold of the nsIPrinter that it should setup print preview with, and it can get on and message the platform code to start creating the print preview document sooner.

Assignee: nobody → emcdonough
Status: NEW → ASSIGNED

Also fix the odering of the methods in nsPrinterListCUPS while I'm messing
with it.

Attachment #9169687 - Attachment description: Bug 1658300 - Implement a promise-based nsIPrinterList::getNamedOrDefaultPrinter → Bug 1658300 - Implement a promise-based nsIPrinterList::getNamedOrDefaultPrinter. r=jwatt,emilio
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/autoland/rev/6eb8ce9c2299 Implement a promise-based nsIPrinterList::getNamedOrDefaultPrinter. r=jwatt,emilio https://hg.mozilla.org/integration/autoland/rev/5f947346134e Implement NamedPrinter() for nsPrinterListWin, and remove the base implementation. r=bobowen
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: