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 SensorReadingUpdater_h | |
| 6 #define SensorReadingUpdater_h | |
| 7 | |
| 8 #include "device/generic_sensor/public/interfaces/sensor_provider.mojom-blink.h" | |
| 9 #include "platform/heap/Handle.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 class SensorProxy; | |
| 14 | |
| 15 // This class encapsulates sensor reading update notification logic. | |
| 16 class SensorReadingUpdater : public GarbageCollected<SensorProxy> { | |
| 17 public: | |
| 18 static SensorReadingUpdater* create(SensorProxy*, | |
| 19 device::mojom::blink::ReportingMode); | |
| 20 | |
| 21 virtual void start(); | |
| 22 | |
| 23 DECLARE_VIRTUAL_TRACE(); | |
| 24 | |
| 25 protected: | |
| 26 explicit SensorReadingUpdater(SensorProxy*); | |
| 27 void enqueueAnimationFrameTask(); | |
| 28 virtual void handleAnimationFrameTask() = 0; | |
|
Reilly Grant (use Gerrit)
2016/12/16 22:09:37
nit: onAnimationFrameInternal
Mikhail
2016/12/19 07:07:56
Done.
| |
| 29 | |
| 30 Member<SensorProxy> m_sensorProxy; | |
| 31 bool m_pendingAnimationFrameTask; | |
|
Reilly Grant (use Gerrit)
2016/12/16 22:09:37
nit: m_hasPendingAnimationFrameTask
Mikhail
2016/12/19 07:07:56
Done.
| |
| 32 | |
| 33 private: | |
| 34 void onAnimationFrameTask(); | |
|
Reilly Grant (use Gerrit)
2016/12/16 22:09:37
nit: onAnimationFrame
Mikhail
2016/12/19 07:07:56
Done.
| |
| 35 }; | |
| 36 | |
| 37 } // namespace blink | |
| 38 | |
| 39 #endif // SensorReadingUpdater_h | |
| OLD | NEW |