Bug 1181630 - [e10s] Printing doesn't work in e10s mode when no printers installed (in Print & Scan system pref panel)
Removing printers: https://support.apple.com/en-us/HT201539

I've put the following files into ~/Projects:

cupsd.conf
cupsd.conf.default
snmp.conf
InstalledPrinters.plist

The first three belong to /private/etc/cups
The last belongs to /Library/Printers

After clearing out all of my printers, I can reproduce the issue.


First question:

At what point do we spawn this error?

Let's attach a debugger to both the parent and child process, and set breakpoints on nsPrintEngine::ShowPrintErrorDialog, since that's probably where this dialog is coming from.

The child is the one spawning this dialog! Something wrong is occurring in DoCommonPrint, because it's returning an NS_ERROR_FAILURE nsresult return value.

Question: What's going wrong in nsPrintEngine::DoCommonPrint?

Answer:

nsCOMPtr<nsIWebBrowserPrint> wbp(do_QueryInterface(mDocViewerPrint));
rv = printPromptService->ShowPrintDialog(domWin, wbp,
mPrt->mPrintSettings);

The return value from ShowPrintDialog is NS_ERROR_FAILURE.

Question: Why is ShowPrintDialog returning NS_ERROR_FAILURE in the content process when there are no printers?

Answer: This is because the parent is returning NS_ERROR_FAILURE when the content process attempts to show the print settings dialog.

Question: Why is the parent returning NS_ERROR_FAILURE when showing the print settings dialog?

Answer: This is because when deserializing the PrintData from the child, we check to make sure that a printer exists for the printer name passed up. If we cannot find a printer, we return NS_ERROR_FAILURE.