RemoteLayerBackingStoreCollection.h [plain text]
#pragma once
#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&);
bool backingStoreWillBeDisplayed(RemoteLayerBackingStore&);
void backingStoreBecameUnreachable(RemoteLayerBackingStore&);
void willFlushLayers();
void willCommitLayerTree(RemoteLayerTreeTransaction&);
void didFlushLayers();
void volatilityTimerFired();
bool markAllBackingStoreVolatileImmediatelyIfPossible();
void scheduleVolatilityTimer();
private:
enum VolatilityMarkingFlag {
MarkBuffersIgnoringReachability = 1 << 0
};
typedef unsigned VolatilityMarkingFlags;
bool markBackingStoreVolatileImmediately(RemoteLayerBackingStore&, VolatilityMarkingFlags = 0);
bool markBackingStoreVolatile(RemoteLayerBackingStore&, MonotonicTime now);
HashSet<RemoteLayerBackingStore*> m_liveBackingStore;
HashSet<RemoteLayerBackingStore*> m_unparentedBackingStore;
HashSet<RemoteLayerBackingStore*> m_reachableBackingStoreInLatestFlush;
WebCore::Timer m_volatilityTimer;
bool m_inLayerFlush { false };
};
}