| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/component_updater/ios_component_updater_configurato
r.h" | 5 #include "ios/chrome/browser/component_updater/ios_component_updater_configurato
r.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/task_scheduler/post_task.h" |
| 11 #include "base/threading/sequenced_worker_pool.h" | |
| 12 #include "base/version.h" | 11 #include "base/version.h" |
| 13 #include "components/component_updater/configurator_impl.h" | 12 #include "components/component_updater/configurator_impl.h" |
| 14 #include "components/update_client/out_of_process_patcher.h" | 13 #include "components/update_client/out_of_process_patcher.h" |
| 15 #include "components/update_client/update_query_params.h" | 14 #include "components/update_client/update_query_params.h" |
| 16 #include "ios/chrome/browser/application_context.h" | 15 #include "ios/chrome/browser/application_context.h" |
| 17 #include "ios/chrome/browser/google/google_brand.h" | 16 #include "ios/chrome/browser/google/google_brand.h" |
| 18 #include "ios/chrome/common/channel_info.h" | 17 #include "ios/chrome/common/channel_info.h" |
| 19 #include "ios/web/public/web_thread.h" | |
| 20 | 18 |
| 21 namespace component_updater { | 19 namespace component_updater { |
| 22 | 20 |
| 23 namespace { | 21 namespace { |
| 24 | 22 |
| 25 class IOSConfigurator : public update_client::Configurator { | 23 class IOSConfigurator : public update_client::Configurator { |
| 26 public: | 24 public: |
| 27 IOSConfigurator(const base::CommandLine* cmdline, | 25 IOSConfigurator(const base::CommandLine* cmdline, |
| 28 net::URLRequestContextGetter* url_request_getter); | 26 net::URLRequestContextGetter* url_request_getter); |
| 29 | 27 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 bool IOSConfigurator::EnabledBackgroundDownloader() const { | 147 bool IOSConfigurator::EnabledBackgroundDownloader() const { |
| 150 return configurator_impl_.EnabledBackgroundDownloader(); | 148 return configurator_impl_.EnabledBackgroundDownloader(); |
| 151 } | 149 } |
| 152 | 150 |
| 153 bool IOSConfigurator::EnabledCupSigning() const { | 151 bool IOSConfigurator::EnabledCupSigning() const { |
| 154 return configurator_impl_.EnabledCupSigning(); | 152 return configurator_impl_.EnabledCupSigning(); |
| 155 } | 153 } |
| 156 | 154 |
| 157 scoped_refptr<base::SequencedTaskRunner> | 155 scoped_refptr<base::SequencedTaskRunner> |
| 158 IOSConfigurator::GetSequencedTaskRunner() const { | 156 IOSConfigurator::GetSequencedTaskRunner() const { |
| 159 return web::WebThread::GetBlockingPool() | 157 return base::CreateSequencedTaskRunnerWithTraits( |
| 160 ->GetSequencedTaskRunnerWithShutdownBehavior( | 158 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 161 web::WebThread::GetBlockingPool()->GetSequenceToken(), | 159 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); |
| 162 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | |
| 163 } | 160 } |
| 164 | 161 |
| 165 PrefService* IOSConfigurator::GetPrefService() const { | 162 PrefService* IOSConfigurator::GetPrefService() const { |
| 166 return GetApplicationContext()->GetLocalState(); | 163 return GetApplicationContext()->GetLocalState(); |
| 167 } | 164 } |
| 168 | 165 |
| 169 bool IOSConfigurator::IsPerUserInstall() const { | 166 bool IOSConfigurator::IsPerUserInstall() const { |
| 170 return true; | 167 return true; |
| 171 } | 168 } |
| 172 | 169 |
| 173 } // namespace | 170 } // namespace |
| 174 | 171 |
| 175 scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator( | 172 scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator( |
| 176 const base::CommandLine* cmdline, | 173 const base::CommandLine* cmdline, |
| 177 net::URLRequestContextGetter* context_getter) { | 174 net::URLRequestContextGetter* context_getter) { |
| 178 return base::MakeRefCounted<IOSConfigurator>(cmdline, context_getter); | 175 return base::MakeRefCounted<IOSConfigurator>(cmdline, context_getter); |
| 179 } | 176 } |
| 180 | 177 |
| 181 } // namespace component_updater | 178 } // namespace component_updater |
| OLD | NEW |