OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 IntersectionObserverController_h |
| 6 #define IntersectionObserverController_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 |
| 14 namespace blink { |
| 15 |
| 16 class IntersectionObserverController : public GarbageCollectedFinalized<Intersec
tionObserverController> { |
| 17 public: |
| 18 IntersectionObserverController(); |
| 19 ~IntersectionObserverController(); |
| 20 |
| 21 void scheduleIntersectionObserverForDelivery(IntersectionObserver&); |
| 22 void resumeSuspendedIntersectionObservers(); |
| 23 void deliverIntersectionObservations(Timer<IntersectionObserverController>*)
; |
| 24 void computeTrackedIntersectionObservations(); |
| 25 void addTrackedObserver(IntersectionObserver&); |
| 26 void removeTrackedObserversForRoot(const Element&); |
| 27 |
| 28 DECLARE_TRACE(); |
| 29 |
| 30 private: |
| 31 // Design doc for IntersectionObserver implementation: |
| 32 // https://docs.google.com/a/google.com/document/d/1hLK0eyT5_BzyNS4Okjsnoq
qFQDYCbKfyBinj94OnLiQ |
| 33 |
| 34 Timer<IntersectionObserverController> m_timer; |
| 35 // IntersectionObservers for which this is the tracking document. |
| 36 HeapHashSet<WeakMember<IntersectionObserver>> m_trackedIntersectionObservers
; |
| 37 // IntersectionObservers for which this is the execution context of the call
back. |
| 38 HeapHashSet<Member<IntersectionObserver>> m_pendingIntersectionObservers; |
| 39 HeapHashSet<Member<IntersectionObserver>> m_suspendedIntersectionObservers; |
| 40 }; |
| 41 |
| 42 } // namespace blink |
| 43 |
| 44 #endif // IntersectionObserverController_h |
OLD | NEW |