Skip to content

Commit

Permalink
Delete chrome/service, AKA the Cloud Print service process.
Browse files Browse the repository at this point in the history
Given Cloud Print is deprecated, there is no way to use this service
process to connect local printers to Cloud Print.

This CL deletes the chrome/service directory as well as most associated
code. Though it is not exhaustive and other code that is only used by
chrome/service will be cleaned up in separate CLs.

Bug: 1162164
Change-Id: Ib813b76d2ce801c2c063a9917a90700ba76d8cb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3370810
Reviewed-by: Alan Screen <awscreen@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: Sean Harrison <harrisonsean@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#958691}
  • Loading branch information
leizleiz authored and Chromium LUCI CQ committed Jan 13, 2022
1 parent 8c4521c commit 8306c1e
Show file tree
Hide file tree
Showing 118 changed files with 5 additions and 16,518 deletions.
3 changes: 0 additions & 3 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1353,9 +1353,6 @@ group("browser_dependencies") {

if (enable_basic_printing) {
public_deps += [ "//printing" ]
if (enable_print_preview && !is_chromeos) {
public_deps += [ "//chrome/service" ]
}
}

if (enable_gwp_asan) {
Expand Down
14 changes: 1 addition & 13 deletions chrome/app/chrome_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@ base::LazyInstance<ChromeContentUtilityClient>::DestructorAtExit

extern int NaClMain(content::MainFunctionParams);

#if !defined(OS_CHROMEOS)
extern int CloudPrintServiceProcessMain(content::MainFunctionParams);
#endif

const char* const ChromeMainDelegate::kNonWildcardDomainNonPortSchemes[] = {
extensions::kExtensionScheme, chrome::kChromeSearchScheme,
content::kChromeDevToolsScheme, content::kChromeUIScheme,
Expand Down Expand Up @@ -276,8 +272,7 @@ void AdjustLinuxOOMScore(const std::string& process_type) {
if (process_type == switches::kPpapiPluginProcess) {
score = content::kPluginOomScore;
} else if (process_type == switches::kUtilityProcess ||
process_type == switches::kGpuProcess ||
process_type == switches::kCloudPrintServiceProcess) {
process_type == switches::kGpuProcess) {
score = content::kMiscOomScore;
#if BUILDFLAG(ENABLE_NACL)
} else if (process_type == switches::kNaClLoaderProcess) {
Expand Down Expand Up @@ -1212,17 +1207,10 @@ void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) {
absl::variant<int, content::MainFunctionParams> ChromeMainDelegate::RunProcess(
const std::string& process_type,
content::MainFunctionParams main_function_params) {
// ANDROID doesn't support "service", so no CloudPrintServiceProcessMain, and
// arraysize doesn't support empty array. So we comment out the block for
// Android.
#if defined(OS_ANDROID)
NOTREACHED(); // Android provides a subclass and shares no code here.
#else
static const MainFunction kMainFunctions[] = {
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(OS_CHROMEOS)
{switches::kCloudPrintServiceProcess, CloudPrintServiceProcessMain},
#endif

#if defined(OS_MAC)
{switches::kRelauncherProcess, mac_relauncher::internal::RelauncherMain},
#endif
Expand Down
4 changes: 1 addition & 3 deletions chrome/app/main_dll_loader_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,12 @@ int MainDllLoader::Launch(HINSTANCE instance,
// Initialize the sandbox services.
sandbox::SandboxInterfaceInfo sandbox_info = {nullptr};
const bool is_browser = process_type_.empty();
const bool is_cloud_print_service =
process_type_ == switches::kCloudPrintServiceProcess;
// IsUnsandboxedSandboxType() can't be used here because its result can be
// gated behind a feature flag, which are not yet initialized.
const bool is_sandboxed =
sandbox::policy::SandboxTypeFromCommandLine(cmd_line) !=
sandbox::mojom::Sandbox::kNoSandbox;
if (is_browser || is_cloud_print_service || is_sandboxed) {
if (is_browser || is_sandboxed) {
// For child processes that are running as --no-sandbox, don't initialize
// the sandbox info, otherwise they'll be treated as brokers (as if they
// were the browser).
Expand Down
16 changes: 0 additions & 16 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6318,22 +6318,6 @@ static_library("browser") {
"printing/print_dialog_cloud_win.h",
]
}

if (is_mac) {
sources += [ "service_process/service_process_control_mac.mm" ]
}

if (!is_chromeos_ash) {
sources += [
"printing/cloud_print/cloud_print_proxy_service.cc",
"printing/cloud_print/cloud_print_proxy_service.h",
"printing/cloud_print/cloud_print_proxy_service_factory.cc",
"printing/cloud_print/cloud_print_proxy_service_factory.h",
"service_process/service_process_control.cc",
"service_process/service_process_control.h",
]
public_deps += [ "//chrome/common:service_process_mojom" ]
}
} else {
# Partial - only printing support.
sources += [
Expand Down
15 changes: 0 additions & 15 deletions chrome/browser/chrome_browser_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@
#include "printing/backend/win_helper.h"
#endif

#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h"
#endif

#if BUILDFLAG(ENABLE_RLZ)
#include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h"
#include "components/rlz/rlz_tracker.h" // nogncheck crbug.com/1125897
Expand Down Expand Up @@ -1614,16 +1609,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
browser_process_->metrics_service()->LogNeedForCleanShutdown();
#endif // !defined(OS_ANDROID)

#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Create the instance of the cloud print proxy service so that it can launch
// the service process if needed. This is needed because the service process
// might have shutdown because an update was available.
// TODO(torne): this should maybe be done with
// BrowserContextKeyedServiceFactory::ServiceIsCreatedWithBrowserContext()
// instead?
CloudPrintProxyServiceFactory::GetForProfile(profile_);
#endif

// This has to come before the first GetInstance() call. PreBrowserStart()
// seems like a reasonable place to put this, except on Android,
// OfflinePageInfoHandler::Register() below calls GetInstance().
Expand Down
8 changes: 0 additions & 8 deletions chrome/browser/lifetime/browser_shutdown.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@
#include "chrome/browser/background/background_mode_manager.h"
#endif

#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/service_process/service_process_control.h"
#endif

#if BUILDFLAG(ENABLE_RLZ)
#include "components/rlz/rlz_tracker.h" // nogncheck crbug.com/1125897
#endif
Expand Down Expand Up @@ -176,10 +172,6 @@ bool ShutdownPreThreadsStop() {
ash::BootTimesRecorder::Get()->AddLogoutTimeMarker("BrowserShutdownStarted",
false);
#endif
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !BUILDFLAG(IS_CHROMEOS_ASH)
// Shutdown the IPC channel to the service processes.
ServiceProcessControl::GetInstance()->Disconnect();
#endif

// WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough
// time to get here. If you have something that *must* happen on end session,
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/printing/cloud_print/DEPS

This file was deleted.

1 change: 0 additions & 1 deletion chrome/browser/printing/cloud_print/DIR_METADATA

This file was deleted.

1 change: 0 additions & 1 deletion chrome/browser/printing/cloud_print/OWNERS

This file was deleted.

224 changes: 0 additions & 224 deletions chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc

This file was deleted.

Loading

0 comments on commit 8306c1e

Please sign in to comment.