OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/component_updater/configurator_impl.h" | 5 #include "components/component_updater/configurator_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 background_downloads_enabled_(false), | 102 background_downloads_enabled_(false), |
103 fallback_to_alt_source_url_enabled_(false) { | 103 fallback_to_alt_source_url_enabled_(false) { |
104 // Parse comma-delimited debug flags. | 104 // Parse comma-delimited debug flags. |
105 std::vector<std::string> switch_values = base::SplitString( | 105 std::vector<std::string> switch_values = base::SplitString( |
106 cmdline->GetSwitchValueASCII(switches::kComponentUpdater), ",", | 106 cmdline->GetSwitchValueASCII(switches::kComponentUpdater), ",", |
107 base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); | 107 base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
108 fast_update_ = HasSwitchValue(switch_values, kSwitchFastUpdate); | 108 fast_update_ = HasSwitchValue(switch_values, kSwitchFastUpdate); |
109 pings_enabled_ = !HasSwitchValue(switch_values, kSwitchDisablePings); | 109 pings_enabled_ = !HasSwitchValue(switch_values, kSwitchDisablePings); |
110 deltas_enabled_ = !HasSwitchValue(switch_values, kSwitchDisableDeltaUpdates); | 110 deltas_enabled_ = !HasSwitchValue(switch_values, kSwitchDisableDeltaUpdates); |
111 | 111 |
112 #if defined(OS_WIN) | 112 // Disable BITS on all platforms in all cases until crbug.com/475872 is |
113 background_downloads_enabled_ = | 113 // resolved. |
114 !HasSwitchValue(switch_values, kSwitchDisableBackgroundDownloads); | |
115 #else | |
116 background_downloads_enabled_ = false; | 114 background_downloads_enabled_ = false; |
117 #endif | |
118 | 115 |
119 const std::string switch_url_source = | 116 const std::string switch_url_source = |
120 GetSwitchArgument(switch_values, kSwitchUrlSource); | 117 GetSwitchArgument(switch_values, kSwitchUrlSource); |
121 if (!switch_url_source.empty()) { | 118 if (!switch_url_source.empty()) { |
122 url_source_override_ = GURL(switch_url_source); | 119 url_source_override_ = GURL(switch_url_source); |
123 DCHECK(url_source_override_.is_valid()); | 120 DCHECK(url_source_override_.is_valid()); |
124 } | 121 } |
125 | 122 |
126 if (HasSwitchValue(switch_values, kSwitchRequestParam)) | 123 if (HasSwitchValue(switch_values, kSwitchRequestParam)) |
127 extra_info_ += "testrequest=\"1\""; | 124 extra_info_ += "testrequest=\"1\""; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 187 |
191 bool ConfiguratorImpl::UseBackgroundDownloader() const { | 188 bool ConfiguratorImpl::UseBackgroundDownloader() const { |
192 return background_downloads_enabled_; | 189 return background_downloads_enabled_; |
193 } | 190 } |
194 | 191 |
195 void ConfiguratorImpl::set_enable_alt_source_url(bool enable_alt_source_url) { | 192 void ConfiguratorImpl::set_enable_alt_source_url(bool enable_alt_source_url) { |
196 fallback_to_alt_source_url_enabled_ = enable_alt_source_url; | 193 fallback_to_alt_source_url_enabled_ = enable_alt_source_url; |
197 } | 194 } |
198 | 195 |
199 } // namespace component_updater | 196 } // namespace component_updater |
OLD | NEW |