| 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 #include "core/dom/NodeIntersectionObserverData.h" | 5 #include "core/dom/NodeIntersectionObserverData.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/IntersectionObservation.h" | 8 #include "core/dom/IntersectionObservation.h" |
| 9 #include "core/dom/IntersectionObserver.h" | 9 #include "core/dom/IntersectionObserver.h" |
| 10 #include "core/dom/IntersectionObserverController.h" | 10 #include "core/dom/IntersectionObserverController.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void NodeIntersectionObserverData::dispose() | 72 void NodeIntersectionObserverData::dispose() |
| 73 { | 73 { |
| 74 HeapVector<Member<IntersectionObserver>> observersToDisconnect; | 74 HeapVector<Member<IntersectionObserver>> observersToDisconnect; |
| 75 copyToVector(m_intersectionObservers, observersToDisconnect); | 75 copyToVector(m_intersectionObservers, observersToDisconnect); |
| 76 for (auto& observer : observersToDisconnect) | 76 for (auto& observer : observersToDisconnect) |
| 77 observer->disconnect(); | 77 observer->disconnect(); |
| 78 ASSERT(m_intersectionObservers.isEmpty()); | 78 ASSERT(m_intersectionObservers.isEmpty()); |
| 79 } | 79 } |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 WeakPtrWillBeRawPtr<Node> NodeIntersectionObserverData::createWeakPtr(Node* node
) | 82 RawPtr<Node> NodeIntersectionObserverData::createWeakPtr(Node* node) |
| 83 { | 83 { |
| 84 #if ENABLE(OILPAN) | 84 #if ENABLE(OILPAN) |
| 85 return node; | 85 return node; |
| 86 #else | 86 #else |
| 87 if (!m_weakPointerFactory) | 87 if (!m_weakPointerFactory) |
| 88 m_weakPointerFactory = adoptPtrWillBeNoop(new WeakPtrFactory<Node>(node)
); | 88 m_weakPointerFactory = (new WeakPtrFactory<Node>(node)); |
| 89 WeakPtr<Node> result = m_weakPointerFactory->createWeakPtr(); | 89 WeakPtr<Node> result = m_weakPointerFactory->createWeakPtr(); |
| 90 ASSERT(result.get() == node); | 90 ASSERT(result.get() == node); |
| 91 return result; | 91 return result; |
| 92 #endif | 92 #endif |
| 93 } | 93 } |
| 94 | 94 |
| 95 DEFINE_TRACE(NodeIntersectionObserverData) | 95 DEFINE_TRACE(NodeIntersectionObserverData) |
| 96 { | 96 { |
| 97 visitor->trace(m_intersectionObservers); | 97 visitor->trace(m_intersectionObservers); |
| 98 visitor->trace(m_intersectionObservations); | 98 visitor->trace(m_intersectionObservations); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |