| 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_WIN_H_ | 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_WIN_H_ |
| 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_WIN_H_ | 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_WIN_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "device/generic_sensor/platform_sensor.h" | 9 #include "device/generic_sensor/platform_sensor.h" |
| 10 #include "device/generic_sensor/platform_sensor_reader_win.h" | 10 #include "device/generic_sensor/platform_sensor_reader_win.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public: | 27 public: |
| 28 PlatformSensorWin( | 28 PlatformSensorWin( |
| 29 mojom::SensorType type, | 29 mojom::SensorType type, |
| 30 mojo::ScopedSharedBufferMapping mapping, | 30 mojo::ScopedSharedBufferMapping mapping, |
| 31 PlatformSensorProvider* provider, | 31 PlatformSensorProvider* provider, |
| 32 scoped_refptr<base::SingleThreadTaskRunner> sensor_thread_runner, | 32 scoped_refptr<base::SingleThreadTaskRunner> sensor_thread_runner, |
| 33 std::unique_ptr<PlatformSensorReaderWin> sensor_reader); | 33 std::unique_ptr<PlatformSensorReaderWin> sensor_reader); |
| 34 | 34 |
| 35 PlatformSensorConfiguration GetDefaultConfiguration() override; | 35 PlatformSensorConfiguration GetDefaultConfiguration() override; |
| 36 mojom::ReportingMode GetReportingMode() override; | 36 mojom::ReportingMode GetReportingMode() override; |
| 37 double GetMaximumSupportedFrequency() override; |
| 37 | 38 |
| 38 // PlatformSensorReaderWin::Client interface implementation. | 39 // PlatformSensorReaderWin::Client interface implementation. |
| 39 void OnReadingUpdated(const SensorReading& reading) override; | 40 void OnReadingUpdated(const SensorReading& reading) override; |
| 40 void OnSensorError() override; | 41 void OnSensorError() override; |
| 41 | 42 |
| 42 protected: | 43 protected: |
| 43 ~PlatformSensorWin() override; | 44 ~PlatformSensorWin() override; |
| 44 | 45 |
| 45 // PlatformSensor interface implementation. | 46 // PlatformSensor interface implementation. |
| 46 bool StartSensor(const PlatformSensorConfiguration& configuration) override; | 47 bool StartSensor(const PlatformSensorConfiguration& configuration) override; |
| 47 void StopSensor() override; | 48 void StopSensor() override; |
| 48 bool CheckSensorConfiguration( | 49 bool CheckSensorConfiguration( |
| 49 const PlatformSensorConfiguration& configuration) override; | 50 const PlatformSensorConfiguration& configuration) override; |
| 50 | 51 |
| 51 private: | 52 private: |
| 52 scoped_refptr<base::SingleThreadTaskRunner> sensor_thread_runner_; | 53 scoped_refptr<base::SingleThreadTaskRunner> sensor_thread_runner_; |
| 53 PlatformSensorReaderWin* const sensor_reader_; | 54 PlatformSensorReaderWin* const sensor_reader_; |
| 54 base::WeakPtrFactory<PlatformSensorWin> weak_factory_; | 55 base::WeakPtrFactory<PlatformSensorWin> weak_factory_; |
| 55 | 56 |
| 56 DISALLOW_COPY_AND_ASSIGN(PlatformSensorWin); | 57 DISALLOW_COPY_AND_ASSIGN(PlatformSensorWin); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // namespace device | 60 } // namespace device |
| 60 | 61 |
| 61 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_WIN_H_ | 62 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_WIN_H_ |
| OLD | NEW |