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

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

Issue 2004343002: Remove unwanted copyToVector() uses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused typedef Created 4 years, 7 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/IntersectionObserverController.h" 5 #include "core/dom/IntersectionObserverController.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/IdleRequestOptions.h" 8 #include "core/dom/IdleRequestOptions.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 typedef HeapVector<Member<IntersectionObserver>> IntersectionObserverVector;
sof 2016/05/24 07:16:32 now unused, forgot to remove this in ps#1.
13
14 IntersectionObserverController* IntersectionObserverController::create(Document* document) 12 IntersectionObserverController* IntersectionObserverController::create(Document* document)
15 { 13 {
16 IntersectionObserverController* result = new IntersectionObserverController( document); 14 IntersectionObserverController* result = new IntersectionObserverController( document);
17 result->suspendIfNeeded(); 15 result->suspendIfNeeded();
18 return result; 16 return result;
19 } 17 }
20 18
21 IntersectionObserverController::IntersectionObserverController(Document* documen t) 19 IntersectionObserverController::IntersectionObserverController(Document* documen t)
22 : ActiveDOMObject(document) 20 : ActiveDOMObject(document)
23 , m_callbackID(0) 21 , m_callbackID(0)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 m_callbackID = 0; 55 m_callbackID = 0;
58 deliverIntersectionObservations(); 56 deliverIntersectionObservations();
59 } 57 }
60 58
61 void IntersectionObserverController::deliverIntersectionObservations() 59 void IntersectionObserverController::deliverIntersectionObservations()
62 { 60 {
63 if (getExecutionContext()->activeDOMObjectsAreSuspended()) { 61 if (getExecutionContext()->activeDOMObjectsAreSuspended()) {
64 m_callbackFiredWhileSuspended = true; 62 m_callbackFiredWhileSuspended = true;
65 return; 63 return;
66 } 64 }
67 IntersectionObserverVector observers; 65 HeapHashSet<Member<IntersectionObserver>> observers;
68 copyToVector(m_pendingIntersectionObservers, observers); 66 m_pendingIntersectionObservers.swap(observers);
69 m_pendingIntersectionObservers.clear();
70 for (auto& observer : observers) 67 for (auto& observer : observers)
71 observer->deliver(); 68 observer->deliver();
72 } 69 }
73 70
74 void IntersectionObserverController::computeTrackedIntersectionObservations() 71 void IntersectionObserverController::computeTrackedIntersectionObservations()
75 { 72 {
76 for (auto& observer : m_trackedIntersectionObservers) { 73 for (auto& observer : m_trackedIntersectionObservers) {
77 observer->computeIntersectionObservations(); 74 observer->computeIntersectionObservations();
78 if (observer->hasEntries()) 75 if (observer->hasEntries())
79 scheduleIntersectionObserverForDelivery(*observer); 76 scheduleIntersectionObserverForDelivery(*observer);
(...skipping 17 matching lines...) Expand all
97 94
98 DEFINE_TRACE(IntersectionObserverController) 95 DEFINE_TRACE(IntersectionObserverController)
99 { 96 {
100 visitor->trace(m_trackedIntersectionObservers); 97 visitor->trace(m_trackedIntersectionObservers);
101 visitor->trace(m_pendingIntersectionObservers); 98 visitor->trace(m_pendingIntersectionObservers);
102 ActiveDOMObject::trace(visitor); 99 ActiveDOMObject::trace(visitor);
103 IdleRequestCallback::trace(visitor); 100 IdleRequestCallback::trace(visitor);
104 } 101 }
105 102
106 } // namespace blink 103 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/timing/PerformanceBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698