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

Unified Diff: components/component_updater/configurator_impl.cc

Issue 2661113003: Skeleton mechanical impl. for the RecoveryImprovedComponent. (Closed)
Patch Set: . Created 3 years, 11 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 1da87add716765eaa3a4104ea808b6ae15c37246..001594defa50e6da8ab85ffe1166d85d54eb14d0 100644
--- a/components/component_updater/configurator_impl.cc
+++ b/components/component_updater/configurator_impl.cc
@@ -54,6 +54,8 @@ const char kSwitchDisableDeltaUpdates[] = "disable-delta-updates";
const char kSwitchDisableBackgroundDownloads[] = "disable-background-downloads";
#endif // defined(OS_WIN)
+const char kSwitchEnableImprovedRecovery[] = "enable-improved-recovery";
+
// Returns true if and only if |test| is contained in |vec|.
bool HasSwitchValue(const std::vector<std::string>& vec, const char* test) {
if (vec.empty())
@@ -92,7 +94,8 @@ ConfiguratorImpl::ConfiguratorImpl(
pings_enabled_(false),
deltas_enabled_(false),
background_downloads_enabled_(false),
- require_encryption_(require_encryption) {
+ require_encryption_(require_encryption),
+ enabled_improved_recovery_(false) {
// Parse comma-delimited debug flags.
std::vector<std::string> switch_values = base::SplitString(
cmdline->GetSwitchValueASCII(switches::kComponentUpdater), ",",
@@ -100,7 +103,8 @@ ConfiguratorImpl::ConfiguratorImpl(
fast_update_ = HasSwitchValue(switch_values, kSwitchFastUpdate);
pings_enabled_ = !HasSwitchValue(switch_values, kSwitchDisablePings);
deltas_enabled_ = !HasSwitchValue(switch_values, kSwitchDisableDeltaUpdates);
-
+ enabled_improved_recovery_ =
+ HasSwitchValue(switch_values, kSwitchEnableImprovedRecovery);
#if defined(OS_WIN)
background_downloads_enabled_ =
!HasSwitchValue(switch_values, kSwitchDisableBackgroundDownloads);
@@ -196,4 +200,12 @@ bool ConfiguratorImpl::EnabledCupSigning() const {
return true;
}
+bool ConfiguratorImpl::EnabledImprovedRecovery() const {
+#if defined(OS_WIN) || defined(OS_MACOSX)
+ return enabled_improved_recovery_;
+#else
+ return false;
+#endif
+}
+
} // namespace component_updater

Powered by Google App Engine
This is Rietveld 408576698