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/path_service.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 11 #include "base/threading/sequenced_worker_pool.h" |
11 #include "base/version.h" | 12 #include "base/version.h" |
12 #include "components/component_updater/configurator_impl.h" | 13 #include "components/component_updater/configurator_impl.h" |
13 #include "components/update_client/component_patcher_operation.h" | 14 #include "components/update_client/component_patcher_operation.h" |
14 #include "ios/chrome/browser/application_context.h" | 15 #include "ios/chrome/browser/application_context.h" |
| 16 #include "ios/chrome/browser/chrome_paths.h" |
15 #include "ios/chrome/browser/google/google_brand.h" | 17 #include "ios/chrome/browser/google/google_brand.h" |
16 #include "ios/chrome/common/channel_info.h" | 18 #include "ios/chrome/common/channel_info.h" |
17 #include "ios/web/public/web_thread.h" | 19 #include "ios/web/public/web_thread.h" |
18 | 20 |
19 namespace component_updater { | 21 namespace component_updater { |
20 | 22 |
21 namespace { | 23 namespace { |
22 | 24 |
23 class IOSConfigurator : public update_client::Configurator { | 25 class IOSConfigurator : public update_client::Configurator { |
24 public: | 26 public: |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 147 } |
146 | 148 |
147 scoped_refptr<base::SequencedTaskRunner> | 149 scoped_refptr<base::SequencedTaskRunner> |
148 IOSConfigurator::GetSequencedTaskRunner() const { | 150 IOSConfigurator::GetSequencedTaskRunner() const { |
149 return web::WebThread::GetBlockingPool() | 151 return web::WebThread::GetBlockingPool() |
150 ->GetSequencedTaskRunnerWithShutdownBehavior( | 152 ->GetSequencedTaskRunnerWithShutdownBehavior( |
151 web::WebThread::GetBlockingPool()->GetSequenceToken(), | 153 web::WebThread::GetBlockingPool()->GetSequenceToken(), |
152 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 154 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
153 } | 155 } |
154 | 156 |
| 157 base::FilePath ChromeConfigurator::GetMetadataPath() const { |
| 158 base::FilePath result; |
| 159 CHECK(PathService::Get(chrome::DIR_USER_DATA, &result)); |
| 160 return result.AppendASCII("component_metadata.json"); |
| 161 } |
| 162 |
155 } // namespace | 163 } // namespace |
156 | 164 |
157 scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator( | 165 scoped_refptr<update_client::Configurator> MakeIOSComponentUpdaterConfigurator( |
158 const base::CommandLine* cmdline, | 166 const base::CommandLine* cmdline, |
159 net::URLRequestContextGetter* context_getter) { | 167 net::URLRequestContextGetter* context_getter) { |
160 return new IOSConfigurator(cmdline, context_getter); | 168 return new IOSConfigurator(cmdline, context_getter); |
161 } | 169 } |
162 | 170 |
163 } // namespace component_updater | 171 } // namespace component_updater |
OLD | NEW |