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

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

Issue 2587913002: Rename activeDOMObjectsAreSuspended to isContextSuspended (Closed)
Patch Set: temp Created 3 years, 12 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/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/dom/TaskRunnerHelper.h" 9 #include "core/dom/TaskRunnerHelper.h"
10 #include "platform/instrumentation/tracing/TraceEvent.h" 10 #include "platform/instrumentation/tracing/TraceEvent.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 postTaskToDeliverObservations(); 54 postTaskToDeliverObservations();
55 } 55 }
56 } 56 }
57 57
58 void IntersectionObserverController::deliverIntersectionObservations() { 58 void IntersectionObserverController::deliverIntersectionObservations() {
59 ExecutionContext* context = getExecutionContext(); 59 ExecutionContext* context = getExecutionContext();
60 if (!context) { 60 if (!context) {
61 m_pendingIntersectionObservers.clear(); 61 m_pendingIntersectionObservers.clear();
62 return; 62 return;
63 } 63 }
64 if (context->activeDOMObjectsAreSuspended()) { 64 if (context->isContextSuspended()) {
65 m_callbackFiredWhileSuspended = true; 65 m_callbackFiredWhileSuspended = true;
66 return; 66 return;
67 } 67 }
68 HeapHashSet<Member<IntersectionObserver>> observers; 68 HeapHashSet<Member<IntersectionObserver>> observers;
69 m_pendingIntersectionObservers.swap(observers); 69 m_pendingIntersectionObservers.swap(observers);
70 for (auto& observer : observers) 70 for (auto& observer : observers)
71 observer->deliver(); 71 observer->deliver();
72 } 72 }
73 73
74 void IntersectionObserverController::computeTrackedIntersectionObservations() { 74 void IntersectionObserverController::computeTrackedIntersectionObservations() {
(...skipping 22 matching lines...) Expand all
97 m_trackedIntersectionObservers.removeAll(toRemove); 97 m_trackedIntersectionObservers.removeAll(toRemove);
98 } 98 }
99 99
100 DEFINE_TRACE(IntersectionObserverController) { 100 DEFINE_TRACE(IntersectionObserverController) {
101 visitor->trace(m_trackedIntersectionObservers); 101 visitor->trace(m_trackedIntersectionObservers);
102 visitor->trace(m_pendingIntersectionObservers); 102 visitor->trace(m_pendingIntersectionObservers);
103 SuspendableObject::trace(visitor); 103 SuspendableObject::trace(visitor);
104 } 104 }
105 105
106 } // namespace blink 106 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.cpp ('k') | third_party/WebKit/Source/core/dom/MutationObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698