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 deliverIntersectionObservations(Timer<IntersectionObserverController>*)
; |
| 23 void computeTrackedIntersectionObservations(); |
| 24 void addTrackedObserver(IntersectionObserver&); |
| 25 void removeTrackedObserversForRoot(const Element&); |
| 26 |
| 27 DECLARE_TRACE(); |
| 28 |
| 29 private: |
| 30 // Design doc for IntersectionObserver implementation: |
| 31 // https://docs.google.com/a/google.com/document/d/1hLK0eyT5_BzyNS4Okjsnoq
qFQDYCbKfyBinj94OnLiQ |
| 32 |
| 33 Timer<IntersectionObserverController> m_timer; |
| 34 // IntersectionObservers for which this is the tracking document. |
| 35 HeapHashSet<WeakMember<IntersectionObserver>> m_trackedIntersectionObservers
; |
| 36 // IntersectionObservers for which this is the execution context of the call
back. |
| 37 HeapHashSet<Member<IntersectionObserver>> m_pendingIntersectionObservers; |
| 38 }; |
| 39 |
| 40 } // namespace blink |
| 41 |
| 42 #endif // IntersectionObserverController_h |
OLD | NEW |