| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PlatformEventController_h | 5 #ifndef PlatformEventController_h |
| 6 #define PlatformEventController_h | 6 #define PlatformEventController_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/dom/TaskRunnerHelper.h" |
| 9 #include "core/page/PageVisibilityObserver.h" | 10 #include "core/page/PageVisibilityObserver.h" |
| 10 #include "platform/Timer.h" | 11 #include "platform/Timer.h" |
| 11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 | 15 |
| 15 // Base controller class for registering controllers with a dispatcher. | 16 // Base controller class for registering controllers with a dispatcher. |
| 16 // It watches page visibility and calls stopUpdating when page is not visible. | 17 // It watches page visibility and calls stopUpdating when page is not visible. |
| 17 // It provides a didUpdateData() callback method which is called when new data | 18 // It provides a didUpdateData() callback method which is called when new data |
| 18 // it available. | 19 // it available. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 37 | 38 |
| 38 bool m_hasEventListener; | 39 bool m_hasEventListener; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 // Inherited from PageVisibilityObserver. | 42 // Inherited from PageVisibilityObserver. |
| 42 void pageVisibilityChanged() override; | 43 void pageVisibilityChanged() override; |
| 43 | 44 |
| 44 void oneShotCallback(TimerBase*); | 45 void oneShotCallback(TimerBase*); |
| 45 | 46 |
| 46 bool m_isActive; | 47 bool m_isActive; |
| 47 Timer<PlatformEventController> m_timer; | 48 TaskRunnerTimer<PlatformEventController> m_timer; |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 } // namespace blink | 51 } // namespace blink |
| 51 | 52 |
| 52 #endif // PlatformEventController_h | 53 #endif // PlatformEventController_h |
| OLD | NEW |