Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/core/dom/IntersectionObserver.cpp

Issue 1580503003: Eliminate superfluous clearing of weak pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Eliminate superfluous WeakPtrFactory::clear() Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObservation.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/IntersectionObserver.h" 5 #include "core/dom/IntersectionObserver.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/css/parser/CSSParserTokenRange.h" 8 #include "core/css/parser/CSSParserTokenRange.h"
9 #include "core/css/parser/CSSTokenizer.h" 9 #include "core/css/parser/CSSTokenizer.h"
10 #include "core/dom/ElementIntersectionObserverData.h" 10 #include "core/dom/ElementIntersectionObserverData.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 observation->computeIntersectionObservations(timestamp); 153 observation->computeIntersectionObservations(timestamp);
154 } 154 }
155 155
156 void IntersectionObserver::disconnect() 156 void IntersectionObserver::disconnect()
157 { 157 {
158 HeapVector<Member<IntersectionObservation>> observationsToDisconnect; 158 HeapVector<Member<IntersectionObservation>> observationsToDisconnect;
159 copyToVector(m_observations, observationsToDisconnect); 159 copyToVector(m_observations, observationsToDisconnect);
160 for (auto& observation : observationsToDisconnect) 160 for (auto& observation : observationsToDisconnect)
161 observation->disconnect(); 161 observation->disconnect();
162 ASSERT(m_observations.isEmpty()); 162 ASSERT(m_observations.isEmpty());
163 m_root.clear();
164 } 163 }
165 164
166 void IntersectionObserver::removeObservation(IntersectionObservation& observatio n) 165 void IntersectionObserver::removeObservation(IntersectionObservation& observatio n)
167 { 166 {
168 m_observations.remove(&observation); 167 m_observations.remove(&observation);
169 } 168 }
170 169
171 HeapVector<Member<IntersectionObserverEntry>> IntersectionObserver::takeRecords( ) 170 HeapVector<Member<IntersectionObserverEntry>> IntersectionObserver::takeRecords( )
172 { 171 {
173 checkRootAndDetachIfNeeded(); 172 checkRootAndDetachIfNeeded();
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 227
229 DEFINE_TRACE(IntersectionObserver) 228 DEFINE_TRACE(IntersectionObserver)
230 { 229 {
231 visitor->trace(m_callback); 230 visitor->trace(m_callback);
232 visitor->trace(m_root); 231 visitor->trace(m_root);
233 visitor->trace(m_observations); 232 visitor->trace(m_observations);
234 visitor->trace(m_entries); 233 visitor->trace(m_entries);
235 } 234 }
236 235
237 } // namespace blink 236 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObservation.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698