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

Side by Side 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 unified diff | Download patch
OLDNEW
(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_SENSOR_PLATFORM_SENSOR_MAC_H_
6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_MAC_H_
7
8 #include "base/timer/timer.h"
9 #include "device/generic_sensor/platform_sensor.h"
10
11 namespace base {
12 class SingleThreadTaskRunner;
13 }
14
15 namespace device {
16
17 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
18 public:
19 PlatformSensorMac(
20 mojom::SensorType type,
21 mojo::ScopedSharedBufferMapping mapping,
22 PlatformSensorProvider* provider,
23 scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner);
24 bool StartSensor(const PlatformSensorConfiguration& configuration) override;
Mikhail 2016/09/19 06:25:18 can all these methods be protected (as accessed ei
25 void StopSensor() override;
26
27 virtual void UpdateReading() = 0;
28
29 protected:
30 ~PlatformSensorMac() override;
31 scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner_;
32 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
33 std::unique_ptr<base::RepeatingTimer> timer_;
Mikhail 2016/09/19 06:25:18 base::RepeatingTimer timer_; // like in example fr
34
35 private:
36 void BeginPoll(const PlatformSensorConfiguration& configuration);
37 void StopPoll();
38
39 DISALLOW_COPY_AND_ASSIGN(PlatformSensorMac);
40 };
41
42 } // namespace device
43
44 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698