Skip to content

Commit

Permalink
Remove unused update_client::Configurator functions.
Browse files Browse the repository at this point in the history
These virtual functions were used by the ActionRunner, which has been
refactored in CL 1929863.

Bug: 1027395
Change-Id: I43091b984fc28555234fdbe11366ea91c225a7b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931383
Commit-Queue: Sorin Jianu <sorin@chromium.org>
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720587}
  • Loading branch information
sorinj authored and Commit Bot committed Dec 2, 2019
1 parent 38ec3da commit e8ceb2f
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"

#include <stdint.h>

#include <memory>
#include <string>
#include <vector>
Expand Down Expand Up @@ -42,7 +40,6 @@

#if defined(OS_WIN)
#include "base/enterprise_util.h"
#include "chrome/install_static/install_util.h"
#include "chrome/installer/util/google_update_settings.h"
#endif

Expand Down Expand Up @@ -81,11 +78,8 @@ class ChromeConfigurator : public update_client::Configurator {
PrefService* GetPrefService() const override;
update_client::ActivityDataService* GetActivityDataService() const override;
bool IsPerUserInstall() const override;
std::vector<uint8_t> GetRunActionKeyHash() const override;
std::string GetAppGuid() const override;
std::unique_ptr<update_client::ProtocolHandlerFactory>
GetProtocolHandlerFactory() const override;
update_client::RecoveryCRXElevator GetRecoveryCRXElevator() const override;

private:
friend class base::RefCountedThreadSafe<ChromeConfigurator>;
Expand Down Expand Up @@ -240,30 +234,11 @@ bool ChromeConfigurator::IsPerUserInstall() const {
return component_updater::IsPerUserInstall();
}

std::vector<uint8_t> ChromeConfigurator::GetRunActionKeyHash() const {
return configurator_impl_.GetRunActionKeyHash();
}

std::string ChromeConfigurator::GetAppGuid() const {
#if defined(OS_WIN)
return install_static::UTF16ToUTF8(install_static::GetAppGuid());
#else
return configurator_impl_.GetAppGuid();
#endif
}

std::unique_ptr<update_client::ProtocolHandlerFactory>
ChromeConfigurator::GetProtocolHandlerFactory() const {
return configurator_impl_.GetProtocolHandlerFactory();
}

// TODO(sorin): remove the members related to elevation, action runners, and
// recovery component. crbug.com/1027395
update_client::RecoveryCRXElevator ChromeConfigurator::GetRecoveryCRXElevator()
const {
return configurator_impl_.GetRecoveryCRXElevator();
}

} // namespace

void RegisterPrefsForChromeComponentUpdaterConfigurator(
Expand Down
13 changes: 0 additions & 13 deletions chrome/browser/extensions/updater/chrome_update_client_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,24 +236,11 @@ bool ChromeUpdateClientConfig::IsPerUserInstall() const {
return component_updater::IsPerUserInstall();
}

std::vector<uint8_t> ChromeUpdateClientConfig::GetRunActionKeyHash() const {
return impl_.GetRunActionKeyHash();
}

std::string ChromeUpdateClientConfig::GetAppGuid() const {
return impl_.GetAppGuid();
}

std::unique_ptr<update_client::ProtocolHandlerFactory>
ChromeUpdateClientConfig::GetProtocolHandlerFactory() const {
return impl_.GetProtocolHandlerFactory();
}

update_client::RecoveryCRXElevator
ChromeUpdateClientConfig::GetRecoveryCRXElevator() const {
return impl_.GetRecoveryCRXElevator();
}

ChromeUpdateClientConfig::~ChromeUpdateClientConfig() {}

// static
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_CHROME_UPDATE_CLIENT_CONFIG_H_
#define CHROME_BROWSER_EXTENSIONS_UPDATER_CHROME_UPDATE_CLIENT_CONFIG_H_

#include <stdint.h>

#include <memory>
#include <string>
#include <vector>
Expand Down Expand Up @@ -65,11 +63,8 @@ class ChromeUpdateClientConfig : public update_client::Configurator {
PrefService* GetPrefService() const override;
update_client::ActivityDataService* GetActivityDataService() const override;
bool IsPerUserInstall() const override;
std::vector<uint8_t> GetRunActionKeyHash() const override;
std::string GetAppGuid() const override;
std::unique_ptr<update_client::ProtocolHandlerFactory>
GetProtocolHandlerFactory() const override;
update_client::RecoveryCRXElevator GetRecoveryCRXElevator() const override;

protected:
friend class base::RefCountedThreadSafe<ChromeUpdateClientConfig>;
Expand Down
13 changes: 0 additions & 13 deletions chrome/updater/configurator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,9 @@ bool Configurator::IsPerUserInstall() const {
return true;
}

std::vector<uint8_t> Configurator::GetRunActionKeyHash() const {
return {};
}

std::string Configurator::GetAppGuid() const {
return {};
}

std::unique_ptr<update_client::ProtocolHandlerFactory>
Configurator::GetProtocolHandlerFactory() const {
return std::make_unique<update_client::ProtocolHandlerFactoryJSON>();
}

update_client::RecoveryCRXElevator Configurator::GetRecoveryCRXElevator()
const {
return {};
}

} // namespace updater
5 changes: 0 additions & 5 deletions chrome/updater/configurator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#ifndef CHROME_UPDATER_CONFIGURATOR_H_
#define CHROME_UPDATER_CONFIGURATOR_H_

#include <stdint.h>

#include <memory>
#include <string>
#include <vector>
Expand Down Expand Up @@ -61,11 +59,8 @@ class Configurator : public update_client::Configurator {
PrefService* GetPrefService() const override;
update_client::ActivityDataService* GetActivityDataService() const override;
bool IsPerUserInstall() const override;
std::vector<uint8_t> GetRunActionKeyHash() const override;
std::string GetAppGuid() const override;
std::unique_ptr<update_client::ProtocolHandlerFactory>
GetProtocolHandlerFactory() const override;
update_client::RecoveryCRXElevator GetRecoveryCRXElevator() const override;

private:
friend class base::RefCountedThreadSafe<Configurator>;
Expand Down
12 changes: 0 additions & 12 deletions components/component_updater/configurator_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ bool ConfiguratorImpl::EnabledCupSigning() const {
return true;
}

std::vector<uint8_t> ConfiguratorImpl::GetRunActionKeyHash() const {
return std::vector<uint8_t>{0x5f, 0x94, 0xe0, 0x3c, 0x64, 0x30, 0x9f, 0xbc,
0xfe, 0x00, 0x9a, 0x27, 0x3e, 0x52, 0xbf, 0xa5,
0x84, 0xb9, 0xb3, 0x75, 0x07, 0x29, 0xde, 0xfa,
0x32, 0x76, 0xd9, 0x93, 0xb5, 0xa3, 0xce, 0x02};
}

// The default implementation for most embedders returns an empty string.
// Desktop embedders, such as the Windows component updater can provide a
// meaningful implementation for this function.
Expand All @@ -140,9 +133,4 @@ ConfiguratorImpl::GetProtocolHandlerFactory() const {
return std::make_unique<update_client::ProtocolHandlerFactoryJSON>();
}

update_client::RecoveryCRXElevator ConfiguratorImpl::GetRecoveryCRXElevator()
const {
return {};
}

} // namespace component_updater
7 changes: 0 additions & 7 deletions components/component_updater/configurator_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#ifndef COMPONENTS_COMPONENT_UPDATER_CONFIGURATOR_IMPL_H_
#define COMPONENTS_COMPONENT_UPDATER_CONFIGURATOR_IMPL_H_

#include <stdint.h>

#include <memory>
#include <string>
#include <vector>
Expand Down Expand Up @@ -85,9 +83,6 @@ class ConfiguratorImpl {
// True if signing of update checks is enabled.
bool EnabledCupSigning() const;

// Returns the key hash corresponding to a CRX trusted by ActionRun.
std::vector<uint8_t> GetRunActionKeyHash() const;

// Returns the app GUID with which Chrome is registered with Google Update, or
// an empty string if this brand does not integrate with Google Update.
std::string GetAppGuid() const;
Expand All @@ -97,8 +92,6 @@ class ConfiguratorImpl {
std::unique_ptr<update_client::ProtocolHandlerFactory>
GetProtocolHandlerFactory() const;

update_client::RecoveryCRXElevator GetRecoveryCRXElevator() const;

private:
base::flat_map<std::string, std::string> extra_info_;
const bool background_downloads_enabled_;
Expand Down
23 changes: 0 additions & 23 deletions components/update_client/configurator.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
#include <tuple>
#include <vector>

#include "base/callback_forward.h"
#include "base/containers/flat_map.h"
#include "base/memory/ref_counted.h"

class GURL;
class PrefService;

namespace base {
class FilePath;
class Version;
}

Expand All @@ -30,12 +28,6 @@ class PatcherFactory;
class ProtocolHandlerFactory;
class UnzipperFactory;

using RecoveryCRXElevator = base::OnceCallback<std::tuple<bool, int, int>(
const base::FilePath& crx_path,
const std::string& browser_appid,
const std::string& browser_version,
const std::string& session_id)>;

// Controls the component updater behavior.
// TODO(sorin): this class will be split soon in two. One class controls
// the behavior of the update client, and the other class controls the
Expand Down Expand Up @@ -146,26 +138,11 @@ class Configurator : public base::RefCountedThreadSafe<Configurator> {
// called only from a blocking pool thread, as it may access the file system.
virtual bool IsPerUserInstall() const = 0;

// Returns the key hash corresponding to a CRX trusted by ActionRun. The
// CRX payloads are signed with this key, and their integrity is verified
// during the unpacking by the action runner. This is a dependency injection
// feature to support testing.
virtual std::vector<uint8_t> GetRunActionKeyHash() const = 0;

// Returns the app GUID with which Chrome is registered with Google Update, or
// an empty string if this brand does not integrate with Google Update.
virtual std::string GetAppGuid() const = 0;

// Returns the class factory to create protocol parser and protocol
// serializer object instances.
virtual std::unique_ptr<ProtocolHandlerFactory> GetProtocolHandlerFactory()
const = 0;

// Returns a callback which can elevate and run the CRX payload associated
// with the improved recovery component. Running this payload repairs the
// Chrome update functionality.
virtual RecoveryCRXElevator GetRecoveryCRXElevator() const = 0;

protected:
friend class base::RefCountedThreadSafe<Configurator>;

Expand Down
16 changes: 0 additions & 16 deletions components/update_client/test_configurator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@ void TestConfigurator::SetPingUrl(const GURL& url) {
ping_url_ = url;
}

void TestConfigurator::SetAppGuid(const std::string& app_guid) {
app_guid_ = app_guid;
}

PrefService* TestConfigurator::GetPrefService() const {
return nullptr;
}
Expand All @@ -198,21 +194,9 @@ bool TestConfigurator::IsPerUserInstall() const {
return true;
}

std::vector<uint8_t> TestConfigurator::GetRunActionKeyHash() const {
return std::vector<uint8_t>(std::begin(gjpm_hash), std::end(gjpm_hash));
}

std::string TestConfigurator::GetAppGuid() const {
return app_guid_;
}

std::unique_ptr<ProtocolHandlerFactory>
TestConfigurator::GetProtocolHandlerFactory() const {
return std::make_unique<ProtocolHandlerFactoryJSON>();
}

RecoveryCRXElevator TestConfigurator::GetRecoveryCRXElevator() const {
return {};
}

} // namespace update_client
5 changes: 0 additions & 5 deletions components/update_client/test_configurator.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,8 @@ class TestConfigurator : public Configurator {
PrefService* GetPrefService() const override;
ActivityDataService* GetActivityDataService() const override;
bool IsPerUserInstall() const override;
std::vector<uint8_t> GetRunActionKeyHash() const override;
std::string GetAppGuid() const override;
std::unique_ptr<ProtocolHandlerFactory> GetProtocolHandlerFactory()
const override;
RecoveryCRXElevator GetRecoveryCRXElevator() const override;

void SetBrand(const std::string& brand);
void SetOnDemandTime(int seconds);
Expand All @@ -110,7 +107,6 @@ class TestConfigurator : public Configurator {
void SetEnabledComponentUpdates(bool enabled_component_updates);
void SetUpdateCheckUrl(const GURL& url);
void SetPingUrl(const GURL& url);
void SetAppGuid(const std::string& app_guid);
network::TestURLLoaderFactory* test_url_loader_factory() {
return &test_url_loader_factory_;
}
Expand All @@ -129,7 +125,6 @@ class TestConfigurator : public Configurator {
bool enabled_component_updates_;
GURL update_check_url_;
GURL ping_url_;
std::string app_guid_;

scoped_refptr<update_client::UnzipChromiumFactory> unzip_factory_;
scoped_refptr<update_client::PatchChromiumFactory> patch_factory_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ class IOSConfigurator : public update_client::Configurator {
PrefService* GetPrefService() const override;
update_client::ActivityDataService* GetActivityDataService() const override;
bool IsPerUserInstall() const override;
std::vector<uint8_t> GetRunActionKeyHash() const override;
std::string GetAppGuid() const override;
std::unique_ptr<update_client::ProtocolHandlerFactory>
GetProtocolHandlerFactory() const override;
update_client::RecoveryCRXElevator GetRecoveryCRXElevator() const override;

private:
friend class base::RefCountedThreadSafe<IOSConfigurator>;
Expand Down Expand Up @@ -206,24 +203,11 @@ bool IOSConfigurator::IsPerUserInstall() const {
return true;
}

std::vector<uint8_t> IOSConfigurator::GetRunActionKeyHash() const {
return configurator_impl_.GetRunActionKeyHash();
}

std::string IOSConfigurator::GetAppGuid() const {
return configurator_impl_.GetAppGuid();
}

std::unique_ptr<update_client::ProtocolHandlerFactory>
IOSConfigurator::GetProtocolHandlerFactory() const {
return configurator_impl_.GetProtocolHandlerFactory();
}

update_client::RecoveryCRXElevator IOSConfigurator::GetRecoveryCRXElevator()
const {
return configurator_impl_.GetRecoveryCRXElevator();
}

} // namespace

scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator(
Expand Down

0 comments on commit e8ceb2f

Please sign in to comment.