Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_MAC_H_ | |
| 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_MAC_H_ | |
| 7 | |
| 8 #include "base/timer/timer.h" | |
| 9 #include "device/generic_sensor/platform_sensor.h" | |
| 10 | |
| 11 namespace base { | |
| 12 class SingleThreadTaskRunner; | |
| 13 } | |
| 14 | |
| 15 namespace device { | |
| 16 | |
| 17 class PlatformSensorMac : public PlatformSensor { | |
| 18 public: | |
| 19 PlatformSensorMac(mojom::SensorType type, | |
| 20 mojo::ScopedSharedBufferMapping mapping, | |
| 21 PlatformSensorProvider* provider, | |
| 22 const scoped_refptr<base::SingleThreadTaskRunner>& | |
|
Mikhail
2016/09/16 16:23:54
pls pass scoped_refptr by value
| |
| 23 polling_thread_task_runner); | |
| 24 virtual ~PlatformSensorMac(); | |
|
Mikhail
2016/09/16 16:23:54
nit: override
| |
| 25 bool StartSensor(const PlatformSensorConfiguration& configuration) override; | |
| 26 void StopSensor() override; | |
| 27 | |
| 28 virtual void UpdateReading() = 0; | |
| 29 | |
| 30 protected: | |
| 31 scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner_; | |
| 32 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | |
| 33 std::unique_ptr<base::RepeatingTimer> timer_; | |
| 34 | |
| 35 private: | |
| 36 void BeginPoll(const PlatformSensorConfiguration& configuration); | |
| 37 void StopPoll(); | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(PlatformSensorMac); | |
| 40 }; | |
| 41 | |
| 42 } // namespace device | |
| 43 | |
| 44 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_MAC_H_ | |
| OLD | NEW |