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

Unified Diff: remoting/host/chromoting_host.cc

Issue 2425483002: Remove usage of FOR_EACH_OBSERVER macro in remoting (Closed)
Patch Set: braces 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 | remoting/host/daemon_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index d2c0232e7144616804cedf2bbbf000774462787d..c137d55d2ba337923ff3b32d6cae3aef6cbf7c04 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -94,8 +94,10 @@ ChromotingHost::~ChromotingHost() {
session_manager_.reset();
// Notify observers.
- if (started_)
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_, OnShutdown());
+ if (started_) {
+ for (auto& observer : status_observers_)
+ observer.OnShutdown();
+ }
}
void ChromotingHost::Start(const std::string& host_owner_email) {
@@ -104,8 +106,8 @@ void ChromotingHost::Start(const std::string& host_owner_email) {
HOST_LOG << "Starting host";
started_ = true;
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
- OnStart(host_owner_email));
+ for (auto& observer : status_observers_)
+ observer.OnStart(host_owner_email);
session_manager_->AcceptIncoming(
base::Bind(&ChromotingHost::OnIncomingSession, base::Unretained(this)));
@@ -197,24 +199,24 @@ void ChromotingHost::OnSessionAuthenticated(ClientSession* client) {
// Notify observers that there is at least one authenticated client.
const std::string& jid = client->client_jid();
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
- OnClientAuthenticated(jid));
+ for (auto& observer : status_observers_)
+ observer.OnClientAuthenticated(jid);
}
void ChromotingHost::OnSessionChannelsConnected(ClientSession* client) {
DCHECK(CalledOnValidThread());
// Notify observers.
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
- OnClientConnected(client->client_jid()));
+ for (auto& observer : status_observers_)
+ observer.OnClientConnected(client->client_jid());
}
void ChromotingHost::OnSessionAuthenticationFailed(ClientSession* client) {
DCHECK(CalledOnValidThread());
// Notify observers.
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
- OnAccessDenied(client->client_jid()));
+ for (auto& observer : status_observers_)
+ observer.OnAccessDenied(client->client_jid());
}
void ChromotingHost::OnSessionClosed(ClientSession* client) {
@@ -229,8 +231,8 @@ void ChromotingHost::OnSessionClosed(ClientSession* client) {
delete client;
if (was_authenticated) {
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
- OnClientDisconnected(jid));
+ for (auto& observer : status_observers_)
+ observer.OnClientDisconnected(jid);
}
}
@@ -239,9 +241,8 @@ void ChromotingHost::OnSessionRouteChange(
const std::string& channel_name,
const protocol::TransportRoute& route) {
DCHECK(CalledOnValidThread());
- FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
- OnClientRouteChange(session->client_jid(), channel_name,
- route));
+ for (auto& observer : status_observers_)
+ observer.OnClientRouteChange(session->client_jid(), channel_name, route);
}
void ChromotingHost::OnIncomingSession(
« no previous file with comments | « no previous file | remoting/host/daemon_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698