| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NodeIntersectionObserverData_h | 5 #ifndef NodeIntersectionObserverData_h |
| 6 #define NodeIntersectionObserverData_h | 6 #define NodeIntersectionObserverData_h |
| 7 | 7 |
| 8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class Node; | 12 class Node; |
| 13 class IntersectionObservation; | 13 class IntersectionObservation; |
| 14 class IntersectionObserver; | 14 class IntersectionObserver; |
| 15 | 15 |
| 16 class NodeIntersectionObserverData : public GarbageCollected<NodeIntersectionObs
erverData> { | 16 class NodeIntersectionObserverData : public GarbageCollectedFinalized<NodeInters
ectionObserverData> { |
| 17 public: | 17 public: |
| 18 DECLARE_TRACE(); | 18 DECLARE_TRACE(); |
| 19 NodeIntersectionObserverData(); | 19 NodeIntersectionObserverData(); |
| 20 ~NodeIntersectionObserverData(); |
| 20 | 21 |
| 21 IntersectionObservation* getObservationFor(IntersectionObserver&); | 22 IntersectionObservation* getObservationFor(IntersectionObserver&); |
| 22 void addObservation(IntersectionObservation&); | 23 void addObservation(IntersectionObservation&); |
| 23 void removeObservation(IntersectionObserver&); | 24 void removeObservation(IntersectionObserver&); |
| 24 void activateValidIntersectionObservers(Node&); | 25 void activateValidIntersectionObservers(Node&); |
| 25 void deactivateAllIntersectionObservers(Node&); | 26 void deactivateAllIntersectionObservers(Node&); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 // IntersectionObservers for which the Node owning this data is root. | 29 // IntersectionObservers for which the Node owning this data is root. |
| 29 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers; | 30 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers; |
| 30 // IntersectionObservations for which the Node owning this data is target. | 31 // IntersectionObservations for which the Node owning this data is target. |
| 31 HeapHashMap<Member<IntersectionObserver>, Member<IntersectionObservation>> m
_intersectionObservations; | 32 HeapHashMap<Member<IntersectionObserver>, Member<IntersectionObservation>> m
_intersectionObservations; |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 } // namespace blink | 35 } // namespace blink |
| 35 | 36 |
| 36 #endif // NodeIntersectionObserverData_h | 37 #endif // NodeIntersectionObserverData_h |
| OLD | NEW |