Commit dc61b6ad authored by Sorin Jianu's avatar Sorin Jianu Committed by Commit Bot

Rename --ua to --wake for chrome/updater.

This is a mechanical change to lexically remove references
to --ua and UpdateApps and replace them with --wake and
Wake.

Bug: 1084010
Change-Id: I1c0a8fa33f160f2d769549026725546c75c54854
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209619Reviewed-by: default avatarS. Ganesh <ganesh@chromium.org>
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770381}
parent 06e4b3ca
...@@ -97,8 +97,8 @@ if (is_win || is_mac) { ...@@ -97,8 +97,8 @@ if (is_win || is_mac) {
"app/app.h", "app/app.h",
"app/app_uninstall.cc", "app/app_uninstall.cc",
"app/app_uninstall.h", "app/app_uninstall.h",
"app/app_update_all.cc", "app/app_wake.cc",
"app/app_update_all.h", "app/app_wake.h",
"configurator.cc", "configurator.cc",
"configurator.h", "configurator.h",
"installer.cc", "installer.cc",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/updater/app/app_update_all.h" #include "chrome/updater/app/app_wake.h"
#include <utility> #include <utility>
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
namespace updater { namespace updater {
class AppUpdateAll : public App { class AppWake : public App {
public: public:
AppUpdateAll() = default; AppWake() = default;
private: private:
~AppUpdateAll() override = default; ~AppWake() override = default;
// Overrides for App. // Overrides for App.
void FirstTaskRun() override; void FirstTaskRun() override;
...@@ -31,16 +31,16 @@ class AppUpdateAll : public App { ...@@ -31,16 +31,16 @@ class AppUpdateAll : public App {
scoped_refptr<UpdateService> update_service_; scoped_refptr<UpdateService> update_service_;
}; };
void AppUpdateAll::Initialize() { void AppWake::Initialize() {
config_ = base::MakeRefCounted<Configurator>(); config_ = base::MakeRefCounted<Configurator>();
} }
void AppUpdateAll::Uninitialize() { void AppWake::Uninitialize() {
update_service_->Uninitialize(); update_service_->Uninitialize();
} }
// AppUpdateAll triggers an update of all registered applications. // AppWake triggers an update of all registered applications.
void AppUpdateAll::FirstTaskRun() { void AppWake::FirstTaskRun() {
update_service_ = CreateUpdateService(config_); update_service_ = CreateUpdateService(config_);
update_service_->UpdateAll( update_service_->UpdateAll(
base::BindRepeating([](UpdateService::UpdateState) {}), base::BindRepeating([](UpdateService::UpdateState) {}),
...@@ -50,11 +50,11 @@ void AppUpdateAll::FirstTaskRun() { ...@@ -50,11 +50,11 @@ void AppUpdateAll::FirstTaskRun() {
VLOG(0) << "UpdateAll complete: exit_code = " << exit_code; VLOG(0) << "UpdateAll complete: exit_code = " << exit_code;
std::move(quit).Run(exit_code); std::move(quit).Run(exit_code);
}, },
base::BindOnce(&AppUpdateAll::Shutdown, this))); base::BindOnce(&AppWake::Shutdown, this)));
} }
scoped_refptr<App> AppUpdateAllInstance() { scoped_refptr<App> AppWakeInstance() {
return AppInstance<AppUpdateAll>(); return AppInstance<AppWake>();
} }
} // namespace updater } // namespace updater
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_UPDATER_APP_APP_UPDATE_ALL_H_ #ifndef CHROME_UPDATER_APP_APP_WAKE_H_
#define CHROME_UPDATER_APP_APP_UPDATE_ALL_H_ #define CHROME_UPDATER_APP_APP_WAKE_H_
#include "base/memory/scoped_refptr.h" #include "base/memory/scoped_refptr.h"
...@@ -11,8 +11,8 @@ namespace updater { ...@@ -11,8 +11,8 @@ namespace updater {
class App; class App;
scoped_refptr<App> AppUpdateAllInstance(); scoped_refptr<App> AppWakeInstance();
} // namespace updater } // namespace updater
#endif // CHROME_UPDATER_APP_APP_UPDATE_ALL_H_ #endif // CHROME_UPDATER_APP_APP_WAKE_H_
...@@ -18,7 +18,6 @@ const char kCrashMeSwitch[] = "crash-me"; ...@@ -18,7 +18,6 @@ const char kCrashMeSwitch[] = "crash-me";
const char kCrashHandlerSwitch[] = "crash-handler"; const char kCrashHandlerSwitch[] = "crash-handler";
const char kInstallSwitch[] = "install"; const char kInstallSwitch[] = "install";
const char kUninstallSwitch[] = "uninstall"; const char kUninstallSwitch[] = "uninstall";
const char kUpdateAppsSwitch[] = "ua";
const char kSystemSwitch[] = "system"; const char kSystemSwitch[] = "system";
const char kTestSwitch[] = "test"; const char kTestSwitch[] = "test";
const char kInitDoneNotifierSwitch[] = "init-done-notifier"; const char kInitDoneNotifierSwitch[] = "init-done-notifier";
...@@ -27,9 +26,9 @@ const char kEnableLoggingSwitch[] = "enable-logging"; ...@@ -27,9 +26,9 @@ const char kEnableLoggingSwitch[] = "enable-logging";
const char kLoggingModuleSwitch[] = "vmodule"; const char kLoggingModuleSwitch[] = "vmodule";
const char kSingleProcessSwitch[] = "single-process"; const char kSingleProcessSwitch[] = "single-process";
const char kAppIdSwitch[] = "appid"; const char kAppIdSwitch[] = "appid";
const char kWakeSwitch[] = "wake";
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
const char kWakeSwitch[] = "wake";
const char kPromoteCandidateSwitch[] = "promote-candidate"; const char kPromoteCandidateSwitch[] = "promote-candidate";
const char kUninstallCandidateSwitch[] = "uninstall-candidate"; const char kUninstallCandidateSwitch[] = "uninstall-candidate";
#endif // OS_MACOSX #endif // OS_MACOSX
......
...@@ -60,10 +60,9 @@ extern const char kInstallSwitch[]; ...@@ -60,10 +60,9 @@ extern const char kInstallSwitch[];
// Swaps the current version of the updater with the newly installed one. // Swaps the current version of the updater with the newly installed one.
// Performs clean-up. // Performs clean-up.
extern const char kPromoteCandidateSwitch[]; extern const char kPromoteCandidateSwitch[];
// TODO: crbug 1072061
// This switch should not be shipped. // TODO(crbug 1072061): this switch should not be shipped.
extern const char kUninstallCandidateSwitch[]; extern const char kUninstallCandidateSwitch[];
extern const char kWakeSwitch[];
#endif // OS_MACOSX #endif // OS_MACOSX
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -77,10 +76,9 @@ extern const char kInstallFromOutDir[]; ...@@ -77,10 +76,9 @@ extern const char kInstallFromOutDir[];
// Uninstalls the updater. // Uninstalls the updater.
extern const char kUninstallSwitch[]; extern const char kUninstallSwitch[];
// Updates all apps registered with the updater. // Kicks off the update service. This switch is typically used for by a
// TODO: crbug 1084010 // scheduled to invoke the updater periodically.
// This switch should be removed, as the new design relies on kWakeSwitch. extern const char kWakeSwitch[];
extern const char kUpdateAppsSwitch[];
// The updater needs to operate in the system context. // The updater needs to operate in the system context.
extern const char kSystemSwitch[]; extern const char kSystemSwitch[];
......
...@@ -66,7 +66,7 @@ void Clean() { ...@@ -66,7 +66,7 @@ void Clean() {
// TODO(crbug.com/1062288): Delete the COM server items. // TODO(crbug.com/1062288): Delete the COM server items.
// TODO(crbug.com/1062288): Delete the COM service items. // TODO(crbug.com/1062288): Delete the COM service items.
// TODO(crbug.com/1062288): Delete the COM interfaces. // TODO(crbug.com/1062288): Delete the COM interfaces.
// TODO(crbug.com/1062288): Delete the UpdateApps task. // TODO(crbug.com/1062288): Delete the Wake task.
EXPECT_TRUE(base::DeleteFile(GetProductPath(), true)); EXPECT_TRUE(base::DeleteFile(GetProductPath(), true));
} }
...@@ -76,7 +76,7 @@ void ExpectClean() { ...@@ -76,7 +76,7 @@ void ExpectClean() {
// TODO(crbug.com/1062288): Assert there are no COM server items. // TODO(crbug.com/1062288): Assert there are no COM server items.
// TODO(crbug.com/1062288): Assert there are no COM service items. // TODO(crbug.com/1062288): Assert there are no COM service items.
// TODO(crbug.com/1062288): Assert there are no COM interfaces. // TODO(crbug.com/1062288): Assert there are no COM interfaces.
// TODO(crbug.com/1062288): Assert there are no UpdateApps tasks. // TODO(crbug.com/1062288): Assert there are no Wake tasks.
// Files must not exist on the file system. // Files must not exist on the file system.
...@@ -89,7 +89,7 @@ void ExpectInstalled() { ...@@ -89,7 +89,7 @@ void ExpectInstalled() {
// TODO(crbug.com/1062288): Assert there are COM server items. // TODO(crbug.com/1062288): Assert there are COM server items.
// TODO(crbug.com/1062288): Assert there are COM service items. (Maybe.) // TODO(crbug.com/1062288): Assert there are COM service items. (Maybe.)
// TODO(crbug.com/1062288): Assert there are COM interfaces. // TODO(crbug.com/1062288): Assert there are COM interfaces.
// TODO(crbug.com/1062288): Assert there are UpdateApps tasks. // TODO(crbug.com/1062288): Assert there are Wake tasks.
// Files must exist on the file system. // Files must exist on the file system.
EXPECT_TRUE(base::PathExists(GetProductPath())); EXPECT_TRUE(base::PathExists(GetProductPath()));
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/updater/app/app.h" #include "chrome/updater/app/app.h"
#include "chrome/updater/app/app_uninstall.h" #include "chrome/updater/app/app_uninstall.h"
#include "chrome/updater/app/app_update_all.h" #include "chrome/updater/app/app_wake.h"
#include "chrome/updater/configurator.h" #include "chrome/updater/configurator.h"
#include "chrome/updater/constants.h" #include "chrome/updater/constants.h"
#include "chrome/updater/crash_client.h" #include "chrome/updater/crash_client.h"
...@@ -111,8 +111,8 @@ int HandleUpdaterCommands(const base::CommandLine* command_line) { ...@@ -111,8 +111,8 @@ int HandleUpdaterCommands(const base::CommandLine* command_line) {
if (command_line->HasSwitch(kUninstallSwitch)) if (command_line->HasSwitch(kUninstallSwitch))
return AppUninstallInstance()->Run(); return AppUninstallInstance()->Run();
if (command_line->HasSwitch(kUpdateAppsSwitch)) { if (command_line->HasSwitch(kWakeSwitch)) {
return AppUpdateAllInstance()->Run(); return AppWakeInstance()->Run();
} }
VLOG(1) << "Unknown command line switch."; VLOG(1) << "Unknown command line switch.";
......
...@@ -250,18 +250,18 @@ int Setup(bool is_machine) { ...@@ -250,18 +250,18 @@ int Setup(bool is_machine) {
AddComInterfacesWorkItems(key, product_dir.Append(kUpdaterExe), AddComInterfacesWorkItems(key, product_dir.Append(kUpdaterExe),
install_list.get()); install_list.get());
base::CommandLine run_updater_ua_command(product_dir.Append(kUpdaterExe)); base::CommandLine run_updater_wake_command(product_dir.Append(kUpdaterExe));
run_updater_ua_command.AppendSwitch(kUpdateAppsSwitch); run_updater_wake_command.AppendSwitch(kWakeSwitch);
#if !defined(NDEBUG) #if !defined(NDEBUG)
run_updater_ua_command.AppendSwitch(kEnableLoggingSwitch); run_updater_wake_command.AppendSwitch(kEnableLoggingSwitch);
run_updater_ua_command.AppendSwitchASCII(kLoggingModuleSwitch, run_updater_wake_command.AppendSwitchASCII(kLoggingModuleSwitch,
"*/chrome/updater/*=2"); "*/chrome/updater/*=2");
#endif #endif
if (!install_list->Do() || !RegisterUpdateAppsTask(run_updater_ua_command)) { if (!install_list->Do() || !RegisterWakeTask(run_updater_wake_command)) {
LOG(ERROR) << "Install failed, rolling back..."; LOG(ERROR) << "Install failed, rolling back...";
install_list->Rollback(); install_list->Rollback();
UnregisterUpdateAppsTask(); UnregisterWakeTask();
LOG(ERROR) << "Rollback complete."; LOG(ERROR) << "Rollback complete.";
return -1; return -1;
} }
......
...@@ -30,19 +30,19 @@ constexpr base::char16 kTaskDescription[] = L"Update all applications."; ...@@ -30,19 +30,19 @@ constexpr base::char16 kTaskDescription[] = L"Update all applications.";
} // namespace } // namespace
bool RegisterUpdateAppsTask(const base::CommandLine& run_command) { bool RegisterWakeTask(const base::CommandLine& run_command) {
auto task_scheduler = TaskScheduler::CreateInstance(); auto task_scheduler = TaskScheduler::CreateInstance();
if (!task_scheduler->RegisterTask( if (!task_scheduler->RegisterTask(
kTaskName, kTaskDescription, run_command, kTaskName, kTaskDescription, run_command,
TaskScheduler::TriggerType::TRIGGER_TYPE_HOURLY, true)) { TaskScheduler::TriggerType::TRIGGER_TYPE_HOURLY, true)) {
LOG(ERROR) << "RegisterUpdateAppsTask failed."; LOG(ERROR) << "RegisterWakeTask failed.";
return false; return false;
} }
VLOG(1) << "RegisterUpdateAppsTask succeeded."; VLOG(1) << "RegisterWakeTask succeeded.";
return true; return true;
} }
void UnregisterUpdateAppsTask() { void UnregisterWakeTask() {
auto task_scheduler = TaskScheduler::CreateInstance(); auto task_scheduler = TaskScheduler::CreateInstance();
task_scheduler->DeleteTask(kTaskName); task_scheduler->DeleteTask(kTaskName);
} }
......
...@@ -19,8 +19,8 @@ class FilePath; ...@@ -19,8 +19,8 @@ class FilePath;
namespace updater { namespace updater {
bool RegisterUpdateAppsTask(const base::CommandLine& run_command); bool RegisterWakeTask(const base::CommandLine& run_command);
void UnregisterUpdateAppsTask(); void UnregisterWakeTask();
base::string16 GetComServerClsidRegistryPath(REFCLSID clsid); base::string16 GetComServerClsidRegistryPath(REFCLSID clsid);
base::string16 GetComServiceClsid(); base::string16 GetComServiceClsid();
......
...@@ -81,7 +81,7 @@ int Uninstall(bool is_machine) { ...@@ -81,7 +81,7 @@ int Uninstall(bool is_machine) {
std::make_unique<base::win::ScopedCOMInitializer>( std::make_unique<base::win::ScopedCOMInitializer>(
base::win::ScopedCOMInitializer::kMTA); base::win::ScopedCOMInitializer::kMTA);
updater::UnregisterUpdateAppsTask(); updater::UnregisterWakeTask();
std::unique_ptr<WorkItemList> uninstall_list(WorkItem::CreateWorkItemList()); std::unique_ptr<WorkItemList> uninstall_list(WorkItem::CreateWorkItemList());
uninstall_list->AddDeleteRegKeyWorkItem(key, base::ASCIIToUTF16(UPDATER_KEY), uninstall_list->AddDeleteRegKeyWorkItem(key, base::ASCIIToUTF16(UPDATER_KEY),
......
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