Chromium Code Reviews| 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 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 #include "wtf/RefCounted.h" | |
|
sof
2015/12/30 13:09:33
Not needed.
szager1
2016/01/02 18:05:59
Done.
| |
| 14 | |
| 15 namespace blink { | |
| 16 | |
| 17 class Document; | |
|
sof
2015/12/30 13:09:33
not needed.
szager1
2016/01/02 18:05:59
Done.
| |
| 18 template<typename T> class Timer; | |
|
sof
2015/12/30 13:09:33
shouldn't be needed here (now?)
szager1
2016/01/02 18:05:59
Done.
| |
| 19 | |
| 20 class IntersectionObserverController : public GarbageCollectedFinalized<Intersec tionObserverController> { | |
| 21 public: | |
| 22 IntersectionObserverController(); | |
| 23 ~IntersectionObserverController(); | |
| 24 | |
| 25 void scheduleIntersectionObserverForDelivery(IntersectionObserver&); | |
| 26 void resumeSuspendedIntersectionObservers(); | |
| 27 void deliverIntersectionObservations(Timer<IntersectionObserverController>*) ; | |
| 28 void computeTrackedIntersectionObservations(); | |
| 29 void addTrackedObserver(IntersectionObserver&); | |
| 30 void removeTrackedObserversForRoot(Element&); | |
| 31 void dispose(); | |
| 32 | |
| 33 DECLARE_TRACE(); | |
| 34 | |
| 35 private: | |
| 36 // Design doc for IntersectionObserver implementation: | |
| 37 // https://docs.google.com/a/google.com/document/d/1hLK0eyT5_BzyNS4Okjsnoq qFQDYCbKfyBinj94OnLiQ | |
| 38 | |
| 39 Timer<IntersectionObserverController> m_timer; | |
| 40 // IntersectionObservers for which this is the tracking document. | |
| 41 HeapHashSet<WeakMember<IntersectionObserver>> m_trackedIntersectionObservers ; | |
| 42 // IntersectionObservers for which this is the execution context of the call back. | |
| 43 HeapHashSet<Member<IntersectionObserver>> m_activeIntersectionObservers; | |
| 44 HeapHashSet<Member<IntersectionObserver>> m_suspendedIntersectionObservers; | |
| 45 }; | |
| 46 | |
| 47 } // namespace blink | |
| 48 | |
| 49 #endif // IntersectionObservationRegistry_h | |
|
sof
2015/12/30 13:09:33
doesn't quite match up.
szager1
2016/01/02 18:05:59
Fixed.
| |
| OLD | NEW |