| OLD | NEW |
| 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 { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // If the callback fired while DOM objects were suspended, notifications mig
ht be late, so deliver | 46 // If the callback fired while DOM objects were suspended, notifications mig
ht be late, so deliver |
| 47 // them right away (rather than waiting to fire again). | 47 // them right away (rather than waiting to fire again). |
| 48 if (m_callbackFiredWhileSuspended) { | 48 if (m_callbackFiredWhileSuspended) { |
| 49 m_callbackFiredWhileSuspended = false; | 49 m_callbackFiredWhileSuspended = false; |
| 50 deliverIntersectionObservations(); | 50 deliverIntersectionObservations(); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 void IntersectionObserverController::handleEvent(IdleDeadline*) | 54 void IntersectionObserverController::handleEvent(IdleDeadline*) |
| 55 { | 55 { |
| 56 ASSERT(m_callbackID); | 56 DCHECK(m_callbackID); |
| 57 m_callbackID = 0; | 57 m_callbackID = 0; |
| 58 deliverIntersectionObservations(); | 58 deliverIntersectionObservations(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void IntersectionObserverController::deliverIntersectionObservations() | 61 void IntersectionObserverController::deliverIntersectionObservations() |
| 62 { | 62 { |
| 63 if (getExecutionContext()->activeDOMObjectsAreSuspended()) { | 63 if (getExecutionContext()->activeDOMObjectsAreSuspended()) { |
| 64 m_callbackFiredWhileSuspended = true; | 64 m_callbackFiredWhileSuspended = true; |
| 65 return; | 65 return; |
| 66 } | 66 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 97 | 97 |
| 98 DEFINE_TRACE(IntersectionObserverController) | 98 DEFINE_TRACE(IntersectionObserverController) |
| 99 { | 99 { |
| 100 visitor->trace(m_trackedIntersectionObservers); | 100 visitor->trace(m_trackedIntersectionObservers); |
| 101 visitor->trace(m_pendingIntersectionObservers); | 101 visitor->trace(m_pendingIntersectionObservers); |
| 102 ActiveDOMObject::trace(visitor); | 102 ActiveDOMObject::trace(visitor); |
| 103 IdleRequestCallback::trace(visitor); | 103 IdleRequestCallback::trace(visitor); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace blink | 106 } // namespace blink |
| OLD | NEW |