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_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_MAC_H_ | |
| 6 #define DEVICE_GENERIC_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_MAC_H_ | |
| 7 | |
| 8 #include <IOKit/IOKitLib.h> | |
| 9 | |
| 10 #include "base/mac/scoped_ioobject.h" | |
| 11 #include "device/generic_sensor/platform_sensor.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class SingleThreadTaskRunner; | |
| 15 } | |
| 16 | |
| 17 namespace device { | |
| 18 | |
| 19 class PlatformSensorAmbientLightMac : public PlatformSensor { | |
|
Robert Sesek
2016/10/05 21:00:18
This class should have some documentation. Especia
| |
| 20 public: | |
| 21 PlatformSensorAmbientLightMac( | |
| 22 mojom::SensorType type, | |
| 23 mojo::ScopedSharedBufferMapping mapping, | |
| 24 uint64_t buffer_size, | |
| 25 PlatformSensorProvider* provider, | |
| 26 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | |
| 27 | |
| 28 mojom::ReportingMode GetReportingMode() override; | |
| 29 bool StartSensor(const PlatformSensorConfiguration& configuration) override; | |
| 30 void StopSensor() override; | |
| 31 | |
| 32 protected: | |
| 33 ~PlatformSensorAmbientLightMac() override; | |
| 34 bool CheckSensorConfiguration( | |
| 35 const PlatformSensorConfiguration& configuration) override; | |
| 36 PlatformSensorConfiguration GetDefaultConfiguration() override; | |
| 37 void UpdateReading(uint64_t lux_values[2]); | |
| 38 | |
| 39 private: | |
| 40 static void IOServiceCallback(void* context, | |
| 41 io_service_t service, | |
| 42 natural_t message_type, | |
| 43 void*); | |
|
Robert Sesek
2016/10/05 21:00:18
name here too
| |
| 44 | |
| 45 base::mac::ScopedIOObject<io_service_t> light_sensor_service_; | |
|
Robert Sesek
2016/10/05 21:00:18
And these fields should be documented too.
| |
| 46 IONotificationPortRef light_sensor_port_; | |
| 47 base::mac::ScopedIOObject<io_object_t> light_sensor_object_; | |
| 48 base::mac::ScopedIOObject<io_object_t> light_sensor_notification_; | |
| 49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | |
| 50 double current_lux_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(PlatformSensorAmbientLightMac); | |
| 53 }; | |
| 54 | |
| 55 } // namespace device | |
| 56 | |
| 57 #endif // DEVICE_GENERIC_PLATFORM_SENSOR_AMBIENT_LIGHT_SENSOR_MAC_H_ | |
| OLD | NEW |