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/component_updater_service.h" | 5 #include "components/component_updater/component_updater_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
18 #include "base/logging.h" | 18 #include "base/logging.h" |
19 #include "base/macros.h" | 19 #include "base/macros.h" |
20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/ptr_util.h" |
21 #include "base/metrics/histogram_macros.h" | 21 #include "base/metrics/histogram_macros.h" |
22 #include "base/sequenced_task_runner.h" | 22 #include "base/sequenced_task_runner.h" |
23 #include "base/single_thread_task_runner.h" | 23 #include "base/single_thread_task_runner.h" |
24 #include "base/thread_task_runner_handle.h" | 24 #include "base/thread_task_runner_handle.h" |
25 #include "base/threading/sequenced_worker_pool.h" | 25 #include "base/threading/sequenced_worker_pool.h" |
26 #include "base/threading/thread_checker.h" | 26 #include "base/threading/thread_checker.h" |
27 #include "base/time/time.h" | 27 #include "base/time/time.h" |
28 #include "base/timer/timer.h" | 28 #include "base/timer/timer.h" |
29 #include "components/component_updater/component_updater_service_internal.h" | 29 #include "components/component_updater/component_updater_service_internal.h" |
30 #include "components/component_updater/timer.h" | 30 #include "components/component_updater/timer.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 component->fingerprint = update_item.next_fp; | 382 component->fingerprint = update_item.next_fp; |
383 } | 383 } |
384 } | 384 } |
385 } | 385 } |
386 | 386 |
387 /////////////////////////////////////////////////////////////////////////////// | 387 /////////////////////////////////////////////////////////////////////////////// |
388 | 388 |
389 // The component update factory. Using the component updater as a singleton | 389 // The component update factory. Using the component updater as a singleton |
390 // is the job of the browser process. | 390 // is the job of the browser process. |
391 // TODO(sorin): consider making this a singleton. | 391 // TODO(sorin): consider making this a singleton. |
392 scoped_ptr<ComponentUpdateService> ComponentUpdateServiceFactory( | 392 std::unique_ptr<ComponentUpdateService> ComponentUpdateServiceFactory( |
393 const scoped_refptr<Configurator>& config) { | 393 const scoped_refptr<Configurator>& config) { |
394 DCHECK(config); | 394 DCHECK(config); |
395 auto update_client = update_client::UpdateClientFactory(config); | 395 auto update_client = update_client::UpdateClientFactory(config); |
396 return scoped_ptr<ComponentUpdateService>( | 396 return base::WrapUnique( |
397 new CrxUpdateService(config, std::move(update_client))); | 397 new CrxUpdateService(config, std::move(update_client))); |
398 } | 398 } |
399 | 399 |
400 } // namespace component_updater | 400 } // namespace component_updater |
OLD | NEW |