Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1413)

Side by Side Diff: components/update_client/update_client.cc

Issue 2430823002: Reduce usage of FOR_EACH_OBSERVER macro in components/ (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/undo/undo_manager.cc ('k') | components/user_prefs/tracked/segregated_pref_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/undo/undo_manager.cc ('k') | components/user_prefs/tracked/segregated_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698