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_LINUX_H_ | 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_ |
6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_ | 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_ |
7 | 7 |
8 #include "device/generic_sensor/platform_sensor.h" | 8 #include "device/generic_sensor/platform_sensor.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
(...skipping 27 matching lines...) Expand all Loading... |
38 bool StartSensor(const PlatformSensorConfiguration& configuration) override; | 38 bool StartSensor(const PlatformSensorConfiguration& configuration) override; |
39 void StopSensor() override; | 39 void StopSensor() override; |
40 bool CheckSensorConfiguration( | 40 bool CheckSensorConfiguration( |
41 const PlatformSensorConfiguration& configuration) override; | 41 const PlatformSensorConfiguration& configuration) override; |
42 PlatformSensorConfiguration GetDefaultConfiguration() override; | 42 PlatformSensorConfiguration GetDefaultConfiguration() override; |
43 | 43 |
44 private: | 44 private: |
45 const PlatformSensorConfiguration default_configuration_; | 45 const PlatformSensorConfiguration default_configuration_; |
46 const mojom::ReportingMode reporting_mode_; | 46 const mojom::ReportingMode reporting_mode_; |
47 | 47 |
| 48 scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner_; |
| 49 |
48 // A sensor reader that reads values from sensor files | 50 // A sensor reader that reads values from sensor files |
49 // and stores them to a SensorReading structure. | 51 // and stores them to a SensorReading structure. |
50 std::unique_ptr<SensorReader> sensor_reader_; | 52 std::unique_ptr<SensorReader> sensor_reader_; |
51 | 53 |
52 // Stores previously read values that are used to | 54 // Stores previously read values that are used to |
53 // determine whether the recent values are changed | 55 // determine whether the recent values are changed |
54 // and IPC can be notified that updates are available. | 56 // and IPC can be notified that updates are available. |
55 SensorReading old_values_; | 57 SensorReading old_values_; |
56 | 58 |
57 base::WeakPtrFactory<PlatformSensorLinux> weak_factory_; | 59 base::WeakPtrFactory<PlatformSensorLinux> weak_factory_; |
58 | 60 |
59 DISALLOW_COPY_AND_ASSIGN(PlatformSensorLinux); | 61 DISALLOW_COPY_AND_ASSIGN(PlatformSensorLinux); |
60 }; | 62 }; |
61 | 63 |
62 } // namespace device | 64 } // namespace device |
63 | 65 |
64 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_ | 66 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_ |
OLD | NEW |