Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1058)

Unified Diff: device/generic_sensor/platform_sensor_mac.h

Issue 2332903002: [sensors] [mac] Implement ambient light sensor for macOS (Closed)
Patch Set: More style fixes and build fixes Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698