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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2560803002: Don't assume a FrameHost from FrameView. (Closed)
Patch Set: Patch 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/plugins/update-plugin-after-detachment-crash.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 7d57db8ba1101988585e2c7c2cab6fa1d7b7b5f2..e8c6d1df8f0bcbf32caf5c34e57db0ce57c31ee0 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -329,9 +329,11 @@ void FrameView::dispose() {
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
scrollingCoordinator->willDestroyScrollableArea(this);
- FrameHost* frameHost = m_frame->host();
- DCHECK(frameHost);
- frameHost->globalRootScrollerController().didDisposeScrollableArea(*this);
+ // We need to check for host since there are situations where a plugin may
+ // get updated after its been detached. See crbug.com/671331 for details.
+ // This should be ok since plugins can't become the root scroller.
+ if (FrameHost* frameHost = m_frame->host())
dcheng 2016/12/12 21:32:46 What's the stack where we hit this and it's null?
+ frameHost->globalRootScrollerController().didDisposeScrollableArea(*this);
// We need to clear the RootFrameViewport's animator since it gets called
// from non-GC'd objects and RootFrameViewport will still have a pointer to
@@ -530,9 +532,6 @@ void FrameView::setFrameRect(const IntRect& newRect) {
viewportSizeChanged(newRect.width() != oldRect.width(),
newRect.height() != oldRect.height());
- if (m_frame->isMainFrame())
- m_frame->host()->visualViewport().mainFrameDidChangeSize();
-
frame().loader().restoreScrollPositionAndViewState();
}
}
@@ -1535,13 +1534,14 @@ void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) {
layoutView.compositor()->frameViewDidChangeSize();
}
- // Ensure the root scroller compositing layers update geometry in response to
- // the URL bar resizing.
- if (m_frame->isMainFrame()) {
- m_frame->document()
- ->frameHost()
- ->globalRootScrollerController()
- .mainFrameViewResized();
+ // We need to check for host since there are situations where a plugin may
+ // get updated after its been detached. See crbug.com/671331 for details.
+ if (m_frame->isMainFrame() && m_frame->host()) {
+ // Ensure the root scroller compositing layers update geometry in response
+ // to the URL bar resizing.
+ m_frame->host()->globalRootScrollerController().mainFrameViewResized();
+
+ m_frame->host()->visualViewport().mainFrameDidChangeSize();
}
showOverlayScrollbars();
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/plugins/update-plugin-after-detachment-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698