| Index: third_party/WebKit/Source/core/dom/IntersectionObservationRegistry.h
|
| diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservationRegistry.h b/third_party/WebKit/Source/core/dom/IntersectionObservationRegistry.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d2c343c3d6d5530a20787880da0ebf762ca7dd36
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/dom/IntersectionObservationRegistry.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 IntersectionObservationRegistry_h
|
| +#define IntersectionObservationRegistry_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;
|
| +
|
| +typedef WillBeHeapHashSet<RefPtrWillBeMember<IntersectionObserver>> IntersectionObserverHashSet;
|
| +
|
| +class IntersectionObservationRegistry {
|
| +public:
|
| + IntersectionObservationRegistry(Timer<Document>&);
|
| + virtual ~IntersectionObservationRegistry();
|
| +
|
| + void activateIntersectionObserver(IntersectionObserver&);
|
| + void resumeSuspendedIntersectionObservers();
|
| + void deliverIntersectionObservations();
|
| + void clearIntersectionObservations();
|
| + void computeIntersectionObservations();
|
| + void addObservation(IntersectionObservation&);
|
| + void removeObservation(IntersectionObservation&);
|
| +
|
| +private:
|
| + Timer<Document>& m_timer;
|
| + IntersectionObserverHashSet m_activeIntersectionObservers;
|
| + IntersectionObserverHashSet m_suspendedIntersectionObservers;
|
| + IntersectionObservation::HashSet m_intersectionObservations;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // IntersectionObservationRegistry_h
|
|
|