From ce35bda80580cd355f5cdf31d39f9b4da82822e4 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 31 Jan 2023 12:06:11 +0100 Subject: [PATCH] fix: crash on `window.print()` (#37052) fix: crash on window.print() --- patches/chromium/printing.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index 44cbe97a13eb..a98e085f5a2c 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -78,7 +78,7 @@ index 796c7f06fa6063ac409f3fef53871e18d4c07838..6575e833388bcc3ac487a409027d984b : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3; } diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc -index 017e421d0ca3e6154b849373abbcb8d75b369e60..463f743af273b0f2f5afe6904ed77e7e99a91f46 100644 +index 017e421d0ca3e6154b849373abbcb8d75b369e60..aaadfba1735b21e17b66e8efe69f8a5ab4a312b0 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc @@ -29,8 +29,6 @@ @@ -264,6 +264,15 @@ index 017e421d0ca3e6154b849373abbcb8d75b369e60..463f743af273b0f2f5afe6904ed77e7e auto callback_wrapper = base::BindOnce(&PrintViewManagerBase::UpdatePrintSettingsReply, +@@ -630,7 +664,7 @@ void PrintViewManagerBase::UpdatePrintSettings( + void PrintViewManagerBase::IsPrintingEnabled( + IsPrintingEnabledCallback callback) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); +- std::move(callback).Run(printing_enabled_.GetValue()); ++ std::move(callback).Run(true); + } + + void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, @@ -646,14 +680,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, // didn't happen for some reason. bad_message::ReceivedBadMessage(