Bug 1180878 - [e10s] Can't Print to PDF if folder name contains spaces
Yes! I can reproduce this! It looks like we're sending the job to the printer that is selected in the dialog even though we said we wanted to save it as a PDF.

So something has gone awry.

Note that this works if there is no space in the name, as Felipe correctly pointed out. So I wonder if somehow we're screwing up serializing the directory name that we're supposed to be saving to?

Relevant field in NSPrintInfo:

NSPrintJobSavingURL

"An NSURL containing the location to which the job file will be saved when the jobDisposition is NSPrintSaveJob ."

I stored this in toFileName in the PrintData struct.

HYPOTHESIS TIME:

We're not correctly serializing the toFileName from the parent when the parent has sent a filename with a space in it.

Test: Attach a debugger and see what the parent is sending up through toFileName when we have a space in the folder, and see what the NSURL is that the child constructs when deserializing the PrintData to the NSPrintInfo dictionary.

Our hypothesis was almost correct. The real problem is that we're not DESERIALIZING correctly.

The NSURL that goes in is:
jobSavingURL    NSURL *    @"file://localhost/Users/mikeconley/Projects/Felipe%20Test/Nightly%20Start%20Page.pdf"

The NSURL that gets constructed in the child is:
jobSavingURL    NSURL *    @"file://localhost/Users/mikeconley/Projects/Felipe%2520Test/Nightly%2520Start%2520Page.pdf"

So it's an escaping problem!

The solution is to assume that when we're deserializing an NSURL, that it is already percent encoded and doesn't need to be re-encoded again.