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

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

Issue 2415013002: Don't throttle disposed FrameViews (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 m_safeToPropagateScrollToParent(true), 163 m_safeToPropagateScrollToParent(true),
164 m_scrollCorner(nullptr), 164 m_scrollCorner(nullptr),
165 m_stickyPositionObjectCount(0), 165 m_stickyPositionObjectCount(0),
166 m_inputEventsScaleFactorForEmulation(1), 166 m_inputEventsScaleFactorForEmulation(1),
167 m_layoutSizeFixedToFrameSize(true), 167 m_layoutSizeFixedToFrameSize(true),
168 m_didScrollTimer(this, &FrameView::didScrollTimerFired), 168 m_didScrollTimer(this, &FrameView::didScrollTimerFired),
169 m_topControlsViewportAdjustment(0), 169 m_topControlsViewportAdjustment(0),
170 m_needsUpdateWidgetGeometries(false), 170 m_needsUpdateWidgetGeometries(false),
171 m_needsUpdateViewportIntersection(true), 171 m_needsUpdateViewportIntersection(true),
172 m_needsUpdateViewportIntersectionInSubtree(true), 172 m_needsUpdateViewportIntersectionInSubtree(true),
173 #if ENABLE(ASSERT)
174 m_hasBeenDisposed(false), 173 m_hasBeenDisposed(false),
175 #endif
176 m_horizontalScrollbarMode(ScrollbarAuto), 174 m_horizontalScrollbarMode(ScrollbarAuto),
177 m_verticalScrollbarMode(ScrollbarAuto), 175 m_verticalScrollbarMode(ScrollbarAuto),
178 m_horizontalScrollbarLock(false), 176 m_horizontalScrollbarLock(false),
179 m_verticalScrollbarLock(false), 177 m_verticalScrollbarLock(false),
180 m_scrollbarsSuppressed(false), 178 m_scrollbarsSuppressed(false),
181 m_inUpdateScrollbars(false), 179 m_inUpdateScrollbars(false),
182 m_frameTimingRequestsDirty(true), 180 m_frameTimingRequestsDirty(true),
183 m_viewportIntersectionValid(false), 181 m_viewportIntersectionValid(false),
184 m_hiddenForThrottling(false), 182 m_hiddenForThrottling(false),
185 m_crossOriginForThrottling(false), 183 m_crossOriginForThrottling(false),
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 310
313 m_renderThrottlingObserverNotificationFactory->cancel(); 311 m_renderThrottlingObserverNotificationFactory->cancel();
314 312
315 // FIXME: Do we need to do something here for OOPI? 313 // FIXME: Do we need to do something here for OOPI?
316 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner(); 314 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
317 // TODO(dcheng): It seems buggy that we can have an owner element that 315 // TODO(dcheng): It seems buggy that we can have an owner element that
318 // points to another Widget. 316 // points to another Widget.
319 if (ownerElement && ownerElement->ownedWidget() == this) 317 if (ownerElement && ownerElement->ownedWidget() == this)
320 ownerElement->setWidget(nullptr); 318 ownerElement->setWidget(nullptr);
321 319
322 #if ENABLE(ASSERT)
323 m_hasBeenDisposed = true; 320 m_hasBeenDisposed = true;
324 #endif
325 } 321 }
326 322
327 void FrameView::detachScrollbars() { 323 void FrameView::detachScrollbars() {
328 // Previously, we detached custom scrollbars as early as possible to prevent 324 // Previously, we detached custom scrollbars as early as possible to prevent
329 // Document::detachLayoutTree() from messing with the view such that its 325 // Document::detachLayoutTree() from messing with the view such that its
330 // scroll bars won't be torn down. However, scripting in 326 // scroll bars won't be torn down. However, scripting in
331 // Document::detachLayoutTree() is forbidden 327 // Document::detachLayoutTree() is forbidden
332 // now, so it's not clear if these edge cases can still happen. 328 // now, so it's not clear if these edge cases can still happen.
333 // However, for Oilpan, we still need to remove the native scrollbars before 329 // However, for Oilpan, we still need to remove the native scrollbars before
334 // we lose the connection to the HostWindow, so we just unconditionally 330 // we lose the connection to the HostWindow, so we just unconditionally
(...skipping 4131 matching lines...) Expand 10 before | Expand all | Expand 10 after
4466 parent = parent->parentFrameView(); 4462 parent = parent->parentFrameView();
4467 } 4463 }
4468 #endif 4464 #endif
4469 } 4465 }
4470 4466
4471 bool FrameView::shouldThrottleRendering() const { 4467 bool FrameView::shouldThrottleRendering() const {
4472 return canThrottleRendering() && lifecycle().throttlingAllowed(); 4468 return canThrottleRendering() && lifecycle().throttlingAllowed();
4473 } 4469 }
4474 4470
4475 bool FrameView::canThrottleRendering() const { 4471 bool FrameView::canThrottleRendering() const {
4472 if (m_hasBeenDisposed)
4473 return false;
4476 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4474 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4477 return false; 4475 return false;
4478 return m_subtreeThrottled || 4476 return m_subtreeThrottled ||
4479 (m_hiddenForThrottling && m_crossOriginForThrottling); 4477 (m_hiddenForThrottling && m_crossOriginForThrottling);
4480 } 4478 }
4481 4479
4482 } // namespace blink 4480 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698