| 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 "chrome/browser/component_updater/chrome_component_updater_configurator
.h" | 5 #include "chrome/browser/component_updater/chrome_component_updater_configurator
.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return configurator_impl_.EnabledCupSigning(); | 178 return configurator_impl_.EnabledCupSigning(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 // Returns a task runner to run blocking tasks. The task runner continues to run | 181 // Returns a task runner to run blocking tasks. The task runner continues to run |
| 182 // after the browser shuts down, until the OS terminates the process. This | 182 // after the browser shuts down, until the OS terminates the process. This |
| 183 // imposes certain requirements for the code using the task runner, such as | 183 // imposes certain requirements for the code using the task runner, such as |
| 184 // not accessing any global browser state while the code is running. | 184 // not accessing any global browser state while the code is running. |
| 185 scoped_refptr<base::SequencedTaskRunner> | 185 scoped_refptr<base::SequencedTaskRunner> |
| 186 ChromeConfigurator::GetSequencedTaskRunner() const { | 186 ChromeConfigurator::GetSequencedTaskRunner() const { |
| 187 return base::CreateSequencedTaskRunnerWithTraits( | 187 return base::CreateSequencedTaskRunnerWithTraits( |
| 188 base::TaskTraits() | 188 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 189 .MayBlock() | 189 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); |
| 190 .WithPriority(base::TaskPriority::BACKGROUND) | |
| 191 .WithShutdownBehavior( | |
| 192 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)); | |
| 193 } | 190 } |
| 194 | 191 |
| 195 PrefService* ChromeConfigurator::GetPrefService() const { | 192 PrefService* ChromeConfigurator::GetPrefService() const { |
| 196 DCHECK(pref_service_); | 193 DCHECK(pref_service_); |
| 197 return pref_service_; | 194 return pref_service_; |
| 198 } | 195 } |
| 199 | 196 |
| 200 bool ChromeConfigurator::IsPerUserInstall() const { | 197 bool ChromeConfigurator::IsPerUserInstall() const { |
| 201 return component_updater::IsPerUserInstall(); | 198 return component_updater::IsPerUserInstall(); |
| 202 } | 199 } |
| 203 | 200 |
| 204 } // namespace | 201 } // namespace |
| 205 | 202 |
| 206 void RegisterPrefsForChromeComponentUpdaterConfigurator( | 203 void RegisterPrefsForChromeComponentUpdaterConfigurator( |
| 207 PrefRegistrySimple* registry) { | 204 PrefRegistrySimple* registry) { |
| 208 // The component updates are enabled by default, if the preference is not set. | 205 // The component updates are enabled by default, if the preference is not set. |
| 209 registry->RegisterBooleanPref(prefs::kComponentUpdatesEnabled, true); | 206 registry->RegisterBooleanPref(prefs::kComponentUpdatesEnabled, true); |
| 210 } | 207 } |
| 211 | 208 |
| 212 scoped_refptr<update_client::Configurator> | 209 scoped_refptr<update_client::Configurator> |
| 213 MakeChromeComponentUpdaterConfigurator( | 210 MakeChromeComponentUpdaterConfigurator( |
| 214 const base::CommandLine* cmdline, | 211 const base::CommandLine* cmdline, |
| 215 net::URLRequestContextGetter* context_getter, | 212 net::URLRequestContextGetter* context_getter, |
| 216 PrefService* pref_service) { | 213 PrefService* pref_service) { |
| 217 return new ChromeConfigurator(cmdline, context_getter, pref_service); | 214 return new ChromeConfigurator(cmdline, context_getter, pref_service); |
| 218 } | 215 } |
| 219 | 216 |
| 220 } // namespace component_updater | 217 } // namespace component_updater |
| OLD | NEW |