| Index: components/component_updater/configurator_impl.cc
|
| diff --git a/components/component_updater/configurator_impl.cc b/components/component_updater/configurator_impl.cc
|
| index 6372118180f792fd4d6fe7b7a1b50e6b36b27372..82d6ebae5fc9aa370ffbafed3a62a9792c6a003c 100644
|
| --- a/components/component_updater/configurator_impl.cc
|
| +++ b/components/component_updater/configurator_impl.cc
|
| @@ -82,12 +82,14 @@ std::string GetSwitchArgument(const std::vector<std::string>& vec,
|
|
|
| ConfiguratorImpl::ConfiguratorImpl(
|
| const base::CommandLine* cmdline,
|
| - net::URLRequestContextGetter* url_request_getter)
|
| + net::URLRequestContextGetter* url_request_getter,
|
| + bool require_encryption)
|
| : url_request_getter_(url_request_getter),
|
| fast_update_(false),
|
| pings_enabled_(false),
|
| deltas_enabled_(false),
|
| - background_downloads_enabled_(false) {
|
| + background_downloads_enabled_(false),
|
| + require_encryption_(require_encryption) {
|
| // Parse comma-delimited debug flags.
|
| std::vector<std::string> switch_values = base::SplitString(
|
| cmdline->GetSwitchValueASCII(switches::kComponentUpdater), ",",
|
| @@ -140,9 +142,19 @@ std::vector<GURL> ConfiguratorImpl::UpdateUrl() const {
|
| std::vector<GURL> urls;
|
| if (url_source_override_.is_valid()) {
|
| urls.push_back(GURL(url_source_override_));
|
| - } else {
|
| - urls.push_back(GURL(kUpdaterDefaultUrl));
|
| + return urls;
|
| }
|
| +
|
| + urls.push_back(GURL(kUpdaterDefaultUrl));
|
| + urls.push_back(GURL(kUpdaterFallbackUrl));
|
| + if (require_encryption_) {
|
| + urls.erase(std::remove_if(urls.begin(), urls.end(),
|
| + [](const GURL& url) {
|
| + return !url.SchemeIsCryptographic();
|
| + }),
|
| + urls.end());
|
| + }
|
| +
|
| return urls;
|
| }
|
|
|
|
|