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

Side by Side Diff: third_party/WebKit/Source/modules/sensor/SensorUpdateNotificationStrategy.h

Issue 2551223003: [Sensors] Align sensor reading updates and 'onchange' notification with rAF. (Closed)
Patch Set: rebased Created 4 years 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 SensorUpdateNotificationStrategy_h
6 #define SensorUpdateNotificationStrategy_h
7
8 #include "wtf/Functional.h"
9
10 namespace blink {
11
12 // This class encapsulates sensor reading update notification logic:
13 // the callback is invoked after client calls 'onSensorReadingChanged()'
14 // however considering the given sample frequency:
15 // guaranteed not to be called more often than expected.
16 class SensorUpdateNotificationStrategy {
17 public:
18 static std::unique_ptr<SensorUpdateNotificationStrategy> create(
19 double frequency,
20 std::unique_ptr<Function<void()>>);
21
22 virtual void onSensorReadingChanged() = 0;
23 virtual void cancelPendingNotifications() = 0;
24 virtual ~SensorUpdateNotificationStrategy() {}
25 };
26
27 } // namespace blink
28
29 #endif // SensorUpdateNotificationStrategy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698