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

Unified Diff: components/proximity_auth/connection.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
« no previous file with comments | « no previous file | components/proximity_auth/cryptauth/cryptauth_device_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/connection.cc
diff --git a/components/proximity_auth/connection.cc b/components/proximity_auth/connection.cc
index 5b61e069acf0b27f9fe5df4a711f44e316f55530..3c7ff2565caf5afcc91f5828ac9bc77830ddafc6 100644
--- a/components/proximity_auth/connection.cc
+++ b/components/proximity_auth/connection.cc
@@ -60,8 +60,8 @@ void Connection::SetStatus(Status status) {
Status old_status = status_;
status_ = status;
- FOR_EACH_OBSERVER(ConnectionObserver, observers_,
- OnConnectionStatusChanged(this, old_status, status_));
+ for (auto& observer : observers_)
+ observer.OnConnectionStatusChanged(this, old_status, status_);
}
void Connection::OnDidSendMessage(const WireMessage& message, bool success) {
@@ -71,8 +71,8 @@ void Connection::OnDidSendMessage(const WireMessage& message, bool success) {
}
is_sending_message_ = false;
- FOR_EACH_OBSERVER(
- ConnectionObserver, observers_, OnSendCompleted(*this, message, success));
+ for (auto& observer : observers_)
+ observer.OnSendCompleted(*this, message, success);
}
void Connection::OnBytesReceived(const std::string& bytes) {
@@ -90,8 +90,8 @@ void Connection::OnBytesReceived(const std::string& bytes) {
return;
if (message) {
- FOR_EACH_OBSERVER(
- ConnectionObserver, observers_, OnMessageReceived(*this, *message));
+ for (auto& observer : observers_)
+ observer.OnMessageReceived(*this, *message);
}
// Whether the message was parsed successfully or not, clear the
« no previous file with comments | « no previous file | components/proximity_auth/cryptauth/cryptauth_device_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698