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 "components/update_client/update_engine.h" | 5 #include "components/update_client/update_engine.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 UpdateEngine::UpdateEngine( | 51 UpdateEngine::UpdateEngine( |
52 const scoped_refptr<Configurator>& config, | 52 const scoped_refptr<Configurator>& config, |
53 UpdateChecker::Factory update_checker_factory, | 53 UpdateChecker::Factory update_checker_factory, |
54 CrxDownloader::Factory crx_downloader_factory, | 54 CrxDownloader::Factory crx_downloader_factory, |
55 PingManager* ping_manager, | 55 PingManager* ping_manager, |
56 const NotifyObserversCallback& notify_observers_callback) | 56 const NotifyObserversCallback& notify_observers_callback) |
57 : config_(config), | 57 : config_(config), |
58 update_checker_factory_(update_checker_factory), | 58 update_checker_factory_(update_checker_factory), |
59 crx_downloader_factory_(crx_downloader_factory), | 59 crx_downloader_factory_(crx_downloader_factory), |
60 ping_manager_(ping_manager), | 60 ping_manager_(ping_manager), |
61 metadata_(new PersistedData(config->GetPrefService())), | 61 metadata_(config->CreateMetadata()), |
62 notify_observers_callback_(notify_observers_callback) {} | 62 notify_observers_callback_(notify_observers_callback) {} |
63 | 63 |
64 UpdateEngine::~UpdateEngine() { | 64 UpdateEngine::~UpdateEngine() { |
65 DCHECK(thread_checker_.CalledOnValidThread()); | 65 DCHECK(thread_checker_.CalledOnValidThread()); |
66 } | 66 } |
67 | 67 |
68 void UpdateEngine::Update( | 68 void UpdateEngine::Update( |
69 bool is_foreground, | 69 bool is_foreground, |
70 const std::vector<std::string>& ids, | 70 const std::vector<std::string>& ids, |
71 const UpdateClient::CrxDataCallback& crx_data_callback, | 71 const UpdateClient::CrxDataCallback& crx_data_callback, |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 component->Uninstall(version, reason); | 360 component->Uninstall(version, reason); |
361 | 361 |
362 update_context->component_queue.push(id); | 362 update_context->component_queue.push(id); |
363 | 363 |
364 base::ThreadTaskRunnerHandle::Get()->PostTask( | 364 base::ThreadTaskRunnerHandle::Get()->PostTask( |
365 FROM_HERE, | 365 FROM_HERE, |
366 base::Bind(&UpdateEngine::HandleComponent, base::Unretained(this), it)); | 366 base::Bind(&UpdateEngine::HandleComponent, base::Unretained(this), it)); |
367 } | 367 } |
368 | 368 |
369 } // namespace update_client | 369 } // namespace update_client |
OLD | NEW |