| 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 Document; |  | 
| 14 class SensorProxy; |  | 
| 15 |  | 
| 16 // This class encapsulates sensor reading update notification logic. |  | 
| 17 class SensorReadingUpdater : public GarbageCollected<SensorReadingUpdater> { |  | 
| 18  public: |  | 
| 19   static SensorReadingUpdater* Create(SensorProxy*, |  | 
| 20                                       device::mojom::blink::ReportingMode); |  | 
| 21 |  | 
| 22   virtual void Start(); |  | 
| 23 |  | 
| 24   DECLARE_VIRTUAL_TRACE(); |  | 
| 25 |  | 
| 26  protected: |  | 
| 27   explicit SensorReadingUpdater(SensorProxy*); |  | 
| 28   void EnqueueAnimationFrameTask(); |  | 
| 29   virtual void OnAnimationFrameInternal() = 0; |  | 
| 30 |  | 
| 31   Member<SensorProxy> sensor_proxy_; |  | 
| 32   WeakMember<Document> document_; |  | 
| 33   bool has_pending_animation_frame_task_; |  | 
| 34 |  | 
| 35  private: |  | 
| 36   void OnAnimationFrame(); |  | 
| 37 }; |  | 
| 38 |  | 
| 39 }  // namespace blink |  | 
| 40 |  | 
| 41 #endif  // SensorReadingUpdater_h |  | 
| OLD | NEW | 
|---|