OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IntersectionObservationRegistry_h |
| 6 #define IntersectionObservationRegistry_h |
| 7 |
| 8 #include "core/dom/Element.h" |
| 9 #include "core/dom/IntersectionObserver.h" |
| 10 #include "platform/Timer.h" |
| 11 #include "platform/heap/Handle.h" |
| 12 #include "wtf/HashSet.h" |
| 13 #include "wtf/RefCounted.h" |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 class Document; |
| 18 template<typename T> class Timer; |
| 19 |
| 20 typedef WillBeHeapHashSet<RefPtrWillBeMember<IntersectionObserver>> Intersection
ObserverHashSet; |
| 21 |
| 22 class IntersectionObservationRegistry { |
| 23 public: |
| 24 IntersectionObservationRegistry(Timer<Document>&); |
| 25 virtual ~IntersectionObservationRegistry(); |
| 26 |
| 27 void activateIntersectionObserver(IntersectionObserver&); |
| 28 void resumeSuspendedIntersectionObservers(); |
| 29 void deliverIntersectionObservations(); |
| 30 void clearIntersectionObservations(); |
| 31 void computeIntersectionObservations(); |
| 32 void addObservation(IntersectionObservation&); |
| 33 void removeObservation(IntersectionObservation&); |
| 34 |
| 35 private: |
| 36 Timer<Document>& m_timer; |
| 37 IntersectionObserverHashSet m_activeIntersectionObservers; |
| 38 IntersectionObserverHashSet m_suspendedIntersectionObservers; |
| 39 IntersectionObservation::HashSet m_intersectionObservations; |
| 40 }; |
| 41 |
| 42 } // namespace blink |
| 43 |
| 44 #endif // IntersectionObservationRegistry_h |
OLD | NEW |