Chromium Code Reviews| Index: third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h |
| diff --git a/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h b/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5477e2e120ed756f311713354f986c514f0ca9e0 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/sensor/SensorReadingUpdater.h |
| @@ -0,0 +1,39 @@ |
| +// 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 SensorReadingUpdater_h |
| +#define SensorReadingUpdater_h |
| + |
| +#include "device/generic_sensor/public/interfaces/sensor_provider.mojom-blink.h" |
| +#include "platform/heap/Handle.h" |
| + |
| +namespace blink { |
| + |
| +class SensorProxy; |
| + |
| +// This class encapsulates sensor reading update notification logic. |
| +class SensorReadingUpdater : public GarbageCollected<SensorProxy> { |
| + public: |
| + static SensorReadingUpdater* create(SensorProxy*, |
| + device::mojom::blink::ReportingMode); |
| + |
| + virtual void start(); |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| + protected: |
| + explicit SensorReadingUpdater(SensorProxy*); |
| + void enqueueAnimationFrameTask(); |
| + virtual void handleAnimationFrameTask() = 0; |
|
Reilly Grant (use Gerrit)
2016/12/16 22:09:37
nit: onAnimationFrameInternal
Mikhail
2016/12/19 07:07:56
Done.
|
| + |
| + Member<SensorProxy> m_sensorProxy; |
| + bool m_pendingAnimationFrameTask; |
|
Reilly Grant (use Gerrit)
2016/12/16 22:09:37
nit: m_hasPendingAnimationFrameTask
Mikhail
2016/12/19 07:07:56
Done.
|
| + |
| + private: |
| + void onAnimationFrameTask(); |
|
Reilly Grant (use Gerrit)
2016/12/16 22:09:37
nit: onAnimationFrame
Mikhail
2016/12/19 07:07:56
Done.
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // SensorReadingUpdater_h |