| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // if the document has no content we can falsely think the frame is invisible. | 302 // if the document has no content we can falsely think the frame is invisible. |
| 303 // Note that this means we cannot throttle top-level frames or (currently) | 303 // Note that this means we cannot throttle top-level frames or (currently) |
| 304 // frames whose owner element is remote. | 304 // frames whose owner element is remote. |
| 305 Element* targetElement = frame().deprecatedLocalOwner(); | 305 Element* targetElement = frame().deprecatedLocalOwner(); |
| 306 if (!targetElement) | 306 if (!targetElement) |
| 307 return; | 307 return; |
| 308 | 308 |
| 309 m_visibilityObserver = new ElementVisibilityObserver( | 309 m_visibilityObserver = new ElementVisibilityObserver( |
| 310 targetElement, WTF::bind( | 310 targetElement, WTF::bind( |
| 311 [](FrameView* frameView, bool isVisible) { | 311 [](FrameView* frameView, bool isVisible) { |
| 312 if (!frameView) |
| 313 return; |
| 312 frameView->updateRenderThrottlingStatus( | 314 frameView->updateRenderThrottlingStatus( |
| 313 !isVisible, frameView->m_subtreeThrottled); | 315 !isVisible, frameView->m_subtreeThrottled); |
| 314 frameView->maybeRecordLoadReason(); | 316 frameView->maybeRecordLoadReason(); |
| 315 }, | 317 }, |
| 316 wrapWeakPersistent(this))); | 318 wrapWeakPersistent(this))); |
| 317 m_visibilityObserver->start(); | 319 m_visibilityObserver->start(); |
| 318 } | 320 } |
| 319 | 321 |
| 320 void FrameView::dispose() { | 322 void FrameView::dispose() { |
| 321 RELEASE_ASSERT(!isInPerformLayout()); | 323 RELEASE_ASSERT(!isInPerformLayout()); |
| (...skipping 4376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4698 DCHECK(m_frame->isMainFrame()); | 4700 DCHECK(m_frame->isMainFrame()); |
| 4699 return m_initialViewportSize.width(); | 4701 return m_initialViewportSize.width(); |
| 4700 } | 4702 } |
| 4701 | 4703 |
| 4702 int FrameView::initialViewportHeight() const { | 4704 int FrameView::initialViewportHeight() const { |
| 4703 DCHECK(m_frame->isMainFrame()); | 4705 DCHECK(m_frame->isMainFrame()); |
| 4704 return m_initialViewportSize.height(); | 4706 return m_initialViewportSize.height(); |
| 4705 } | 4707 } |
| 4706 | 4708 |
| 4707 } // namespace blink | 4709 } // namespace blink |
| OLD | NEW |