diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/ipc/BrowserChild.cpp | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/ipc/BrowserChild.cpp')
-rw-r--r-- | dom/ipc/BrowserChild.cpp | 62 |
1 files changed, 53 insertions, 9 deletions
diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp index bdd10fdcb2..3d1f399edb 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp @@ -2342,7 +2342,7 @@ mozilla::ipc::IPCResult BrowserChild::RecvPrintPreview( /* aListener = */ nullptr, docShellToCloneInto, nsGlobalWindowOuter::IsPreview::Yes, nsGlobalWindowOuter::IsForWindowDotPrint::No, - std::move(aCallback), IgnoreErrors()); + std::move(aCallback), nullptr, IgnoreErrors()); #endif return IPC_OK(); } @@ -2359,8 +2359,9 @@ mozilla::ipc::IPCResult BrowserChild::RecvExitPrintPreview() { return IPC_OK(); } -mozilla::ipc::IPCResult BrowserChild::RecvPrint( - const MaybeDiscardedBrowsingContext& aBc, const PrintData& aPrintData) { +mozilla::ipc::IPCResult BrowserChild::CommonPrint( + const MaybeDiscardedBrowsingContext& aBc, const PrintData& aPrintData, + RefPtr<BrowsingContext>* aCachedBrowsingContext) { #ifdef NS_PRINTING if (NS_WARN_IF(aBc.IsNullOrDiscarded())) { return IPC_OK(); @@ -2389,12 +2390,12 @@ mozilla::ipc::IPCResult BrowserChild::RecvPrint( IgnoredErrorResult rv; RefPtr printJob = static_cast<RemotePrintJobChild*>( aPrintData.remotePrintJob().AsChild()); - outerWindow->Print(printSettings, printJob, - /* aListener = */ nullptr, - /* aWindowToCloneInto = */ nullptr, - nsGlobalWindowOuter::IsPreview::No, - nsGlobalWindowOuter::IsForWindowDotPrint::No, - /* aPrintPreviewCallback = */ nullptr, rv); + outerWindow->Print( + printSettings, printJob, + /* aListener = */ nullptr, + /* aWindowToCloneInto = */ nullptr, nsGlobalWindowOuter::IsPreview::No, + nsGlobalWindowOuter::IsForWindowDotPrint::No, + /* aPrintPreviewCallback = */ nullptr, aCachedBrowsingContext, rv); if (NS_WARN_IF(rv.Failed())) { return IPC_OK(); } @@ -2403,6 +2404,49 @@ mozilla::ipc::IPCResult BrowserChild::RecvPrint( return IPC_OK(); } +mozilla::ipc::IPCResult BrowserChild::RecvPrint( + const MaybeDiscardedBrowsingContext& aBc, const PrintData& aPrintData, + bool aReturnStaticClone, PrintResolver&& aResolve) { +#ifdef NS_PRINTING + RefPtr<BrowsingContext> browsingContext; + auto result = CommonPrint(aBc, aPrintData, + aReturnStaticClone ? &browsingContext : nullptr); + aResolve(browsingContext); + return result; +#else + aResolve(nullptr); + return IPC_OK(); +#endif +} + +mozilla::ipc::IPCResult BrowserChild::RecvPrintClonedPage( + const MaybeDiscardedBrowsingContext& aBc, const PrintData& aPrintData, + const MaybeDiscardedBrowsingContext& aClonedBc) { +#ifdef NS_PRINTING + if (aClonedBc.IsNullOrDiscarded()) { + return IPC_OK(); + } + RefPtr<BrowsingContext> clonedBc = aClonedBc.get(); + return CommonPrint(aBc, aPrintData, &clonedBc); +#else + return IPC_OK(); +#endif +} + +mozilla::ipc::IPCResult BrowserChild::RecvDestroyPrintClone( + const MaybeDiscardedBrowsingContext& aCachedPage) { +#ifdef NS_PRINTING + if (aCachedPage) { + RefPtr<nsPIDOMWindowOuter> window = aCachedPage->GetDOMWindow(); + if (NS_WARN_IF(!window)) { + return IPC_OK(); + } + window->Close(); + } +#endif + return IPC_OK(); +} + mozilla::ipc::IPCResult BrowserChild::RecvUpdateNativeWindowHandle( const uintptr_t& aNewHandle) { #if defined(XP_WIN) && defined(ACCESSIBILITY) |