| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 virtual mojom::ReportingMode GetReportingMode() = 0; | 41 virtual mojom::ReportingMode GetReportingMode() = 0; |
| 42 virtual PlatformSensorConfiguration GetDefaultConfiguration() = 0; | 42 virtual PlatformSensorConfiguration GetDefaultConfiguration() = 0; |
| 43 | 43 |
| 44 // Can be overriden to return the sensor maximum sampling frequency | 44 // Can be overriden to return the sensor maximum sampling frequency |
| 45 // value obtained from the platform if it is available. If platfrom | 45 // value obtained from the platform if it is available. If platfrom |
| 46 // does not provide maximum sampling frequency this method must | 46 // does not provide maximum sampling frequency this method must |
| 47 // return default frequency. | 47 // return default frequency. |
| 48 // The default implementation returns default frequency. | 48 // The default implementation returns default frequency. |
| 49 virtual double GetMaximumSupportedFrequency(); | 49 virtual double GetMaximumSupportedFrequency(); |
| 50 | 50 |
| 51 // Can be overriden to return the sensor minimum sampling frequency. |
| 52 // The default implementation returns '1.0 / (60 * 60)', i.e. once per hour. |
| 53 virtual double GetMinimumSupportedFrequency(); |
| 54 |
| 51 mojom::SensorType GetType() const; | 55 mojom::SensorType GetType() const; |
| 52 | 56 |
| 53 bool StartListening(Client* client, | 57 bool StartListening(Client* client, |
| 54 const PlatformSensorConfiguration& config); | 58 const PlatformSensorConfiguration& config); |
| 55 bool StopListening(Client* client, const PlatformSensorConfiguration& config); | 59 bool StopListening(Client* client, const PlatformSensorConfiguration& config); |
| 56 | 60 |
| 57 void UpdateSensor(); | 61 void UpdateSensor(); |
| 58 | 62 |
| 59 void AddClient(Client*); | 63 void AddClient(Client*); |
| 60 void RemoveClient(Client*); | 64 void RemoveClient(Client*); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 base::ObserverList<Client, true> clients_; | 101 base::ObserverList<Client, true> clients_; |
| 98 ConfigMap config_map_; | 102 ConfigMap config_map_; |
| 99 PlatformSensorProvider* provider_; | 103 PlatformSensorProvider* provider_; |
| 100 base::WeakPtrFactory<PlatformSensor> weak_factory_; | 104 base::WeakPtrFactory<PlatformSensor> weak_factory_; |
| 101 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); | 105 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); |
| 102 }; | 106 }; |
| 103 | 107 |
| 104 } // namespace device | 108 } // namespace device |
| 105 | 109 |
| 106 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ | 110 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ |
| OLD | NEW |