| 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/ElementIntersectionObserverData.h" | 5 #include "core/dom/ElementIntersectionObserverData.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 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 void ElementIntersectionObserverData::removeObserver( | 29 void ElementIntersectionObserverData::removeObserver( |
| 30 IntersectionObserver& observer) { | 30 IntersectionObserver& observer) { |
| 31 m_intersectionObservers.remove(&observer); | 31 m_intersectionObservers.remove(&observer); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void ElementIntersectionObserverData::addObservation( | 34 void ElementIntersectionObserverData::addObservation( |
| 35 IntersectionObservation& observation) { | 35 IntersectionObservation& observation) { |
| 36 DCHECK(observation.observer()); | 36 DCHECK(observation.observer()); |
| 37 m_intersectionObservations.add( | 37 m_intersectionObservations.insert( |
| 38 TraceWrapperMember<IntersectionObserver>(this, observation.observer()), | 38 TraceWrapperMember<IntersectionObserver>(this, observation.observer()), |
| 39 &observation); | 39 &observation); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void ElementIntersectionObserverData::removeObservation( | 42 void ElementIntersectionObserverData::removeObservation( |
| 43 IntersectionObserver& observer) { | 43 IntersectionObserver& observer) { |
| 44 m_intersectionObservations.erase(&observer); | 44 m_intersectionObservations.erase(&observer); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void ElementIntersectionObserverData::activateValidIntersectionObservers( | 47 void ElementIntersectionObserverData::activateValidIntersectionObservers( |
| (...skipping 22 matching lines...) Expand all Loading... |
| 70 visitor->trace(m_intersectionObservations); | 70 visitor->trace(m_intersectionObservations); |
| 71 } | 71 } |
| 72 | 72 |
| 73 DEFINE_TRACE_WRAPPERS(ElementIntersectionObserverData) { | 73 DEFINE_TRACE_WRAPPERS(ElementIntersectionObserverData) { |
| 74 for (auto& entry : m_intersectionObservations) { | 74 for (auto& entry : m_intersectionObservations) { |
| 75 visitor->traceWrappers(entry.key); | 75 visitor->traceWrappers(entry.key); |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace blink | 79 } // namespace blink |
| OLD | NEW |