Bug 1432651 p1 - Pass RemotePrintJobChild through to the places where it's needed. r=emilio

Given how nsIPrintSettings is passed around, stored and copied all over the
place, it's very hard to reason about where and when a RemotePrintJobChild is
needed or valid. This patch avoids all that by explicitly passing a
RemotePrintJobChild when it's needed.

Another reason to make this change is because RemotePrintJobChild really does
not belong on nsIPrintSettings. That interface is supposed to represent a
collection of settings for laying out the document that is to be printed.

Differential Revision: https://phabricator.services.mozilla.com/D146380
This commit is contained in:
Jonathan Watt
2022-05-16 08:38:01 +00:00
parent 119d6b5c6f
commit e5a8eb1650
13 changed files with 78 additions and 49 deletions

View File

@@ -706,7 +706,8 @@ already_AddRefed<Promise> CanonicalBrowsingContext::Print(
}
ErrorResult rv;
outerWindow->Print(aPrintSettings, listener,
outerWindow->Print(aPrintSettings,
/* aRemotePrintJob = */ nullptr, listener,
/* aDocShellToCloneInto = */ nullptr,
nsGlobalWindowOuter::IsPreview::No,
nsGlobalWindowOuter::IsForWindowDotPrint::No,