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

Side by Side Diff: third_party/WebKit/Source/core/dom/ElementIntersectionObserverData.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 | « no previous file | third_party/WebKit/Source/core/dom/IntersectionObservation.cpp » ('j') | 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/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/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/dom/IntersectionObservation.h" 9 #include "core/dom/IntersectionObservation.h"
10 #include "core/dom/IntersectionObserver.h" 10 #include "core/dom/IntersectionObserver.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 #if !ENABLE(OILPAN) 67 #if !ENABLE(OILPAN)
68 void ElementIntersectionObserverData::dispose() 68 void ElementIntersectionObserverData::dispose()
69 { 69 {
70 HeapVector<Member<IntersectionObserver>> observersToDisconnect; 70 HeapVector<Member<IntersectionObserver>> observersToDisconnect;
71 copyToVector(m_intersectionObservers, observersToDisconnect); 71 copyToVector(m_intersectionObservers, observersToDisconnect);
72 for (auto& observer : observersToDisconnect) 72 for (auto& observer : observersToDisconnect)
73 observer->disconnect(); 73 observer->disconnect();
74 ASSERT(m_intersectionObservers.isEmpty()); 74 ASSERT(m_intersectionObservers.isEmpty());
75
76 m_weakPointerFactory.clear();
77 } 75 }
78 #endif 76 #endif
79 77
80 WeakPtrWillBeRawPtr<Element> ElementIntersectionObserverData::createWeakPtr(Elem ent* element) 78 WeakPtrWillBeRawPtr<Element> ElementIntersectionObserverData::createWeakPtr(Elem ent* element)
81 { 79 {
82 #if ENABLE(OILPAN) 80 #if ENABLE(OILPAN)
83 return element; 81 return element;
84 #else 82 #else
85 if (!m_weakPointerFactory) 83 if (!m_weakPointerFactory)
86 m_weakPointerFactory = adoptPtrWillBeNoop(new WeakPtrFactory<Element>(el ement)); 84 m_weakPointerFactory = adoptPtrWillBeNoop(new WeakPtrFactory<Element>(el ement));
87 return m_weakPointerFactory->createWeakPtr(); 85 return m_weakPointerFactory->createWeakPtr();
88 #endif 86 #endif
89 } 87 }
90 88
91 DEFINE_TRACE(ElementIntersectionObserverData) 89 DEFINE_TRACE(ElementIntersectionObserverData)
92 { 90 {
93 visitor->trace(m_intersectionObservers); 91 visitor->trace(m_intersectionObservers);
94 visitor->trace(m_intersectionObservations); 92 visitor->trace(m_intersectionObservations);
95 } 93 }
96 94
97 } // namespace blink 95 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/IntersectionObservation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698