mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This caused us to lose our gn check certification. :( Turns out gn check was just ignoring all the header paths it didn't understand and so gn check passing for sky wasn't meaning much. I tried to straighten out some of the mess in this CL, but its going to take several more rounds of massaging before gn check passes again. On the bright side (almost) all of our headers are absolute now. Turns out my script (attached to the bug) didn't notice ../ includes but I'll fix that in the next patch. R=abarth@chromium.org BUG=435361 Review URL: https://codereview.chromium.org/746023002
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
// Copyright 2014 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 PlatformEventController_h
|
|
#define PlatformEventController_h
|
|
|
|
#include "sky/engine/core/page/PageLifecycleObserver.h"
|
|
#include "sky/engine/platform/Timer.h"
|
|
#include "sky/engine/platform/heap/Handle.h"
|
|
|
|
namespace blink {
|
|
|
|
// Base controller class for registering controllers with a dispatcher.
|
|
// It watches page visibility and calls stopUpdating when page is not visible.
|
|
// It provides a didUpdateData() callback method which is called when new data
|
|
// it available.
|
|
class PlatformEventController : public PageLifecycleObserver {
|
|
public:
|
|
void startUpdating();
|
|
void stopUpdating();
|
|
|
|
// This is called when new data becomes available.
|
|
virtual void didUpdateData() = 0;
|
|
|
|
protected:
|
|
explicit PlatformEventController(Page*);
|
|
virtual ~PlatformEventController();
|
|
|
|
virtual void registerWithDispatcher() = 0;
|
|
virtual void unregisterWithDispatcher() = 0;
|
|
|
|
// When true initiates a one-shot didUpdateData() when startUpdating() is called.
|
|
virtual bool hasLastData() = 0;
|
|
|
|
bool m_hasEventListener;
|
|
|
|
private:
|
|
// Inherited from PageLifecycleObserver.
|
|
virtual void pageVisibilityChanged() override;
|
|
|
|
void oneShotCallback(Timer<PlatformEventController>*);
|
|
|
|
bool m_isActive;
|
|
Timer<PlatformEventController> m_timer;
|
|
};
|
|
|
|
} // namespace blink
|
|
|
|
#endif // PlatformEventController_h
|