Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: components/component_updater/configurator_impl.cc

Issue 1740333002: Allow fallback from https to http for component update checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8da26fd6f7434392f3314c60a3174769b4673a4e 100644
--- a/components/component_updater/configurator_impl.cc
+++ b/components/component_updater/configurator_impl.cc
@@ -15,7 +15,7 @@
#include "build/build_config.h"
#include "components/component_updater/component_updater_switches.h"
#include "components/component_updater/component_updater_url_constants.h"
-#include "components/update_client/configurator.h"
+#include "components/update_client/utils.h"
#include "components/version_info/version_info.h"
#if defined(OS_WIN)
@@ -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,14 @@ 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_)
+ update_client::RemoveUnsecureUrls(&urls);
+
return urls;
}
« no previous file with comments | « components/component_updater/configurator_impl.h ('k') | components/component_updater/default_component_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698