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

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

Issue 2724363002: Migrate WTF::LinkedHashSet/ListHashSet::add() to ::insert() (Closed)
Patch Set: 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/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/Element.h" 10 #include "core/dom/Element.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 if (rootFrame != targetFrame) { 249 if (rootFrame != targetFrame) {
250 shouldReportRootBounds = 250 shouldReportRootBounds =
251 targetFrame->securityContext()->getSecurityOrigin()->canAccess( 251 targetFrame->securityContext()->getSecurityOrigin()->canAccess(
252 rootFrame->securityContext()->getSecurityOrigin()); 252 rootFrame->securityContext()->getSecurityOrigin());
253 } 253 }
254 } 254 }
255 255
256 IntersectionObservation* observation = 256 IntersectionObservation* observation =
257 new IntersectionObservation(*this, *target, shouldReportRootBounds); 257 new IntersectionObservation(*this, *target, shouldReportRootBounds);
258 target->ensureIntersectionObserverData().addObservation(*observation); 258 target->ensureIntersectionObserverData().addObservation(*observation);
259 m_observations.add(observation); 259 m_observations.insert(observation);
260 if (FrameView* frameView = targetFrame->view()) 260 if (FrameView* frameView = targetFrame->view())
261 frameView->scheduleAnimation(); 261 frameView->scheduleAnimation();
262 } 262 }
263 263
264 void IntersectionObserver::unobserve(Element* target, 264 void IntersectionObserver::unobserve(Element* target,
265 ExceptionState& exceptionState) { 265 ExceptionState& exceptionState) {
266 if (!target || !target->intersectionObserverData()) 266 if (!target || !target->intersectionObserverData())
267 return; 267 return;
268 268
269 if (IntersectionObservation* observation = 269 if (IntersectionObservation* observation =
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 DEFINE_TRACE(IntersectionObserver) { 349 DEFINE_TRACE(IntersectionObserver) {
350 visitor->template registerWeakMembers< 350 visitor->template registerWeakMembers<
351 IntersectionObserver, &IntersectionObserver::clearWeakMembers>(this); 351 IntersectionObserver, &IntersectionObserver::clearWeakMembers>(this);
352 visitor->trace(m_callback); 352 visitor->trace(m_callback);
353 visitor->trace(m_observations); 353 visitor->trace(m_observations);
354 visitor->trace(m_entries); 354 visitor->trace(m_entries);
355 } 355 }
356 356
357 } // namespace blink 357 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp ('k') | third_party/WebKit/Source/core/dom/ResizeObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698