RemoteLayerBackingStoreCollection.h [plain text]
#ifndef RemoteLayerBackingStoreCollection_h
#define RemoteLayerBackingStoreCollection_h
#import <WebCore/Timer.h>
#import <wtf/HashSet.h>
#import <wtf/Noncopyable.h>
namespace WebKit {
class RemoteLayerBackingStore;
class RemoteLayerTreeContext;
class RemoteLayerTreeTransaction;
class RemoteLayerBackingStoreCollection {
WTF_MAKE_NONCOPYABLE(RemoteLayerBackingStoreCollection);
WTF_MAKE_FAST_ALLOCATED;
public:
RemoteLayerBackingStoreCollection();
void backingStoreWasCreated(RemoteLayerBackingStore&);
void backingStoreWillBeDestroyed(RemoteLayerBackingStore&);
void backingStoreWillBeDisplayed(RemoteLayerBackingStore&);
void backingStoreBecameUnreachable(RemoteLayerBackingStore&);
void willFlushLayers();
void willCommitLayerTree(RemoteLayerTreeTransaction&);
void didFlushLayers();
void volatilityTimerFired(WebCore::Timer<RemoteLayerBackingStoreCollection>&);
bool markAllBackingStoreVolatileImmediatelyIfPossible();
void scheduleVolatilityTimer();
private:
enum VolatilityMarkingFlag {
MarkBuffersIgnoringReachability = 1 << 0
};
typedef unsigned VolatilityMarkingFlags;
bool markBackingStoreVolatileImmediately(RemoteLayerBackingStore&, VolatilityMarkingFlags volatilityMarkingFlags = 0);
bool markBackingStoreVolatile(RemoteLayerBackingStore&, std::chrono::steady_clock::time_point now);
HashSet<RemoteLayerBackingStore*> m_liveBackingStore;
HashSet<RemoteLayerBackingStore*> m_unparentedBackingStore;
HashSet<RemoteLayerBackingStore*> m_reachableBackingStoreInLatestFlush;
WebCore::Timer<RemoteLayerBackingStoreCollection> m_volatilityTimer;
bool m_inLayerFlush;
};
}
#endif // RemoteLayerBackingStoreCollection_h