Index: device/generic_sensor/platform_sensor_mac.h |
diff --git a/device/generic_sensor/platform_sensor_mac.h b/device/generic_sensor/platform_sensor_mac.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..538b2f6143522109971d001f9dc6f86fb55b5865 |
--- /dev/null |
+++ b/device/generic_sensor/platform_sensor_mac.h |
@@ -0,0 +1,44 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_MAC_H_ |
+#define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_MAC_H_ |
+ |
+#include "base/timer/timer.h" |
+#include "device/generic_sensor/platform_sensor.h" |
+ |
+namespace base { |
+class SingleThreadTaskRunner; |
+} |
+ |
+namespace device { |
+ |
+class PlatformSensorMac : public PlatformSensor { |
Mikhail
2016/09/19 06:25:18
this class actually does not have any deps to Mac,
maksims (do not use this acc)
2016/09/20 09:51:35
Ouch, I've just noticed this. Yes, right. I have a
|
+ public: |
+ PlatformSensorMac( |
+ mojom::SensorType type, |
+ mojo::ScopedSharedBufferMapping mapping, |
+ PlatformSensorProvider* provider, |
+ scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner); |
+ bool StartSensor(const PlatformSensorConfiguration& configuration) override; |
Mikhail
2016/09/19 06:25:18
can all these methods be protected (as accessed ei
|
+ void StopSensor() override; |
+ |
+ virtual void UpdateReading() = 0; |
+ |
+ protected: |
+ ~PlatformSensorMac() override; |
+ scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner_; |
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
+ std::unique_ptr<base::RepeatingTimer> timer_; |
Mikhail
2016/09/19 06:25:18
base::RepeatingTimer timer_; // like in example fr
|
+ |
+ private: |
+ void BeginPoll(const PlatformSensorConfiguration& configuration); |
+ void StopPoll(); |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PlatformSensorMac); |
+}; |
+ |
+} // namespace device |
+ |
+#endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_MAC_H_ |