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

Unified Diff: components/proximity_auth/cryptauth/cryptauth_device_manager.cc

Issue 2423353002: 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 side-by-side diff with in-line comments
Download patch
Index: components/proximity_auth/cryptauth/cryptauth_device_manager.cc
diff --git a/components/proximity_auth/cryptauth/cryptauth_device_manager.cc b/components/proximity_auth/cryptauth/cryptauth_device_manager.cc
index c74d52356a7cdb88bb6a3f9bce8e73fa96a74c4c..2d288c074f039f984ee931250cd3ff2fdd3ca7be 100644
--- a/components/proximity_auth/cryptauth/cryptauth_device_manager.cc
+++ b/components/proximity_auth/cryptauth/cryptauth_device_manager.cc
@@ -215,11 +215,12 @@ void CryptAuthDeviceManager::OnGetMyDevicesSuccess(
sync_request_->OnDidComplete(true);
cryptauth_client_.reset();
sync_request_.reset();
- FOR_EACH_OBSERVER(
- Observer, observers_,
- OnSyncFinished(SyncResult::SUCCESS, unlock_keys_changed
- ? DeviceChangeResult::CHANGED
- : DeviceChangeResult::UNCHANGED));
+ for (auto& observer : observers_) {
+ observer.OnSyncFinished(SyncResult::SUCCESS,
+ unlock_keys_changed
+ ? DeviceChangeResult::CHANGED
+ : DeviceChangeResult::UNCHANGED);
+ }
}
void CryptAuthDeviceManager::OnGetMyDevicesFailure(const std::string& error) {
@@ -229,9 +230,8 @@ void CryptAuthDeviceManager::OnGetMyDevicesFailure(const std::string& error) {
sync_request_->OnDidComplete(false);
cryptauth_client_.reset();
sync_request_.reset();
- FOR_EACH_OBSERVER(
- Observer, observers_,
- OnSyncFinished(SyncResult::FAILURE, DeviceChangeResult::UNCHANGED));
+ for (auto& observer : observers_)
+ observer.OnSyncFinished(SyncResult::FAILURE, DeviceChangeResult::UNCHANGED);
}
std::unique_ptr<SyncScheduler> CryptAuthDeviceManager::CreateSyncScheduler() {
@@ -268,7 +268,8 @@ void CryptAuthDeviceManager::UpdateUnlockKeysFromPrefs() {
void CryptAuthDeviceManager::OnSyncRequested(
std::unique_ptr<SyncScheduler::SyncRequest> sync_request) {
- FOR_EACH_OBSERVER(Observer, observers_, OnSyncStarted());
+ for (auto& observer : observers_)
+ observer.OnSyncStarted();
sync_request_ = std::move(sync_request);
cryptauth_client_ = client_factory_->CreateInstance();
« no previous file with comments | « components/proximity_auth/connection.cc ('k') | components/proximity_auth/cryptauth/cryptauth_enrollment_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698