Skip to content

Commit

Permalink
Revert "Use build flag for OOP printing"
Browse files Browse the repository at this point in the history
This reverts commit d817045.

Reason for revert: Tree-closing compile failure https://ci.chromium.org/ui/p/chromium/builders/ci/android-archive-dbg/9592/overview

Original change's description:
> Use build flag for OOP printing
>
> As out-of-process printing support gets filled in there is an increasing
> number of places which require compile-time conditioning for the feature
> implementation.  It is more concise and clear if these code blocks are
> enclosed by a build flag, rather than to continue repeating the
> condition based upon the list of Windows, macOS, Linux, and ChromeOS
> platforms which this feature is currently supported on.
>
> Bug: 809738
> Change-Id: I5b9bda291c3daf15b44b9e4ab699cda7eafcf99f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3154758
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Robert Sesek <rsesek@chromium.org>
> Reviewed-by: Erik Chen <erikchen@chromium.org>
> Commit-Queue: Alan Screen <awscreen@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#921439}

Bug: 809738
Change-Id: I4852747b6f856955ce59d58c9ab8acca3738bad3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3161249
Auto-Submit: Roberto Carrillo <robertocn@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Roberto Carrillo <robertocn@chromium.org>
Owners-Override: Roberto Carrillo <robertocn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#921466}
  • Loading branch information
ro-berto authored and Chromium LUCI CQ committed Sep 15, 2021
1 parent 4492570 commit 0dadb7c
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 69 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5972,7 +5972,7 @@ static_library("browser") {
if (is_linux || is_chromeos) {
sources += [ "printing/printer_manager_dialog_linux.cc" ]
}
if (enable_oop_printing) {
if (is_win || is_mac || is_linux || is_chromeos) {
sources += [
"printing/print_backend_service_manager.cc",
"printing/print_backend_service_manager.h",
Expand Down Expand Up @@ -7428,7 +7428,7 @@ static_library("test_support") {
]
}

if (enable_oop_printing) {
if (enable_basic_printing) {
if (is_win || is_mac || is_linux || is_chromeos) {
sources += [
"printing/print_backend_service_test_impl.cc",
Expand Down
4 changes: 3 additions & 1 deletion chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6850,7 +6850,9 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kSyncAutofillWalletOfferDataDescription, kOsAll,
FEATURE_VALUE_TYPE(switches::kSyncAutofillWalletOfferData)},

#if BUILDFLAG(ENABLE_OOP_PRINTING)
#if (defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS)) && \
BUILDFLAG(ENABLE_PRINTING)
{"enable-oop-print-drivers", flag_descriptions::kEnableOopPrintDriversName,
flag_descriptions::kEnableOopPrintDriversDescription, kOsDesktop,
FEATURE_VALUE_TYPE(printing::features::kEnableOopPrintDrivers)},
Expand Down
14 changes: 6 additions & 8 deletions chrome/browser/flag_descriptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5195,6 +5195,12 @@ const char kDownloadShelfWebUIDescription[] =
#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS) || defined(OS_FUCHSIA)

const char kEnableOopPrintDriversName[] =
"Enables Out-of-Process Printer Drivers";
const char kEnableOopPrintDriversDescription[] =
"Enables printing interactions with the operating system to be performed "
"out-of-process.";

const char kWebUIBrandingUpdateName[] = "WebUI Branding Update";
const char kWebUIBrandingUpdateDescription[] =
"Changes various UI components in WebUI pages to have a more modern look.";
Expand Down Expand Up @@ -5276,14 +5282,6 @@ const char kNaclDescription[] =
"installed from the Chrome Web Store.";
#endif // ENABLE_NACL

#if BUILDFLAG(ENABLE_OOP_PRINTING)
const char kEnableOopPrintDriversName[] =
"Enables Out-of-Process Printer Drivers";
const char kEnableOopPrintDriversDescription[] =
"Enables printing interactions with the operating system to be performed "
"out-of-process.";
#endif // BUILDFLAG(ENABLE_OOP_PRINTING)

#if BUILDFLAG(ENABLE_PAINT_PREVIEW) && defined(OS_ANDROID)
const char kPaintPreviewDemoName[] = "Paint Preview Demo";
const char kPaintPreviewDemoDescription[] =
Expand Down
8 changes: 3 additions & 5 deletions chrome/browser/flag_descriptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3006,6 +3006,9 @@ extern const char kDownloadShelfWebUIDescription[];
#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS) || defined(OS_FUCHSIA)

extern const char kEnableOopPrintDriversName[];
extern const char kEnableOopPrintDriversDescription[];

extern const char kWebUIBrandingUpdateName[];
extern const char kWebUIBrandingUpdateDescription[];

Expand Down Expand Up @@ -3065,11 +3068,6 @@ extern const char kNaclName[];
extern const char kNaclDescription[];
#endif // ENABLE_NACL

#if BUILDFLAG(ENABLE_OOP_PRINTING)
extern const char kEnableOopPrintDriversName[];
extern const char kEnableOopPrintDriversDescription[];
#endif // BUILDFLAG(ENABLE_OOP_PRINTING)

#if BUILDFLAG(ENABLE_PAINT_PREVIEW) && defined(OS_ANDROID)
extern const char kPaintPreviewDemoName[];
extern const char kPaintPreviewDemoDescription[];
Expand Down
2 changes: 1 addition & 1 deletion chrome/services/printing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ source_set("lib") {
deps += [ "//skia" ]
}

if (enable_oop_printing) {
if (is_win || is_mac || is_linux || is_chromeos) {
sources += [
"print_backend_service_impl.cc",
"print_backend_service_impl.h",
Expand Down
3 changes: 1 addition & 2 deletions chrome/services/printing/public/mojom/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import("//build/config/chromeos/ui_mode.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//printing/buildflags/buildflags.gni")

mojom("mojom") {
sources = [
Expand Down Expand Up @@ -38,7 +37,7 @@ mojom("mojom") {
sources += [ "pdf_to_emf_converter.mojom" ]
}

if (enable_oop_printing) {
if (is_win || is_mac || is_linux || is_chromeos) {
sources += [ "print_backend_service.mojom" ]
public_deps += [
"//printing/backend/mojom",
Expand Down
3 changes: 2 additions & 1 deletion chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3883,7 +3883,8 @@ if (!is_android && !is_fuchsia) {
"//third_party/widevine/cdm",
]
}
if (enable_oop_printing) {
if (enable_basic_printing &&
(is_win || is_mac || is_linux || is_chromeos)) {
sources += [ "../browser/printing/print_backend_browsertest.cc" ]
deps += [
"//chrome/services/printing:lib",
Expand Down
6 changes: 1 addition & 5 deletions chromeos/crosapi/mojom/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# found in the LICENSE file.

import("//mojo/public/tools/bindings/mojom.gni")
import("//printing/buildflags/buildflags.gni")

mojom("mojom") {
sources = [
Expand Down Expand Up @@ -62,6 +61,7 @@ mojom("mojom") {
"//media/capture/mojom:image_capture",
"//media/capture/mojom:video_capture_types",
"//mojo/public/mojom/base",
"//printing/backend/mojom",
"//printing/mojom",
"//remoting/host/mojom:mojom",
"//services/device/public/mojom:mojom",
Expand All @@ -75,10 +75,6 @@ mojom("mojom") {
"//url/mojom:url_mojom_gurl",
]

if (enable_oop_printing) {
public_deps += [ "//printing/backend/mojom" ]
}

cpp_typemaps = [
{
types = [
Expand Down
23 changes: 7 additions & 16 deletions printing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ component("printing_base") {
cflags = []
defines = [ "IS_PRINTING_BASE_IMPL" ]

public_deps = [
"//build:chromeos_buildflags",
"//printing/buildflags",
]
public_deps = [ "//build:chromeos_buildflags" ]
deps = [
"//base",
"//third_party/icu",
Expand All @@ -68,7 +65,7 @@ component("printing_base") {
]
}

if (enable_oop_printing && (is_linux || is_chromeos)) {
if (is_linux || is_chromeos) {
source_set("printing_sandbox_hook") {
sources = [
"sandbox/print_backend_sandbox_hook_linux.cc",
Expand Down Expand Up @@ -127,6 +124,7 @@ component("printing") {
public_deps = [
":printing_base",
"//printing/backend",
"//printing/buildflags",
]
deps = [
"//base",
Expand Down Expand Up @@ -266,10 +264,12 @@ static_library("test_support") {

test("printing_unittests") {
sources = [
"backend/mojom/print_backend_mojom_traits_unittest.cc",
"backend/print_backend_unittest.cc",
"backend/print_backend_utils_unittest.cc",
"backend/test_print_backend_unittest.cc",
"metafile_skia_unittest.cc",
"mojom/printing_context_mojom_traits_unittest.cc",
"nup_parameters_unittest.cc",
"page_number_unittest.cc",
"page_range_unittest.cc",
Expand All @@ -291,8 +291,10 @@ test("printing_unittests") {
"//mojo/public/cpp/test_support:test_utils",
"//printing/backend",
"//printing/backend:test_support",
"//printing/backend/mojom",
"//printing/common",
"//printing/mojom",
"//printing/mojom:printing_context",
"//testing/gmock",
"//testing/gtest",
"//ui/base",
Expand All @@ -301,17 +303,6 @@ test("printing_unittests") {
"//ui/gfx/geometry",
]

if (enable_oop_printing) {
sources += [
"backend/mojom/print_backend_mojom_traits_unittest.cc",
"mojom/printing_context_mojom_traits_unittest.cc",
]
deps += [
"//printing/backend/mojom",
"//printing/mojom:printing_context",
]
}

if (is_mac) {
sources += [ "pdf_metafile_cg_mac_unittest.cc" ]

Expand Down
3 changes: 0 additions & 3 deletions printing/backend/mojom/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

import("//build/config/chromeos/ui_mode.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//printing/buildflags/buildflags.gni")

assert(enable_oop_printing)

mojom("mojom") {
sources = [ "print_backend.mojom" ]
Expand Down
1 change: 0 additions & 1 deletion printing/buildflags/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ buildflag_header("buildflags") {
"ENABLE_PRINTING=$enable_basic_printing",
"ENABLE_PRINT_PREVIEW=$enable_print_preview",
"ENABLE_TAGGED_PDF=$enable_tagged_pdf",
"ENABLE_OOP_PRINTING=$enable_oop_printing",
]
}
6 changes: 0 additions & 6 deletions printing/buildflags/buildflags.gni
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,3 @@ declare_args() {
# TODO(crbug.com/226176): Remove this after CUPS PPD API calls are removed.
use_cups_ipp = use_cups && !is_linux
}

declare_args() {
# Enable out-of-process printing. For now this matches the same platforms as
# those which support print preview.
enable_oop_printing = enable_print_preview
}
2 changes: 1 addition & 1 deletion printing/mojom/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mojom("mojom") {
sources = [ "print.mojom" ]
}

if (enable_oop_printing) {
if (enable_basic_printing) {
mojom("printing_context") {
if (is_linux || is_chromeos) {
enabled_features = [ "is_linux_or_chromeos" ]
Expand Down
7 changes: 4 additions & 3 deletions printing/printing_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "printing/printing_features.h"

#include "build/chromeos_buildflags.h"
#include "printing/buildflags/buildflags.h"

#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS)
Expand Down Expand Up @@ -54,15 +53,17 @@ bool ShouldPrintUsingXps(bool source_is_pdf) {
}
#endif // defined(OS_WIN)

#if BUILDFLAG(ENABLE_OOP_PRINTING)
#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS)
// Enables printing interactions with the operating system to be performed
// out-of-process.
const base::Feature kEnableOopPrintDrivers{"EnableOopPrintDrivers",
base::FEATURE_DISABLED_BY_DEFAULT};

const base::FeatureParam<bool> kEnableOopPrintDriversJobPrint{
&kEnableOopPrintDrivers, "JobPrint", false};
#endif // BUILDFLAG(ENABLE_OOP_PRINTING)
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
// defined(OS_CHROMEOS)

} // namespace features
} // namespace printing
7 changes: 4 additions & 3 deletions printing/printing_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "base/feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "printing/buildflags/buildflags.h"

namespace printing {
namespace features {
Expand Down Expand Up @@ -42,12 +41,14 @@ COMPONENT_EXPORT(PRINTING_BASE)
bool ShouldPrintUsingXps(bool source_is_pdf);
#endif // defined(OS_WIN)

#if BUILDFLAG(ENABLE_OOP_PRINTING)
#if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
defined(OS_CHROMEOS)
COMPONENT_EXPORT(PRINTING_BASE)
extern const base::Feature kEnableOopPrintDrivers;
COMPONENT_EXPORT(PRINTING_BASE)
extern const base::FeatureParam<bool> kEnableOopPrintDriversJobPrint;
#endif // BUILDFLAG(ENABLE_OOP_PRINTING)
#endif // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
// defined(OS_CHROMEOS)

} // namespace features
} // namespace printing
Expand Down
8 changes: 2 additions & 6 deletions sandbox/policy/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ component("policy") {
"linux/bpf_network_policy_linux.h",
"linux/bpf_ppapi_policy_linux.cc",
"linux/bpf_ppapi_policy_linux.h",
"linux/bpf_print_backend_policy_linux.cc",
"linux/bpf_print_backend_policy_linux.h",
"linux/bpf_print_compositor_policy_linux.cc",
"linux/bpf_print_compositor_policy_linux.h",
"linux/bpf_renderer_policy_linux.cc",
Expand All @@ -72,12 +74,6 @@ component("policy") {
"linux/sandbox_seccomp_bpf_linux.cc",
"linux/sandbox_seccomp_bpf_linux.h",
]
if (enable_oop_printing) {
sources += [
"linux/bpf_print_backend_policy_linux.cc",
"linux/bpf_print_backend_policy_linux.h",
]
}
configs += [
"//media:media_config",
"//media/audio:platform_config",
Expand Down
6 changes: 1 addition & 5 deletions sandbox/policy/mac/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# found in the LICENSE file.

import("//build/config/python.gni")
import("//printing/buildflags/buildflags.gni")

sb_files = [
"audio.sb",
Expand All @@ -14,16 +13,13 @@ sb_files = [
"nacl_loader.sb",
"network.sb",
"ppapi.sb",
"print_backend.sb",
"print_compositor.sb",
"renderer.sb",
"speech_recognition.sb",
"utility.sb",
]

if (enable_oop_printing) {
sb_files += [ "print_backend.sb" ]
}

action_foreach("package_sb_files") {
script = "package_sb_file.py"
sources = sb_files
Expand Down

0 comments on commit 0dadb7c

Please sign in to comment.