| 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 ElementIntersectionObserverData_h |
| 6 #define NodeIntersectionObserverData_h | 6 #define ElementIntersectionObserverData_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "bindings/core/v8/TraceWrapperMember.h" | 9 #include "bindings/core/v8/TraceWrapperMember.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class Node; | 14 class Node; |
| 15 class IntersectionObservation; | 15 class IntersectionObservation; |
| 16 class IntersectionObserver; | 16 class IntersectionObserver; |
| 17 | 17 |
| 18 class NodeIntersectionObserverData | 18 class ElementIntersectionObserverData |
| 19 : public GarbageCollected<NodeIntersectionObserverData>, | 19 : public GarbageCollected<ElementIntersectionObserverData>, |
| 20 public TraceWrapperBase { | 20 public TraceWrapperBase { |
| 21 public: | 21 public: |
| 22 NodeIntersectionObserverData(); | 22 ElementIntersectionObserverData(); |
| 23 | 23 |
| 24 IntersectionObservation* getObservationFor(IntersectionObserver&); | 24 IntersectionObservation* getObservationFor(IntersectionObserver&); |
| 25 void addObserver(IntersectionObserver&); |
| 26 void removeObserver(IntersectionObserver&); |
| 25 void addObservation(IntersectionObservation&); | 27 void addObservation(IntersectionObservation&); |
| 26 void removeObservation(IntersectionObserver&); | 28 void removeObservation(IntersectionObserver&); |
| 27 void activateValidIntersectionObservers(Node&); | 29 void activateValidIntersectionObservers(Node&); |
| 28 void deactivateAllIntersectionObservers(Node&); | 30 void deactivateAllIntersectionObservers(Node&); |
| 29 | 31 |
| 30 DECLARE_TRACE(); | 32 DECLARE_TRACE(); |
| 31 DECLARE_TRACE_WRAPPERS(); | 33 DECLARE_TRACE_WRAPPERS(); |
| 32 | 34 |
| 33 private: | 35 private: |
| 34 // IntersectionObservers for which the Node owning this data is root. | 36 // IntersectionObservers for which the Node owning this data is root. |
| 35 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers; | 37 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers; |
| 36 // IntersectionObservations for which the Node owning this data is target. | 38 // IntersectionObservations for which the Node owning this data is target. |
| 37 HeapHashMap<TraceWrapperMember<IntersectionObserver>, | 39 HeapHashMap<TraceWrapperMember<IntersectionObserver>, |
| 38 Member<IntersectionObservation>> | 40 Member<IntersectionObservation>> |
| 39 m_intersectionObservations; | 41 m_intersectionObservations; |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 } // namespace blink | 44 } // namespace blink |
| 43 | 45 |
| 44 #endif // NodeIntersectionObserverData_h | 46 #endif // ElementIntersectionObserverData_h |
| OLD | NEW |