Commit f2570ac7 authored by Sorin Jianu's avatar Sorin Jianu Committed by Chromium LUCI CQ

Reland "Move installer.cc file to updater/win directory."

This is a reland of e1f49aca

Original change's description:
> Move installer.cc file to updater/win directory.
>
> The installer API code is Windows-specific and it would be desirable
> to isolate //chrome/updater from its implementation details.
>
> This change uses public_deps and visibility to make
> updater:lib and updater/win:lib act as a unit, to resolve the issue
> of the circular includes as suggested by the GN documentation.
>
> Bug: 1014630
>
> Change-Id: Ib47dc9041af08651549d0feaf35790f336dfe193
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2588508
> Commit-Queue: Sorin Jianu <sorin@chromium.org>
> Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#842765}

Bug: 1014630
Change-Id: I84d717aad974254f5daf24547888c8bf880cf9be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2635202Reviewed-by: default avatarJoshua Pawlicki <waffles@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844981}
parent 492b0dcc
......@@ -181,7 +181,6 @@ if (is_win || is_mac) {
"app/server/win/service_main.cc",
"app/server/win/service_main.h",
"external_constants_win.cc",
"installer_win.cc",
"lib_util_win.cc",
"prefs_win.cc",
"service_factory_win.cc",
......@@ -196,7 +195,6 @@ if (is_win || is_mac) {
":version_header",
"//base",
"//base:i18n",
"//chrome/updater/device_management",
"//components/crash/core/common:crash_key",
"//components/crx_file:crx_file",
"//components/prefs",
......@@ -207,13 +205,17 @@ if (is_win || is_mac) {
]
if (is_win) {
# //chrome/updater:lib and //chrome/updater/win:lib behave as one unit
# for linking purposes. Targets depending on the latter must use
# the former as a dependency.
allow_circular_includes_from = [ "//chrome/updater/win:lib" ]
deps += [
"//chrome/updater/app/server/win:updater_idl_idl",
"//chrome/updater/app/server/win:updater_internal_idl_idl",
"//chrome/updater/app/server/win:updater_legacy_idl_idl",
"//chrome/updater/win:constants",
"//chrome/updater/win:lib",
]
public_deps = [ "//chrome/updater/win:lib" ]
}
if (is_mac) {
......@@ -386,7 +388,6 @@ if (is_win || is_mac) {
"//chrome/updater/app/server/win:updater_internal_idl_idl",
"//chrome/updater/app/server/win:updater_legacy_idl_idl",
"//chrome/updater/win:constants",
"//chrome/updater/win:lib",
"//chrome/updater/win:updater_tests",
]
......
......@@ -45,8 +45,8 @@ source_set("device_management") {
if (is_win) {
sources += [ "dm_storage_win.cc" ]
deps += [
"//chrome/updater:lib",
"//chrome/updater/win:constants",
"//chrome/updater/win:lib",
]
}
}
......@@ -81,6 +81,6 @@ source_set("unittest") {
}
if (is_win) {
deps += [ "//chrome/updater/win:lib" ]
deps += [ "//chrome/updater:lib" ]
}
}
......@@ -47,8 +47,6 @@ source_set("constants") {
source_set("app_sources") {
sources = [
"//chrome/updater/app/app.cc",
"//chrome/updater/app/app.h",
"test_app.cc",
"test_app.h",
"update_client.cc",
......@@ -60,22 +58,22 @@ source_set("app_sources") {
":version_header",
"//base",
"//chrome/updater:base",
"//chrome/updater:lib",
"//chrome/updater:version_header",
"//components/update_client:update_client",
]
if (is_mac) {
sources += [
"//chrome/updater/app/server/mac/service_protocol.h",
"//chrome/updater/app/server/mac/service_protocol.mm",
"//chrome/updater/app/server/mac/update_service_wrappers.h",
"//chrome/updater/app/server/mac/update_service_wrappers.mm",
"test_app_mac.mm",
"update_client_mac.h",
"update_client_mac.mm",
]
deps += [ "//chrome/updater/mac:xpc_names" ]
deps += [
"//chrome/updater/app/server/mac:protocol",
"//chrome/updater/mac:xpc_names",
]
frameworks = [ "CoreFoundation.framework" ]
}
......@@ -88,7 +86,7 @@ source_set("app_sources") {
]
deps += [
"//chrome/updater/app/server/win:updater_idl_idl",
"//chrome/updater/win:lib",
"//chrome/updater/win:app_install_controller",
]
}
}
......
......@@ -109,8 +109,9 @@ int HandleUpdaterCommands(const base::CommandLine* command_line) {
#endif // OS_WIN
if (command_line->HasSwitch(kInstallSwitch) ||
command_line->HasSwitch(kTagSwitch))
command_line->HasSwitch(kTagSwitch)) {
return MakeAppInstall()->Run();
}
if (command_line->HasSwitch(kUninstallSwitch))
return MakeAppUninstall()->Run();
......
......@@ -34,7 +34,6 @@ executable("updater") {
deps = [
":app_install_controller",
":lib",
":version_resources",
"//build/win:default_exe_manifest",
"//chrome/updater:lib",
......@@ -74,10 +73,15 @@ source_set("constants") {
}
source_set("lib") {
# This build target and "//chrome/updater:lib" act as a unit. Depending
# targets must use "//chrome/updater:lib" as a dependency.
visibility = [ "//chrome/updater:lib" ]
sources = [
"action_handler.cc",
"group_policy_manager.cc",
"group_policy_manager.h",
"installer.cc",
"net/net_util.cc",
"net/net_util.h",
"net/network.h",
......@@ -153,17 +157,18 @@ source_set("install_progress_observer") {
# compilation units outside the UI itself.
# TODO(sorin): https://crbug.com/1014311
source_set("app_install_controller") {
if (is_win) {
visibility = [ "//chrome/updater/win/*" ]
allow_circular_includes_from = [ "//chrome/updater:lib" ]
visibility = [
"//chrome/updater/test/test_app:app_sources",
"//chrome/updater/win/*",
]
cflags_cc = [ "-Wno-missing-braces" ]
sources = [ "app_install_controller.cc" ]
allow_circular_includes_from = [ "//chrome/updater:lib" ]
deps = [
":install_progress_observer",
":lib",
"//base",
"//base:i18n",
"//chrome/updater:base",
......@@ -171,7 +176,6 @@ source_set("app_install_controller") {
"//chrome/updater:version_header",
"//chrome/updater/win/ui",
]
}
}
source_set("tag_extractor") {
......@@ -208,9 +212,9 @@ source_set("updater_tests") {
deps = [
":app_install_controller",
":constants",
":lib",
":tag_extractor",
"//base/test:test_support",
"//chrome/updater:lib",
"//testing/gtest",
"//url:url",
]
......@@ -241,10 +245,10 @@ test("updater_unittests") {
deps = [
":app_install_controller",
":lib",
"//base",
"//base/test:test_support",
"//chrome/updater:branding_header",
"//chrome/updater:lib",
"//chrome/updater/win/test:test_executables",
"//chrome/updater/win/test:test_strings",
"//testing/gtest",
......
......@@ -26,8 +26,8 @@ source_set("test_common") {
deps = [
"//base",
"//chrome/updater:base",
"//chrome/updater:lib",
"//chrome/updater/win:app_install_controller",
"//chrome/updater/win:lib",
]
}
......
......@@ -41,8 +41,8 @@ source_set("ui") {
"//base:i18n",
"//chrome/updater:base",
"//chrome/updater:branding_header",
"//chrome/updater:lib",
"//chrome/updater/win:install_progress_observer",
"//chrome/updater/win:lib",
"//third_party/wtl",
]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment