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

Unified Diff: device/generic_sensor/platform_sensor_polling_mac.h

Issue 2332903002: [sensors] [mac] Implement ambient light sensor for macOS (Closed)
Patch Set: 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_polling_mac.h
diff --git a/device/generic_sensor/platform_sensor_polling_mac.h b/device/generic_sensor/platform_sensor_polling_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..d89c14d0ceb9edd036e7065e8f1aaef8558a1594
--- /dev/null
+++ b/device/generic_sensor/platform_sensor_polling_mac.h
@@ -0,0 +1,33 @@
+// 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_POLLING_MAC_H_
+#define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_POLLING_MAC_H_
Mikhail 2016/09/13 09:27:35 shouldn't file be named as platform_sensor_polling
+
+#include "base/threading/thread.h"
+#include "base/timer/timer.h"
+#include "device/generic_sensor/platform_sensor_mac.h"
+
+namespace device {
+
+class SensorsPollingThreadMac : public base::Thread {
+ public:
+ SensorsPollingThreadMac(const char* name);
+ ~SensorsPollingThreadMac() override;
+
+ void BeginPollingSensor(PlatformSensorMac* sensor,
+ const PlatformSensorConfiguration& configuration);
+ void StopPollingSensor(PlatformSensorMac* sensor);
+
+ private:
+ using SensorsMap =
+ std::map<PlatformSensorMac*, std::unique_ptr<base::RepeatingTimer>>;
Mikhail 2016/09/13 09:27:35 Think it would be better if 'PlatformSensorMac' it
+ SensorsMap sensors_;
+
+ DISALLOW_COPY_AND_ASSIGN(SensorsPollingThreadMac);
+};
+
+} // namespace device
+
+#endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_POLLING_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698