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

Unified Diff: chromeos/network/network_configuration_handler.cc

Issue 2413963002: Replace FOR_EACH_OBSERVER in chromeos/ with range-based for (Closed)
Patch Set: Run the script again with '/mg' 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: chromeos/network/network_configuration_handler.cc
diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc
index cc3210d954eddaabcd1fc531a5e859044032f01f..03bf1fbe0b4f9e8ee0fd5c4ee91c008654b897d2 100644
--- a/chromeos/network/network_configuration_handler.cc
+++ b/chromeos/network/network_configuration_handler.cc
@@ -401,9 +401,10 @@ void NetworkConfigurationHandler::RunCreateNetworkCallback(
DCHECK(!guid.empty());
callback.Run(service_path.value(), guid);
}
- FOR_EACH_OBSERVER(NetworkConfigurationObserver, observers_,
- OnConfigurationCreated(service_path.value(), profile_path,
- *configure_properties, source));
+ for (auto& observer : observers_) {
+ observer.OnConfigurationCreated(service_path.value(), profile_path,
+ *configure_properties, source);
+ }
// This may also get called when CreateConfiguration is used to update an
// existing configuration, so request a service update just in case.
// TODO(pneubeck): Separate 'Create' and 'Update' calls and only trigger
@@ -417,8 +418,8 @@ void NetworkConfigurationHandler::ProfileEntryDeleterCompleted(
NetworkConfigurationObserver::Source source,
bool success) {
if (success) {
- FOR_EACH_OBSERVER(NetworkConfigurationObserver, observers_,
- OnConfigurationRemoved(service_path, guid, source));
+ for (auto& observer : observers_)
+ observer.OnConfigurationRemoved(service_path, guid, source);
}
auto iter = profile_entry_deleters_.find(service_path);
DCHECK(iter != profile_entry_deleters_.end());
@@ -432,9 +433,8 @@ void NetworkConfigurationHandler::SetNetworkProfileCompleted(
const base::Closure& callback) {
if (!callback.is_null())
callback.Run();
- FOR_EACH_OBSERVER(
- NetworkConfigurationObserver, observers_,
- OnConfigurationProfileChanged(service_path, profile_path, source));
+ for (auto& observer : observers_)
+ observer.OnConfigurationProfileChanged(service_path, profile_path, source);
}
void NetworkConfigurationHandler::GetPropertiesCallback(
@@ -488,9 +488,10 @@ void NetworkConfigurationHandler::SetPropertiesSuccessCallback(
if (!network_state)
return; // Network no longer exists, do not notify or request update.
- FOR_EACH_OBSERVER(NetworkConfigurationObserver, observers_,
- OnPropertiesSet(service_path, network_state->guid(),
- *set_properties, source));
+ for (auto& observer : observers_) {
+ observer.OnPropertiesSet(service_path, network_state->guid(),
+ *set_properties, source);
+ }
network_state_handler_->RequestUpdateForNetwork(service_path);
}
« no previous file with comments | « chromeos/network/managed_network_configuration_handler_impl.cc ('k') | chromeos/network/network_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698