| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // Default time constants. | 29 // Default time constants. |
| 30 const int kDelayOneMinute = 60; | 30 const int kDelayOneMinute = 60; |
| 31 const int kDelayOneHour = kDelayOneMinute * 60; | 31 const int kDelayOneHour = kDelayOneMinute * 60; |
| 32 | 32 |
| 33 // Debug values you can pass to --component-updater=value1,value2. Do not | 33 // Debug values you can pass to --component-updater=value1,value2. Do not |
| 34 // use these values in production code. | 34 // use these values in production code. |
| 35 | 35 |
| 36 // Speed up component checking. | 36 // Speed up the initial component checking. |
| 37 const char kSwitchFastUpdate[] = "fast-update"; | 37 const char kSwitchFastUpdate[] = "fast-update"; |
| 38 | 38 |
| 39 // Add "testrequest=1" attribute to the update check request. | 39 // Add "testrequest=1" attribute to the update check request. |
| 40 const char kSwitchRequestParam[] = "test-request"; | 40 const char kSwitchRequestParam[] = "test-request"; |
| 41 | 41 |
| 42 // Disables pings. Pings are the requests sent to the update server that report | 42 // Disables pings. Pings are the requests sent to the update server that report |
| 43 // the success or the failure of component install or update attempts. | 43 // the success or the failure of component install or update attempts. |
| 44 extern const char kSwitchDisablePings[] = "disable-pings"; | 44 extern const char kSwitchDisablePings[] = "disable-pings"; |
| 45 | 45 |
| 46 // Sets the URL for updates. | 46 // Sets the URL for updates. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 extra_info_ += "testrequest=\"1\""; | 119 extra_info_ += "testrequest=\"1\""; |
| 120 } | 120 } |
| 121 | 121 |
| 122 ConfiguratorImpl::~ConfiguratorImpl() {} | 122 ConfiguratorImpl::~ConfiguratorImpl() {} |
| 123 | 123 |
| 124 int ConfiguratorImpl::InitialDelay() const { | 124 int ConfiguratorImpl::InitialDelay() const { |
| 125 return fast_update_ ? 10 : (6 * kDelayOneMinute); | 125 return fast_update_ ? 10 : (6 * kDelayOneMinute); |
| 126 } | 126 } |
| 127 | 127 |
| 128 int ConfiguratorImpl::NextCheckDelay() const { | 128 int ConfiguratorImpl::NextCheckDelay() const { |
| 129 return fast_update_ ? 60 : (6 * kDelayOneHour); | 129 return 6 * kDelayOneHour; |
| 130 } | 130 } |
| 131 | 131 |
| 132 int ConfiguratorImpl::StepDelay() const { | 132 int ConfiguratorImpl::StepDelay() const { |
| 133 return fast_update_ ? 1 : 1; | 133 return fast_update_ ? 1 : 1; |
| 134 } | 134 } |
| 135 | 135 |
| 136 int ConfiguratorImpl::OnDemandDelay() const { | 136 int ConfiguratorImpl::OnDemandDelay() const { |
| 137 return fast_update_ ? 2 : (30 * kDelayOneMinute); | 137 return fast_update_ ? 2 : (30 * kDelayOneMinute); |
| 138 } | 138 } |
| 139 | 139 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 bool ConfiguratorImpl::UseBackgroundDownloader() const { | 187 bool ConfiguratorImpl::UseBackgroundDownloader() const { |
| 188 return background_downloads_enabled_; | 188 return background_downloads_enabled_; |
| 189 } | 189 } |
| 190 | 190 |
| 191 bool ConfiguratorImpl::UseCupSigning() const { | 191 bool ConfiguratorImpl::UseCupSigning() const { |
| 192 return true; | 192 return true; |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace component_updater | 195 } // namespace component_updater |
| OLD | NEW |