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

Unified Diff: device/generic_sensor/platform_sensor_provider_base.cc

Issue 2434073002: [sensors] PlatformSensorProvider implementations are notified when there are no sensor instances (Closed)
Patch Set: [sensors] PlatformSensorProvider implementations are notified when there are no sensor instances 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: device/generic_sensor/platform_sensor_provider_base.cc
diff --git a/device/generic_sensor/platform_sensor_provider_base.cc b/device/generic_sensor/platform_sensor_provider_base.cc
index 6dd94dbea5ec819a89d80e849461397219163d3a..ddcaaac88036ed2046ad496c8c82b019cc832565 100644
--- a/device/generic_sensor/platform_sensor_provider_base.cc
+++ b/device/generic_sensor/platform_sensor_provider_base.cc
@@ -79,8 +79,10 @@ void PlatformSensorProviderBase::RemoveSensor(mojom::SensorType type) {
DCHECK(ContainsKey(sensor_map_, type));
sensor_map_.erase(type);
- if (sensor_map_.empty())
+ if (sensor_map_.empty()) {
+ AllSensorsRemoved();
shared_buffer_handle_.reset();
+ }
}
mojo::ScopedSharedBufferHandle

Powered by Google App Engine
This is Rietveld 408576698