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

Unified Diff: device/generic_sensor/platform_sensor_provider_base.h

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.h
diff --git a/device/generic_sensor/platform_sensor_provider_base.h b/device/generic_sensor/platform_sensor_provider_base.h
index 6244170e86a61c0218f86652393192fdb37c6c8f..91ba9e004a118a4d5c308da54ebde493ea69a01b 100644
--- a/device/generic_sensor/platform_sensor_provider_base.h
+++ b/device/generic_sensor/platform_sensor_provider_base.h
@@ -38,6 +38,10 @@ class PlatformSensorProviderBase : public base::NonThreadSafe {
mojo::ScopedSharedBufferMapping mapping,
const CreateSensorCallback& callback) = 0;
+ // Implementations might override this method to free resources when there
+ // are no sensors left.
+ virtual void AllSensorsRemoved() {}
shalamov 2016/10/20 06:37:26 Can you also add bool HasSensors() const;
+
private:
friend class PlatformSensor; // To call RemoveSensor();
« no previous file with comments | « device/generic_sensor/fake_platform_sensor_provider.cc ('k') | device/generic_sensor/platform_sensor_provider_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698