| Index: third_party/WebKit/Source/core/dom/IntersectionObserverRegistry.h
|
| diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserverRegistry.h b/third_party/WebKit/Source/core/dom/IntersectionObserverRegistry.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5918e83da4a06a53f75218790889a16f282897db
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/dom/IntersectionObserverRegistry.h
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2015 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 IntersectionObserverRegistry_h
|
| +#define IntersectionObserverRegistry_h
|
| +
|
| +#include "core/dom/Element.h"
|
| +#include "core/dom/IntersectionObserver.h"
|
| +#include "platform/Timer.h"
|
| +#include "platform/heap/Handle.h"
|
| +#include "wtf/HashSet.h"
|
| +#include "wtf/RefCounted.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class Document;
|
| +template<typename T> class Timer;
|
| +
|
| +class IntersectionObserverRegistry : public GarbageCollectedFinalized<IntersectionObserverRegistry> {
|
| +public:
|
| + IntersectionObserverRegistry(Timer<Document>&);
|
| +
|
| + void scheduleIntersectionObserverForDelivery(IntersectionObserver&);
|
| + void resumeSuspendedIntersectionObservers();
|
| + void deliverIntersectionObservations();
|
| + void computeTrackedIntersectionObservations();
|
| + void addTrackedObserver(IntersectionObserver&);
|
| + void removeTrackedObserversForRoot(Element*);
|
| +
|
| + DECLARE_TRACE();
|
| +
|
| +private:
|
| + Timer<Document>& m_timer;
|
| + // IntersectionObservers for which this is the tracking document.
|
| + Member<IntersectionObserver::WeakHashSet> m_trackedIntersectionObservers;
|
| + // IntersectionObservers for which this is the execution context of the callback.
|
| + Member<IntersectionObserver::HashSet> m_activeIntersectionObservers;
|
| + Member<IntersectionObserver::HashSet> m_suspendedIntersectionObservers;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // IntersectionObservationRegistry_h
|
|
|