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

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

Issue 2759703002: Migrate WTF::HashMap::remove() to ::erase() (Closed)
Patch Set: rebase, fix one platform-specific reference Created 3 years, 9 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
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/ResizeObserver.h" 5 #include "core/dom/ResizeObserver.h"
6 6
7 #include "core/dom/Element.h" 7 #include "core/dom/Element.h"
8 #include "core/dom/ResizeObservation.h" 8 #include "core/dom/ResizeObservation.h"
9 #include "core/dom/ResizeObserverCallback.h" 9 #include "core/dom/ResizeObserverCallback.h"
10 #include "core/dom/ResizeObserverController.h" 10 #include "core/dom/ResizeObserverController.h"
(...skipping 29 matching lines...) Expand all
40 frameView->scheduleAnimation(); 40 frameView->scheduleAnimation();
41 } 41 }
42 42
43 void ResizeObserver::unobserve(Element* target) { 43 void ResizeObserver::unobserve(Element* target) {
44 auto observerMap = target ? target->resizeObserverData() : nullptr; 44 auto observerMap = target ? target->resizeObserverData() : nullptr;
45 if (!observerMap) 45 if (!observerMap)
46 return; 46 return;
47 auto observation = observerMap->find(this); 47 auto observation = observerMap->find(this);
48 if (observation != observerMap->end()) { 48 if (observation != observerMap->end()) {
49 m_observations.erase((*observation).value); 49 m_observations.erase((*observation).value);
50 observerMap->remove(observation); 50 observerMap->erase(observation);
51 } 51 }
52 } 52 }
53 53
54 void ResizeObserver::disconnect() { 54 void ResizeObserver::disconnect() {
55 ObservationList observations; 55 ObservationList observations;
56 m_observations.swap(observations); 56 m_observations.swap(observations);
57 57
58 for (auto& observation : observations) { 58 for (auto& observation : observations) {
59 Element* target = (*observation).target(); 59 Element* target = (*observation).target();
60 if (target) 60 if (target)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 DEFINE_TRACE(ResizeObserver) { 118 DEFINE_TRACE(ResizeObserver) {
119 visitor->trace(m_callback); 119 visitor->trace(m_callback);
120 visitor->trace(m_observations); 120 visitor->trace(m_observations);
121 visitor->trace(m_activeObservations); 121 visitor->trace(m_activeObservations);
122 visitor->trace(m_controller); 122 visitor->trace(m_controller);
123 } 123 }
124 124
125 } // namespace blink 125 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/IdTargetObserverRegistry.cpp ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698