| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 base::Version GetBrowserVersion() const override; | 45 base::Version GetBrowserVersion() const override; |
| 46 std::string GetChannel() const override; | 46 std::string GetChannel() const override; |
| 47 std::string GetBrand() const override; | 47 std::string GetBrand() const override; |
| 48 std::string GetLang() const override; | 48 std::string GetLang() const override; |
| 49 std::string GetOSLongName() const override; | 49 std::string GetOSLongName() const override; |
| 50 std::string ExtraRequestParams() const override; | 50 std::string ExtraRequestParams() const override; |
| 51 std::string GetDownloadPreference() const override; | 51 std::string GetDownloadPreference() const override; |
| 52 net::URLRequestContextGetter* RequestContext() const override; | 52 net::URLRequestContextGetter* RequestContext() const override; |
| 53 scoped_refptr<update_client::OutOfProcessPatcher> CreateOutOfProcessPatcher() | 53 scoped_refptr<update_client::OutOfProcessPatcher> CreateOutOfProcessPatcher() |
| 54 const override; | 54 const override; |
| 55 bool DeltasEnabled() const override; | 55 bool EnabledDeltas() const override; |
| 56 bool UseBackgroundDownloader() const override; | 56 bool EnabledComponentUpdates() const override; |
| 57 bool UseCupSigning() const override; | 57 bool EnabledBackgroundDownloader() const override; |
| 58 bool EnabledCupSigning() const override; |
| 58 scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() | 59 scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() |
| 59 const override; | 60 const override; |
| 60 PrefService* GetPrefService() const override; | 61 PrefService* GetPrefService() const override; |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 friend class base::RefCountedThreadSafe<ChromeConfigurator>; | 64 friend class base::RefCountedThreadSafe<ChromeConfigurator>; |
| 64 | 65 |
| 65 ConfiguratorImpl configurator_impl_; | 66 ConfiguratorImpl configurator_impl_; |
| 66 | 67 |
| 67 ~ChromeConfigurator() override {} | 68 ~ChromeConfigurator() override {} |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 145 |
| 145 net::URLRequestContextGetter* ChromeConfigurator::RequestContext() const { | 146 net::URLRequestContextGetter* ChromeConfigurator::RequestContext() const { |
| 146 return configurator_impl_.RequestContext(); | 147 return configurator_impl_.RequestContext(); |
| 147 } | 148 } |
| 148 | 149 |
| 149 scoped_refptr<update_client::OutOfProcessPatcher> | 150 scoped_refptr<update_client::OutOfProcessPatcher> |
| 150 ChromeConfigurator::CreateOutOfProcessPatcher() const { | 151 ChromeConfigurator::CreateOutOfProcessPatcher() const { |
| 151 return make_scoped_refptr(new ChromeOutOfProcessPatcher); | 152 return make_scoped_refptr(new ChromeOutOfProcessPatcher); |
| 152 } | 153 } |
| 153 | 154 |
| 154 bool ChromeConfigurator::DeltasEnabled() const { | 155 bool ChromeConfigurator::EnabledDeltas() const { |
| 155 return configurator_impl_.DeltasEnabled(); | 156 return configurator_impl_.EnabledDeltas(); |
| 156 } | 157 } |
| 157 | 158 |
| 158 bool ChromeConfigurator::UseBackgroundDownloader() const { | 159 bool ChromeConfigurator::EnabledComponentUpdates() const { |
| 159 return configurator_impl_.UseBackgroundDownloader(); | 160 return configurator_impl_.EnabledComponentUpdates(); |
| 160 } | 161 } |
| 161 | 162 |
| 162 bool ChromeConfigurator::UseCupSigning() const { | 163 bool ChromeConfigurator::EnabledBackgroundDownloader() const { |
| 163 return configurator_impl_.UseCupSigning(); | 164 return configurator_impl_.EnabledBackgroundDownloader(); |
| 165 } |
| 166 |
| 167 bool ChromeConfigurator::EnabledCupSigning() const { |
| 168 return configurator_impl_.EnabledCupSigning(); |
| 164 } | 169 } |
| 165 | 170 |
| 166 // Returns a task runner to run blocking tasks. The task runner continues to run | 171 // Returns a task runner to run blocking tasks. The task runner continues to run |
| 167 // after the browser shuts down, until the OS terminates the process. This | 172 // after the browser shuts down, until the OS terminates the process. This |
| 168 // imposes certain requirements for the code using the task runner, such as | 173 // imposes certain requirements for the code using the task runner, such as |
| 169 // not accessing any global browser state while the code is running. | 174 // not accessing any global browser state while the code is running. |
| 170 scoped_refptr<base::SequencedTaskRunner> | 175 scoped_refptr<base::SequencedTaskRunner> |
| 171 ChromeConfigurator::GetSequencedTaskRunner() const { | 176 ChromeConfigurator::GetSequencedTaskRunner() const { |
| 172 return content::BrowserThread::GetBlockingPool() | 177 return content::BrowserThread::GetBlockingPool() |
| 173 ->GetSequencedTaskRunnerWithShutdownBehavior( | 178 ->GetSequencedTaskRunnerWithShutdownBehavior( |
| 174 base::SequencedWorkerPool::GetSequenceToken(), | 179 base::SequencedWorkerPool::GetSequenceToken(), |
| 175 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); | 180 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); |
| 176 } | 181 } |
| 177 | 182 |
| 178 PrefService* ChromeConfigurator::GetPrefService() const { | 183 PrefService* ChromeConfigurator::GetPrefService() const { |
| 179 return g_browser_process->local_state(); | 184 return g_browser_process->local_state(); |
| 180 } | 185 } |
| 181 | 186 |
| 182 } // namespace | 187 } // namespace |
| 183 | 188 |
| 184 scoped_refptr<update_client::Configurator> | 189 scoped_refptr<update_client::Configurator> |
| 185 MakeChromeComponentUpdaterConfigurator( | 190 MakeChromeComponentUpdaterConfigurator( |
| 186 const base::CommandLine* cmdline, | 191 const base::CommandLine* cmdline, |
| 187 net::URLRequestContextGetter* context_getter) { | 192 net::URLRequestContextGetter* context_getter) { |
| 188 return new ChromeConfigurator(cmdline, context_getter); | 193 return new ChromeConfigurator(cmdline, context_getter); |
| 189 } | 194 } |
| 190 | 195 |
| 191 } // namespace component_updater | 196 } // namespace component_updater |
| OLD | NEW |