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

Unified Diff: device/generic_sensor/platform_sensor_provider_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_provider_mac.h
diff --git a/device/generic_sensor/platform_sensor_provider_mac.h b/device/generic_sensor/platform_sensor_provider_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..5f0ef5aa7150894747ad75179a56ce73c1a1cae6
--- /dev/null
+++ b/device/generic_sensor/platform_sensor_provider_mac.h
@@ -0,0 +1,37 @@
+// 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_PROVIDER_MAC_H_
+#define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_MAC_H_
+
+#include "device/generic_sensor/platform_sensor_provider.h"
+
+namespace device {
+
+class SensorsPollingThreadMac;
+
+class PlatformSensorProviderMac : public PlatformSensorProvider {
+ public:
+ PlatformSensorProviderMac();
+ ~PlatformSensorProviderMac() override;
+
+ static PlatformSensorProviderMac* GetInstance();
+ void BeginPollingSensor(PlatformSensor* sensor,
Mikhail 2016/09/13 09:27:35 this is not smth Provider should do (it's just a f
+ const PlatformSensorConfiguration& configuration);
+ void StopPollingSensor(PlatformSensor* sensor);
+
+ protected:
+ scoped_refptr<PlatformSensor> CreateSensorInternal(
+ mojom::SensorType type,
+ mojo::ScopedSharedBufferMapping mapping,
+ uint64_t buffer_size) override;
+
+ private:
+ std::unique_ptr<SensorsPollingThreadMac> polling_thread_;
+ DISALLOW_COPY_AND_ASSIGN(PlatformSensorProviderMac);
+};
+
+} // namespace device
+
+#endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_PROVIDER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698