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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2591243002: FrameView: Don't try to update the throttling status of a deleted frame (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698