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

Side by Side Diff: components/sync/driver/backend_migrator.cc

Issue 2424673002: Remove usage of FOR_EACH_OBSERVER macro in components/sync (Closed)
Patch Set: blank line before return 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync/driver/backend_migrator.h" 5 #include "components/sync/driver/backend_migrator.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const MigrationObserver* observer) const { 74 const MigrationObserver* observer) const {
75 return migration_observers_.HasObserver(observer); 75 return migration_observers_.HasObserver(observer);
76 } 76 }
77 77
78 void BackendMigrator::RemoveMigrationObserver(MigrationObserver* observer) { 78 void BackendMigrator::RemoveMigrationObserver(MigrationObserver* observer) {
79 migration_observers_.RemoveObserver(observer); 79 migration_observers_.RemoveObserver(observer);
80 } 80 }
81 81
82 void BackendMigrator::ChangeState(State new_state) { 82 void BackendMigrator::ChangeState(State new_state) {
83 state_ = new_state; 83 state_ = new_state;
84 FOR_EACH_OBSERVER(MigrationObserver, migration_observers_, 84 for (auto& observer : migration_observers_)
85 OnMigrationStateChange()); 85 observer.OnMigrationStateChange();
86 } 86 }
87 87
88 bool BackendMigrator::TryStart() { 88 bool BackendMigrator::TryStart() {
89 DCHECK_EQ(state_, WAITING_TO_START); 89 DCHECK_EQ(state_, WAITING_TO_START);
90 if (manager_->state() == DataTypeManager::CONFIGURED) { 90 if (manager_->state() == DataTypeManager::CONFIGURED) {
91 RestartMigration(); 91 RestartMigration();
92 return true; 92 return true;
93 } 93 }
94 return false; 94 return false;
95 } 95 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 ModelTypeSet BackendMigrator::GetPendingMigrationTypesForTest() const { 210 ModelTypeSet BackendMigrator::GetPendingMigrationTypesForTest() const {
211 return to_migrate_; 211 return to_migrate_;
212 } 212 }
213 213
214 #undef SDVLOG 214 #undef SDVLOG
215 215
216 #undef SLOG 216 #undef SLOG
217 217
218 }; // namespace syncer 218 }; // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/device_info/device_info_sync_service.cc ('k') | components/sync/driver/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698