| 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/update_client/update_client.h" | 5 #include "components/update_client/update_client.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 180 } |
| 181 | 181 |
| 182 void UpdateClientImpl::RemoveObserver(Observer* observer) { | 182 void UpdateClientImpl::RemoveObserver(Observer* observer) { |
| 183 DCHECK(thread_checker_.CalledOnValidThread()); | 183 DCHECK(thread_checker_.CalledOnValidThread()); |
| 184 observer_list_.RemoveObserver(observer); | 184 observer_list_.RemoveObserver(observer); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void UpdateClientImpl::NotifyObservers(Observer::Events event, | 187 void UpdateClientImpl::NotifyObservers(Observer::Events event, |
| 188 const std::string& id) { | 188 const std::string& id) { |
| 189 DCHECK(thread_checker_.CalledOnValidThread()); | 189 DCHECK(thread_checker_.CalledOnValidThread()); |
| 190 FOR_EACH_OBSERVER(Observer, observer_list_, OnEvent(event, id)); | 190 for (auto& observer : observer_list_) |
| 191 observer.OnEvent(event, id); |
| 191 } | 192 } |
| 192 | 193 |
| 193 bool UpdateClientImpl::GetCrxUpdateState(const std::string& id, | 194 bool UpdateClientImpl::GetCrxUpdateState(const std::string& id, |
| 194 CrxUpdateItem* update_item) const { | 195 CrxUpdateItem* update_item) const { |
| 195 return update_engine_->GetUpdateState(id, update_item); | 196 return update_engine_->GetUpdateState(id, update_item); |
| 196 } | 197 } |
| 197 | 198 |
| 198 bool UpdateClientImpl::IsUpdating(const std::string& id) const { | 199 bool UpdateClientImpl::IsUpdating(const std::string& id) const { |
| 199 DCHECK(thread_checker_.CalledOnValidThread()); | 200 DCHECK(thread_checker_.CalledOnValidThread()); |
| 200 | 201 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 std::unique_ptr<PingManager> ping_manager(new PingManager(config)); | 256 std::unique_ptr<PingManager> ping_manager(new PingManager(config)); |
| 256 return new UpdateClientImpl(config, std::move(ping_manager), | 257 return new UpdateClientImpl(config, std::move(ping_manager), |
| 257 &UpdateChecker::Create, &CrxDownloader::Create); | 258 &UpdateChecker::Create, &CrxDownloader::Create); |
| 258 } | 259 } |
| 259 | 260 |
| 260 void RegisterPrefs(PrefRegistrySimple* registry) { | 261 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 261 PersistedData::RegisterPrefs(registry); | 262 PersistedData::RegisterPrefs(registry); |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace update_client | 265 } // namespace update_client |
| OLD | NEW |