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

Unified Diff: components/sync/test/fake_sync_encryption_handler.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sync/test/fake_server/fake_server.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/test/fake_sync_encryption_handler.cc
diff --git a/components/sync/test/fake_sync_encryption_handler.cc b/components/sync/test/fake_sync_encryption_handler.cc
index c88014cad90ced370cddbcb16b75e840f67544ea..1378c67af155f6565b7d97cc8f4747552be0b8be 100644
--- a/components/sync/test/fake_sync_encryption_handler.cc
+++ b/components/sync/test/fake_sync_encryption_handler.cc
@@ -40,14 +40,15 @@ void FakeSyncEncryptionHandler::ApplyNigoriUpdate(
if (cryptographer_.has_pending_keys()) {
DVLOG(1) << "OnPassPhraseRequired Sent";
sync_pb::EncryptedData pending_keys = cryptographer_.GetPendingKeys();
- FOR_EACH_OBSERVER(SyncEncryptionHandler::Observer, observers_,
- OnPassphraseRequired(REASON_DECRYPTION, pending_keys));
+ for (auto& observer : observers_)
+ observer.OnPassphraseRequired(REASON_DECRYPTION, pending_keys);
} else if (!cryptographer_.is_ready()) {
DVLOG(1) << "OnPassphraseRequired sent because cryptographer is not "
<< "ready";
- FOR_EACH_OBSERVER(
- SyncEncryptionHandler::Observer, observers_,
- OnPassphraseRequired(REASON_ENCRYPTION, sync_pb::EncryptedData()));
+ for (auto& observer : observers_) {
+ observer.OnPassphraseRequired(REASON_ENCRYPTION,
+ sync_pb::EncryptedData());
+ }
}
}
@@ -74,9 +75,9 @@ bool FakeSyncEncryptionHandler::SetKeystoreKeys(
keystore_key_ = new_key;
DVLOG(1) << "Keystore bootstrap token updated.";
- FOR_EACH_OBSERVER(
- SyncEncryptionHandler::Observer, observers_,
- OnBootstrapTokenUpdated(keystore_key_, KEYSTORE_BOOTSTRAP_TOKEN));
+ for (auto& observer : observers_)
+ observer.OnBootstrapTokenUpdated(keystore_key_, KEYSTORE_BOOTSTRAP_TOKEN);
+
return true;
}
@@ -110,9 +111,8 @@ void FakeSyncEncryptionHandler::EnableEncryptEverything() {
return;
encrypt_everything_ = true;
encrypted_types_ = ModelTypeSet::All();
- FOR_EACH_OBSERVER(
- Observer, observers_,
- OnEncryptedTypesChanged(encrypted_types_, encrypt_everything_));
+ for (auto& observer : observers_)
+ observer.OnEncryptedTypesChanged(encrypted_types_, encrypt_everything_);
}
bool FakeSyncEncryptionHandler::IsEncryptEverythingEnabled() const {
« no previous file with comments | « components/sync/test/fake_server/fake_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698