| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 4252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4263 void FrameView::notifyRenderThrottlingObserversForTesting() | 4263 void FrameView::notifyRenderThrottlingObserversForTesting() |
| 4264 { | 4264 { |
| 4265 DCHECK(m_renderThrottlingObserverNotificationFactory->isPending()); | 4265 DCHECK(m_renderThrottlingObserverNotificationFactory->isPending()); |
| 4266 notifyRenderThrottlingObservers(); | 4266 notifyRenderThrottlingObservers(); |
| 4267 } | 4267 } |
| 4268 | 4268 |
| 4269 void FrameView::notifyRenderThrottlingObservers() | 4269 void FrameView::notifyRenderThrottlingObservers() |
| 4270 { | 4270 { |
| 4271 TRACE_EVENT0("blink", "FrameView::notifyRenderThrottlingObservers"); | 4271 TRACE_EVENT0("blink", "FrameView::notifyRenderThrottlingObservers"); |
| 4272 DCHECK(!isInPerformLayout()); | 4272 DCHECK(!isInPerformLayout()); |
| 4273 DCHECK(!m_frame->document() || !m_frame->document()->inStyleRecalc()); | 4273 DCHECK(frame().document()); |
| 4274 DCHECK(!frame().document()->inStyleRecalc()); |
| 4274 bool wasThrottled = canThrottleRendering(); | 4275 bool wasThrottled = canThrottleRendering(); |
| 4275 | 4276 |
| 4276 updateThrottlingStatus(); | 4277 updateThrottlingStatus(); |
| 4277 | 4278 |
| 4279 frame().document()->onVisibilityMaybeChanged(!m_hiddenForThrottling); |
| 4280 |
| 4278 bool becameThrottled = !wasThrottled && canThrottleRendering(); | 4281 bool becameThrottled = !wasThrottled && canThrottleRendering(); |
| 4279 bool becameUnthrottled = wasThrottled && !canThrottleRendering(); | 4282 bool becameUnthrottled = wasThrottled && !canThrottleRendering(); |
| 4280 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(); | 4283 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(); |
| 4281 if (becameThrottled) { | 4284 if (becameThrottled) { |
| 4282 // If this FrameView became throttled, we must make sure all of its | 4285 // If this FrameView became throttled, we must make sure all of its |
| 4283 // children become throttled at the same time. Otherwise we might | 4286 // children become throttled at the same time. Otherwise we might |
| 4284 // attempt to paint one of the children with an out-of-date layout | 4287 // attempt to paint one of the children with an out-of-date layout |
| 4285 // before |notifyRenderThrottlingObservers| has made it throttled. | 4288 // before |notifyRenderThrottlingObservers| has made it throttled. |
| 4286 forAllNonThrottledFrameViews([](FrameView& frameView) { | 4289 forAllNonThrottledFrameViews([](FrameView& frameView) { |
| 4287 frameView.m_subtreeThrottled = true; | 4290 frameView.m_subtreeThrottled = true; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4323 } | 4326 } |
| 4324 | 4327 |
| 4325 bool FrameView::canThrottleRendering() const | 4328 bool FrameView::canThrottleRendering() const |
| 4326 { | 4329 { |
| 4327 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4330 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
| 4328 return false; | 4331 return false; |
| 4329 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4332 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
| 4330 } | 4333 } |
| 4331 | 4334 |
| 4332 } // namespace blink | 4335 } // namespace blink |
| OLD | NEW |