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

Unified Diff: device/generic_sensor/platform_sensor.cc

Issue 2418653002: Remove usage of base::ObserverList<T>::Iter::GetNext() in //device. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/generic_sensor/platform_sensor.cc
diff --git a/device/generic_sensor/platform_sensor.cc b/device/generic_sensor/platform_sensor.cc
index a9b2604bb3c9b11b705ca0a38ad3a58b8279a99c..ced76bbffdebdc802e3e8de19681dc1375211d33 100644
--- a/device/generic_sensor/platform_sensor.cc
+++ b/device/generic_sensor/platform_sensor.cc
@@ -98,12 +98,9 @@ void PlatformSensor::UpdateSensorReading(const SensorReading& reading,
}
void PlatformSensor::NotifySensorReadingChanged() {
- using ClientsList = decltype(clients_);
- ClientsList::Iterator it(&clients_);
- Client* client;
- while ((client = it.GetNext()) != nullptr) {
- if (!client->IsNotificationSuspended())
- client->OnSensorReadingChanged();
+ for (auto& client : clients_) {
+ if (!client.IsNotificationSuspended())
+ client.OnSensorReadingChanged();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698