From 8e462931052789288601083a13770fe759b3c3c2 Mon Sep 17 00:00:00 2001 From: Tyler Holcombe Date: Wed, 14 Aug 2024 16:06:15 -0700 Subject: [PATCH] Rename methods and variables to be more accurate b/325626249 Change-Id: I30353d0559453a62793e3724c0152d2cadf97e64 --- chrome/updater/configurator.cc | 26 ++++++------- chrome/updater/configurator.h | 14 +++---- chrome/updater/updater_module.cc | 50 ++++++++++++------------- chrome/updater/updater_module.h | 8 ++-- cobalt/h5vcc/h5vcc_updater.cc | 12 +++--- cobalt/h5vcc/h5vcc_updater.h | 4 +- cobalt/h5vcc/h5vcc_updater.idl | 4 +- components/update_client/configurator.h | 8 ++-- 8 files changed, 63 insertions(+), 63 deletions(-) diff --git a/chrome/updater/configurator.cc b/chrome/updater/configurator.cc index 798763726212..70381392fa20 100644 --- a/chrome/updater/configurator.cc +++ b/chrome/updater/configurator.cc @@ -110,8 +110,8 @@ int Configurator::UpdateDelay() const { std::vector Configurator::UpdateUrl() const { #if !defined(COBALT_BUILD_TYPE_GOLD) - if (allow_self_signed_builds_ && !custom_update_server_.empty()) { - return std::vector{GURL(custom_update_server_)}; + if (allow_self_signed_packages_ && !update_server_url_.empty()) { + return std::vector{GURL(update_server_url_)}; } #endif // !defined(COBALT_BUILD_TYPE_GOLD) if (base::CommandLine::ForCurrentProcess()->HasSwitch( @@ -349,23 +349,23 @@ void Configurator::SetUseCompressedUpdates(bool use_compressed_updates) { use_compressed_updates_.store(use_compressed_updates); } -bool Configurator::GetAllowSelfSignedBuilds() const { - return allow_self_signed_builds_.load(); +bool Configurator::GetAllowSelfSignedPackages() const { + return allow_self_signed_packages_.load(); } -void Configurator::SetAllowSelfSignedBuilds(bool allow_self_signed_builds) { - allow_self_signed_builds_.store(allow_self_signed_builds); +void Configurator::SetAllowSelfSignedPackages(bool allow_self_signed_packages) { + allow_self_signed_packages_.store(allow_self_signed_packages); } -std::string Configurator::GetCustomUpdateServer() const { - base::AutoLock auto_lock(const_cast(custom_update_server_lock_)); - return custom_update_server_; +std::string Configurator::GetUpdateServerUrl() const { + base::AutoLock auto_lock(const_cast(update_server_url_lock_)); + return update_server_url_; } -void Configurator::SetCustomUpdateServer(const std::string& custom_update_server) { - LOG(INFO) << "Configurator::SetCustomUpdateServer custom_update_server=" << custom_update_server; - base::AutoLock auto_lock(custom_update_server_lock_); - custom_update_server_ = custom_update_server; +void Configurator::SetUpdateServerUrl(const std::string& update_server_url) { + LOG(INFO) << "Configurator::SetUpdateServerUrl update_server_url=" << update_server_url; + base::AutoLock auto_lock(update_server_url_lock_); + update_server_url_ = update_server_url; } } // namespace updater diff --git a/chrome/updater/configurator.h b/chrome/updater/configurator.h index 72746e7ce02d..f77033bd010e 100644 --- a/chrome/updater/configurator.h +++ b/chrome/updater/configurator.h @@ -95,11 +95,11 @@ class Configurator : public update_client::Configurator { static std::string GetAppGuidHelper(const std::string& updater_channel, const std::string& version); - bool GetAllowSelfSignedBuilds() const override; - void SetAllowSelfSignedBuilds(bool allow_self_signed_builds) override; + bool GetAllowSelfSignedPackages() const override; + void SetAllowSelfSignedPackages(bool allow_self_signed_packages) override; - std::string GetCustomUpdateServer() const override; - void SetCustomUpdateServer(const std::string& custom_update_server) override; + std::string GetUpdateServerUrl() const override; + void SetUpdateServerUrl(const std::string& update_server_url) override; private: friend class base::RefCountedThreadSafe; @@ -121,9 +121,9 @@ class Configurator : public update_client::Configurator { uint64_t min_free_space_bytes_ = 48 * 1024 * 1024; base::Lock min_free_space_bytes_lock_; std::atomic_bool use_compressed_updates_; - std::atomic_bool allow_self_signed_builds_; - std::string custom_update_server_; - base::Lock custom_update_server_lock_; + std::atomic_bool allow_self_signed_packages_; + std::string update_server_url_; + base::Lock update_server_url_lock_; DISALLOW_COPY_AND_ASSIGN(Configurator); }; diff --git a/chrome/updater/updater_module.cc b/chrome/updater/updater_module.cc index d185d2bd5441..1ceb58c44145 100644 --- a/chrome/updater/updater_module.cc +++ b/chrome/updater/updater_module.cc @@ -267,16 +267,16 @@ void UpdaterModule::Update() { } #if defined(COBALT_BUILD_TYPE_GOLD) - bool skipVerifyPublicKeyHash = false; + bool skip_verify_public_key_hash = false; #else // defined(COBALT_BUILD_TYPE_GOLD) - bool skipVerifyPublicKeyHash = GetAllowSelfSignedBuilds(); + bool skip_verify_public_key_hash = GetAllowSelfSignedPackages(); #endif // defined(COBALT_BUILD_TYPE_GOLD) update_client_->Update( app_ids, base::BindOnce( [](base::Version manifest_version, - bool skipVerifyPublicKeyHash, + bool skip_verify_public_key_hash, const std::vector& ids) -> std::vector> { update_client::CrxComponent component; @@ -286,7 +286,7 @@ void UpdaterModule::Update() { component.pk_hash.assign(std::begin(kCobaltPublicKeyHash), std::end(kCobaltPublicKeyHash)); #if !defined(COBALT_BUILD_TYPE_GOLD) - if (skipVerifyPublicKeyHash) { + if (skip_verify_public_key_hash) { component.pk_hash.clear(); } #endif // !defined(COBALT_BUILD_TYPE_GOLD) @@ -294,7 +294,7 @@ void UpdaterModule::Update() { component.crx_format_requirement = crx_file::VerifierFormat::CRX3; return {component}; }, - manifest_version, skipVerifyPublicKeyHash), + manifest_version, skip_verify_public_key_hash), false, base::BindOnce( [](base::OnceClosure closure, update_client::Error error) { @@ -444,54 +444,54 @@ void UpdaterModule::SetUseCompressedUpdates(bool use_compressed_updates) { config->SetUseCompressedUpdates(use_compressed_updates); } -bool UpdaterModule::GetAllowSelfSignedBuilds() const { - LOG(INFO) << "UpdaterModule::GetAllowSelfSignedBuilds"; +bool UpdaterModule::GetAllowSelfSignedPackages() const { + LOG(INFO) << "UpdaterModule::GetAllowSelfSignedPackages"; auto config = updater_configurator_; if (!config) { - LOG(ERROR) << "UpdaterModule::GetAllowSelfSignedBuilds: missing configurator"; + LOG(ERROR) << "UpdaterModule::GetAllowSelfSignedPackages: missing configurator"; return false; } - bool allow_self_signed_builds = config->GetAllowSelfSignedBuilds(); - LOG(INFO) << "UpdaterModule::GetAllowSelfSignedBuilds allow_self_signed_builds=" + bool allow_self_signed_builds = config->GetAllowSelfSignedPackages(); + LOG(INFO) << "UpdaterModule::GetAllowSelfSignedPackages allow_self_signed_builds=" << allow_self_signed_builds; return allow_self_signed_builds; } -void UpdaterModule::SetAllowSelfSignedBuilds(bool allow_self_signed_builds) { - LOG(INFO) << "UpdaterModule::SetAllowSelfSignedBuilds"; +void UpdaterModule::SetAllowSelfSignedPackages(bool allow_self_signed_builds) { + LOG(INFO) << "UpdaterModule::SetAllowSelfSignedPackages"; auto config = updater_configurator_; if (!config) { - LOG(ERROR) << "UpdaterModule::SetAllowSelfSignedBuilds: missing configurator"; + LOG(ERROR) << "UpdaterModule::SetAllowSelfSignedPackages: missing configurator"; return; } - config->SetAllowSelfSignedBuilds(allow_self_signed_builds); + config->SetAllowSelfSignedPackages(allow_self_signed_builds); } -std::string UpdaterModule::GetCustomUpdateServer() const { - LOG(INFO) << "UpdaterModule::GetCustomUpdateServer"; +std::string UpdaterModule::GetUpdateServerUrl() const { + LOG(INFO) << "UpdaterModule::GetUpdateServerUrl"; auto config = updater_configurator_; if (!config) { - LOG(ERROR) << "UpdaterModule::GetCustomUpdateServer: missing configurator"; + LOG(ERROR) << "UpdaterModule::GetUpdateServerUrl: missing configurator"; return ""; } - std::string custom_update_server = config->GetCustomUpdateServer(); - LOG(INFO) << "UpdaterModule::GetCustomUpdateServer custom_update_server=" - << custom_update_server; - return custom_update_server; + std::string update_server_url = config->GetUpdateServerUrl(); + LOG(INFO) << "UpdaterModule::GetUpdateServerUrl update_server_url=" + << update_server_url; + return update_server_url; } -void UpdaterModule::SetCustomUpdateServer(const std::string& custom_update_server) { - LOG(INFO) << "UpdaterModule::SetCustomUpdateServer"; +void UpdaterModule::SetUpdateServerUrl(const std::string& update_server_url) { + LOG(INFO) << "UpdaterModule::SetUpdateServerUrl"; auto config = updater_configurator_; if(!config) { - LOG(ERROR) << "UpdaterModule::SetCustomUpdateServer: missing configurator"; + LOG(ERROR) << "UpdaterModule::SetUpdateServerUrl: missing configurator"; return; } - config->SetCustomUpdateServer(custom_update_server); + config->SetUpdateServerUrl(update_server_url); } } // namespace updater diff --git a/chrome/updater/updater_module.h b/chrome/updater/updater_module.h index 7d2891fa00cc..8b502a15821e 100644 --- a/chrome/updater/updater_module.h +++ b/chrome/updater/updater_module.h @@ -156,11 +156,11 @@ class UpdaterModule { bool GetUseCompressedUpdates() const; void SetUseCompressedUpdates(bool use_compressed_updates); - bool GetAllowSelfSignedBuilds() const; - void SetAllowSelfSignedBuilds(bool allow_self_signed_builds); + bool GetAllowSelfSignedPackages() const; + void SetAllowSelfSignedPackages(bool allow_self_signed_packages); - std::string GetCustomUpdateServer() const; - void SetCustomUpdateServer(const std::string& custom_update_server); + std::string GetUpdateServerUrl() const; + void SetUpdateServerUrl(const std::string& update_server_url); void MarkSuccessful(); diff --git a/cobalt/h5vcc/h5vcc_updater.cc b/cobalt/h5vcc/h5vcc_updater.cc index 8972c8e982d9..dd1dd31b5d44 100644 --- a/cobalt/h5vcc/h5vcc_updater.cc +++ b/cobalt/h5vcc/h5vcc_updater.cc @@ -91,17 +91,17 @@ void H5vccUpdater::SetUseCompressedUpdates(bool use_compressed_updates) { return updater_module_->SetUseCompressedUpdates(use_compressed_updates); } -void H5vccUpdater::SetAllowSelfSignedBuilds(bool allow_self_signed_builds) { +void H5vccUpdater::SetAllowSelfSignedPackages(bool allow_self_signed_packages) { #if !defined(COBALT_BUILD_TYPE_GOLD) if (updater_module_) { - updater_module_->SetAllowSelfSignedBuilds(allow_self_signed_builds); + updater_module_->SetAllowSelfSignedPackages(allow_self_signed_packages); } #endif // !defined(COBALT_BUILD_TYPE_GOLD) } -bool H5vccUpdater::GetAllowSelfSignedBuilds() { +bool H5vccUpdater::GetAllowSelfSignedPackages() { if (updater_module_) { - return updater_module_->GetAllowSelfSignedBuilds(); + return updater_module_->GetAllowSelfSignedPackages(); } return false; @@ -110,14 +110,14 @@ bool H5vccUpdater::GetAllowSelfSignedBuilds() { void H5vccUpdater::SetUpdateServerUrl(const std::string& update_server_url) { #if !defined(COBALT_BUILD_TYPE_GOLD) if (updater_module_) { - updater_module_->SetCustomUpdateServer(update_server_url); + updater_module_->SetUpdateServerUrl(update_server_url); } #endif // !defined(COBALT_BUILD_TYPE_GOLD) } std::string H5vccUpdater::GetUpdateServerUrl() const { if (updater_module_) { - return updater_module_->GetCustomUpdateServer(); + return updater_module_->GetUpdateServerUrl(); } return ""; diff --git a/cobalt/h5vcc/h5vcc_updater.h b/cobalt/h5vcc/h5vcc_updater.h index 5af48c3a5d4d..f2f06da3e157 100644 --- a/cobalt/h5vcc/h5vcc_updater.h +++ b/cobalt/h5vcc/h5vcc_updater.h @@ -51,8 +51,8 @@ class H5vccUpdater : public script::Wrappable { bool GetUseCompressedUpdates() const; void SetUseCompressedUpdates(bool use_compressed_updates); - void SetAllowSelfSignedBuilds(bool allow_self_signed_builds); - bool GetAllowSelfSignedBuilds(); + void SetAllowSelfSignedPackages(bool allow_self_signed_packages); + bool GetAllowSelfSignedPackages(); void SetUpdateServerUrl(const std::string& update_server_url); std::string GetUpdateServerUrl() const; diff --git a/cobalt/h5vcc/h5vcc_updater.idl b/cobalt/h5vcc/h5vcc_updater.idl index 74236444b162..ecfbff669a41 100644 --- a/cobalt/h5vcc/h5vcc_updater.idl +++ b/cobalt/h5vcc/h5vcc_updater.idl @@ -37,8 +37,8 @@ interface H5vccUpdater { // Toggles the ability to load self-signed builds in the updater. This should // only be used for testing and should not be available in production. - void setAllowSelfSignedBuilds(boolean allow_self_signed_builds); - boolean getAllowSelfSignedBuilds(); + void setAllowSelfSignedPackages(boolean allow_self_signed_packages); + boolean getAllowSelfSignedPackages(); // Sets the URL the updater will use for updates. This should only be used for // testing and should not be available in production. diff --git a/components/update_client/configurator.h b/components/update_client/configurator.h index c7a67df7840a..9fadd8ad259e 100644 --- a/components/update_client/configurator.h +++ b/components/update_client/configurator.h @@ -186,11 +186,11 @@ class Configurator : public base::RefCountedThreadSafe { virtual bool GetUseCompressedUpdates() const = 0; virtual void SetUseCompressedUpdates(bool use_compressed_updates) = 0; - virtual bool GetAllowSelfSignedBuilds() const = 0; - virtual void SetAllowSelfSignedBuilds(bool allow_self_signed_builds) = 0; + virtual bool GetAllowSelfSignedPackages() const = 0; + virtual void SetAllowSelfSignedPackages(bool allow_self_signed_packages) = 0; - virtual std::string GetCustomUpdateServer() const = 0; - virtual void SetCustomUpdateServer(const std::string& custom_update_server) = 0; + virtual std::string GetUpdateServerUrl() const = 0; + virtual void SetUpdateServerUrl(const std::string& update_server_url) = 0; #endif protected: