7
0
Files
nodejs-electron/print_dialog_gtk-no-kEnableOopPrintDriversJobPrint.patch

98 lines
3.5 KiB
Diff
Raw Normal View History

Accepting request 1059202 from home:dziobian:gulgul-ultron:19 - Update to 22.0.2 * ABI break: NODE_MODULE_VERSION is now 110. Native modules may need recompiling * Chromium to 108.0.5359.179 * Node v16.17.1 * V8 v10.8 * Added WebContents input-event event. * Deprecated BrowserWindow scroll-touch-* events. * The deprecated new-window event has been removed. * Added contextBridge.exposeInIsolatedWorld(worldId, key, api) to expose an API to an isolatedWorld within a renderer from a preload script. * Added webContents.close() method. * Added new UtilityProcess API to launch chromium child process with node integration. * Added new WebContents event content-bounds-updated. * Added support for navigator.mediaDevices.getDisplayMedia via a new session handler, ses.setDisplayMediaRequestHandler. * Added support for serialPort.forget() as well as a new event serial-port-revoked emitted when a given origin is revoked. - Drop patches applied upstream * argument_spec-missing-isnan-isinf.patch * chromium-103.0.5060.53-python3-do-not-use-deprecated-mode-U.patch * content_language_parser-missing-string.patch * gtk_ui_platform_stub-incomplete-type-LinuxInputMethodContext.patch * node-system-libs.patch * pending_beacon_dispatcher-virtual-functions-cannot-be-constexpr.patch * std_lib_extras-missing-intptr_t.patch * system-abseil-missing-shims.patch - Re-add electron_serial_delegate-ambiguous-Observer.patch due to upstream reintroducing the invalid code - Add patches to fix build errors * chromium-108-abseil-shims.patch * crashpad-elf_image_reader-ProgramHeaderTableSpecific-expected-unqualified-id.patch * document_loader-private-DecodedBodyData.patch * first_party_set_parser-IssueWithMetadata-no-known-conversion.patch * print_dialog_gtk-no-kEnableOopPrintDriversJobPrint.patch * swiftshader-LLVMJIT-AddressSanitizerPass-dead-code-remove.patch - Conditionally reverse upstream changes to fix build with old harfbuzz * harfbuzz-replace-chromium-scoped-type.patch - Switch to bundled libjxl on Fedora 36 due to system version being too old OBS-URL: https://build.opensuse.org/request/show/1059202 OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=57
2023-01-18 06:07:26 +00:00
From e3fcdb9c67501e7e4b86ea904e154ea615b5187e Mon Sep 17 00:00:00 2001
From: Lei Zhang <thestig@chromium.org>
Date: Tue, 18 Oct 2022 17:51:09 +0000
Subject: [PATCH] Fix build when enable_oop_printing=false.
https://crrev.com/1050907 changed print_dialog_gtk.cc to start checking
`kEnableOopPrintDriversJobPrint`, assuming it is unconditionally
defined.
Similarly, various CLs like https://crrev.com/992136 changed
print_browsertest.cc without the proper conditionals.
Change-Id: Ie7efe976bba4b7583be104fad37984bea07f8773
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3962532
Reviewed-by: Alan Screen <awscreen@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1060540}
---
diff --git a/chrome/browser/printing/print_browsertest.cc b/chrome/browser/printing/print_browsertest.cc
index a70cd643..c66456f 100644
--- a/chrome/browser/printing/print_browsertest.cc
+++ b/chrome/browser/printing/print_browsertest.cc
@@ -2733,6 +2733,7 @@
void PrimeAsRepeatingErrorGenerator() { reset_errors_after_check_ = false; }
+#if BUILDFLAG(ENABLE_OOP_PRINTING)
void PrimeForSpoolingSharedMemoryErrors() {
simulate_spooling_memory_errors_ = true;
}
@@ -2784,6 +2785,7 @@
bool print_backend_service_use_detected() const {
return print_backend_service_use_detected_;
}
+#endif // BUILDFLAG(ENABLE_OOP_PRINTING)
mojom::ResultCode use_default_settings_result() const {
return use_default_settings_result_;
@@ -2838,7 +2840,6 @@
return std::make_unique<TestPrintJobWorker>(
rfh_id, &test_print_job_worker_callbacks_);
}
-#endif // BUILDFLAG(ENABLE_OOP_PRINTING)
void OnUseDefaultSettings() {
did_use_default_settings_ = true;
@@ -2861,6 +2862,7 @@
print_backend_service_use_detected_ = true;
}
}
+#endif // BUILDFLAG(ENABLE_OOP_PRINTING)
void ErrorCheck(mojom::ResultCode result) {
// Interested to reset any trigger for causing access-denied errors, so
diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc
index 98985bc..0596691 100644
--- a/ui/gtk/printing/print_dialog_gtk.cc
+++ b/ui/gtk/printing/print_dialog_gtk.cc
@@ -13,6 +13,7 @@
#include "base/bind.h"
#include "base/check_op.h"
+#include "base/dcheck_is_on.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
@@ -22,6 +23,7 @@
#include "base/task/thread_pool.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/values.h"
+#include "printing/buildflags/buildflags.h"
#include "printing/metafile.h"
#include "printing/mojom/print.mojom.h"
#include "printing/print_job_constants.h"
@@ -419,11 +421,19 @@
void PrintDialogGtk::PrintDocument(const printing::MetafilePlayer& metafile,
const std::u16string& document_name) {
+#if DCHECK_IS_ON()
+#if BUILDFLAG(ENABLE_OOP_PRINTING)
+ const bool kOopPrinting =
+ printing::features::kEnableOopPrintDriversJobPrint.Get();
+#else
+ const bool kOopPrinting = false;
+#endif // BUILDFLAG(ENABLE_OOP_PRINTING)
+
// For in-browser printing, this runs on the print worker thread, so it does
// not block the UI thread. For OOP it runs on the service document task
// runner.
- DCHECK_EQ(owning_task_runner()->RunsTasksInCurrentSequence(),
- printing::features::kEnableOopPrintDriversJobPrint.Get());
+ DCHECK_EQ(owning_task_runner()->RunsTasksInCurrentSequence(), kOopPrinting);
+#endif // DCHECK_IS_ON()
// The document printing tasks can outlive the PrintingContext that created
// this dialog.