Chromium Code Reviews| Index: device/generic_sensor/platform_sensor_linux.h |
| diff --git a/device/generic_sensor/platform_sensor_linux.h b/device/generic_sensor/platform_sensor_linux.h |
| index ff9b9c1c8d740f53e82b7c74180278839ee4b82a..5d7915d3d072daeea4041829c6cc36c7bf5e1798 100644 |
| --- a/device/generic_sensor/platform_sensor_linux.h |
| +++ b/device/generic_sensor/platform_sensor_linux.h |
| @@ -8,15 +8,13 @@ |
| #include "device/generic_sensor/platform_sensor.h" |
| namespace base { |
| -class RepeatingTimer; |
| class SingleThreadTaskRunner; |
| -class Thread; |
| } |
| namespace device { |
| class SensorReader; |
| -struct SensorDataLinux; |
| +struct SensorInfoLinux; |
| class PlatformSensorLinux : public PlatformSensor { |
| public: |
| @@ -24,13 +22,17 @@ class PlatformSensorLinux : public PlatformSensor { |
| mojom::SensorType type, |
| mojo::ScopedSharedBufferMapping mapping, |
| PlatformSensorProvider* provider, |
| - const SensorDataLinux& data, |
| - std::unique_ptr<SensorReader> sensor_reader, |
| + SensorInfoLinux* sensor_device, |
|
Reilly Grant (use Gerrit)
2016/12/08 02:31:14
This should probably be a const SensorInfoLinux*.
maksims (do not use this acc)
2016/12/08 18:39:17
Done.
|
| scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner); |
| - // Thread safe. |
| mojom::ReportingMode GetReportingMode() override; |
| + // Called by a sensor reader. Takes new readings. |
| + void UpdatePlatformSensorReading(SensorReading reading); |
| + |
| + // Called by a sensor reader if an error occurs. |
| + void NotifyPlatformSensorError(); |
| + |
| protected: |
| ~PlatformSensorLinux() override; |
| bool StartSensor(const PlatformSensorConfiguration& configuration) override; |
| @@ -40,16 +42,6 @@ class PlatformSensorLinux : public PlatformSensor { |
| PlatformSensorConfiguration GetDefaultConfiguration() override; |
| private: |
| - void BeginPoll(const PlatformSensorConfiguration& configuration); |
| - void StopPoll(); |
| - |
| - // Triggers |sensor_reader_| to read new sensor data. |
| - // If new data is read, UpdateSensorReading() is called. |
| - void PollForReadingData(); |
| - |
| - // Owned timer to be deleted on a polling thread. |
| - base::RepeatingTimer* timer_; |
| - |
| const PlatformSensorConfiguration default_configuration_; |
| const mojom::ReportingMode reporting_mode_; |
| @@ -57,9 +49,6 @@ class PlatformSensorLinux : public PlatformSensor { |
| // and stores them to a SensorReading structure. |
| std::unique_ptr<SensorReader> sensor_reader_; |
| - // A task runner that is used to poll sensor data. |
| - scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner_; |
| - |
| // Stores previously read values that are used to |
| // determine whether the recent values are changed |
| // and IPC can be notified that updates are available. |