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 ElementIntersectionObserverData_h | 5 #ifndef NodeIntersectionObserverData_h |
6 #define ElementIntersectionObserverData_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 Element; | 12 class Node; |
13 class IntersectionObservation; | 13 class IntersectionObservation; |
14 class IntersectionObserver; | 14 class IntersectionObserver; |
15 | 15 |
16 class ElementIntersectionObserverData : public GarbageCollectedFinalized<Element
IntersectionObserverData> { | 16 class NodeIntersectionObserverData : public GarbageCollectedFinalized<NodeInters
ectionObserverData> { |
17 public: | 17 public: |
18 DECLARE_TRACE(); | 18 DECLARE_TRACE(); |
19 ElementIntersectionObserverData(); | 19 NodeIntersectionObserverData(); |
20 ~ElementIntersectionObserverData(); | 20 ~NodeIntersectionObserverData(); |
21 | 21 |
22 bool hasIntersectionObserver() const; | 22 bool hasIntersectionObserver() const; |
23 bool hasIntersectionObservation() const; | 23 bool hasIntersectionObservation() const; |
24 IntersectionObservation* getObservationFor(IntersectionObserver&); | 24 IntersectionObservation* getObservationFor(IntersectionObserver&); |
25 void addObservation(IntersectionObservation&); | 25 void addObservation(IntersectionObservation&); |
26 void removeObservation(IntersectionObserver&); | 26 void removeObservation(IntersectionObserver&); |
27 void activateValidIntersectionObservers(Element&); | 27 void activateValidIntersectionObservers(Node&); |
28 void deactivateAllIntersectionObservers(Element&); | 28 void deactivateAllIntersectionObservers(Node&); |
29 | 29 |
30 #if !ENABLE(OILPAN) | 30 #if !ENABLE(OILPAN) |
31 void dispose(); | 31 void dispose(); |
32 #endif | 32 #endif |
33 | 33 |
34 WeakPtrWillBeRawPtr<Element> createWeakPtr(Element*); | 34 WeakPtrWillBeRawPtr<Node> createWeakPtr(Node*); |
35 | 35 |
36 private: | 36 private: |
37 // IntersectionObservers for which the Element owning this data is root. | 37 // IntersectionObservers for which the Node owning this data is root. |
38 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers; | 38 HeapHashSet<WeakMember<IntersectionObserver>> m_intersectionObservers; |
39 // IntersectionObservations for which the Element owning this data is target
. | 39 // IntersectionObservations for which the Node owning this data is target. |
40 HeapHashMap<Member<IntersectionObserver>, Member<IntersectionObservation>> m
_intersectionObservations; | 40 HeapHashMap<Member<IntersectionObserver>, Member<IntersectionObservation>> m
_intersectionObservations; |
41 | 41 |
42 #if !ENABLE(OILPAN) | 42 #if !ENABLE(OILPAN) |
43 OwnPtr<WeakPtrFactory<Element>> m_weakPointerFactory; | 43 OwnPtr<WeakPtrFactory<Node>> m_weakPointerFactory; |
44 #endif | 44 #endif |
45 }; | 45 }; |
46 | 46 |
47 } // namespace blink | 47 } // namespace blink |
48 | 48 |
49 #endif // ElementIntersectionObserverData_h | 49 #endif // NodeIntersectionObserverData_h |
OLD | NEW |