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 SensorPollingStrategy_h |
| 6 #define SensorPollingStrategy_h |
| 7 |
| 8 #include "device/sensors/sensor_factory.mojom-blink.h" |
| 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/Functional.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class SensorPollingStrategy : public GarbageCollectedFinalized<SensorPollingStra
tegy> { |
| 15 public: |
| 16 static SensorPollingStrategy* create(double frequencySec, std::unique_ptr<Fu
nction<void()>>, device::sensors::blink::ReportingMode); |
| 17 |
| 18 virtual void onSensorReadingChanged() {} |
| 19 virtual void startPolling() = 0; |
| 20 virtual void stopPolling() = 0; |
| 21 |
| 22 virtual ~SensorPollingStrategy() {} |
| 23 |
| 24 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 25 |
| 26 protected: |
| 27 SensorPollingStrategy(double frequencySec, std::unique_ptr<Function<void()>>
); |
| 28 double m_frequency; |
| 29 std::unique_ptr<Function<void()>> m_pollFunc; |
| 30 }; |
| 31 |
| 32 } // namespace blink |
| 33 |
| 34 #endif // SensorPollingStrategy_h |
OLD | NEW |