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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 613043005: OOPIF: Check whether localFrameRootTemporary is valid when processing resizing messages (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove comment Created 6 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 | « 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 } 1705 }
1706 1706
1707 void WebViewImpl::setTopControlsLayoutHeight(float height) 1707 void WebViewImpl::setTopControlsLayoutHeight(float height)
1708 { 1708 {
1709 m_topControlsLayoutHeight = height; 1709 m_topControlsLayoutHeight = height;
1710 didUpdateTopControls(); 1710 didUpdateTopControls();
1711 } 1711 }
1712 1712
1713 void WebViewImpl::didUpdateTopControls() 1713 void WebViewImpl::didUpdateTopControls()
1714 { 1714 {
1715 FrameView* view = localFrameRootTemporary()->frameView(); 1715 WebLocalFrameImpl* localFrameRoot = localFrameRootTemporary();
1716 if (!localFrameRoot)
1717 return;
1718
1719 FrameView* view = localFrameRoot->frameView();
1716 if (!view) 1720 if (!view)
1717 return; 1721 return;
1718 1722
1719 // The viewport bounds were adjusted on the compositor by this much due to t op controls. Tell 1723 // The viewport bounds were adjusted on the compositor by this much due to t op controls. Tell
1720 // the FrameView about it so it can make correct scroll offset clamping deci sions during compositor 1724 // the FrameView about it so it can make correct scroll offset clamping deci sions during compositor
1721 // commits. 1725 // commits.
1722 float topControlsViewportAdjustment = m_topControlsContentOffset - m_topCont rolsLayoutHeight; 1726 float topControlsViewportAdjustment = m_topControlsContentOffset - m_topCont rolsLayoutHeight;
1723 view->setTopControlsViewportAdjustment(topControlsViewportAdjustment); 1727 view->setTopControlsViewportAdjustment(topControlsViewportAdjustment);
1724 } 1728 }
1725 1729
1726 void WebViewImpl::resize(const WebSize& newSize) 1730 void WebViewImpl::resize(const WebSize& newSize)
1727 { 1731 {
1728 if (m_shouldAutoResize || m_size == newSize) 1732 if (m_shouldAutoResize || m_size == newSize)
1729 return; 1733 return;
1730 1734
1731 FrameView* view = localFrameRootTemporary()->frameView(); 1735 WebLocalFrameImpl* localFrameRoot = localFrameRootTemporary();
1736 if (!localFrameRoot)
1737 return;
1738
1739 FrameView* view = localFrameRoot->frameView();
1732 if (!view) 1740 if (!view)
1733 return; 1741 return;
1734 1742
1735 bool shouldAnchorAndRescaleViewport = settings()->mainFrameResizesAreOrienta tionChanges() 1743 bool shouldAnchorAndRescaleViewport = settings()->mainFrameResizesAreOrienta tionChanges()
1736 && m_size.width && contentsSize().width() && newSize.width != m_size.wid th && !m_fullscreenController->isFullscreen(); 1744 && m_size.width && contentsSize().width() && newSize.width != m_size.wid th && !m_fullscreenController->isFullscreen();
1737 float oldPageScaleFactor = pageScaleFactor(); 1745 float oldPageScaleFactor = pageScaleFactor();
1738 float oldMinimumPageScaleFactor = minimumPageScaleFactor(); 1746 float oldMinimumPageScaleFactor = minimumPageScaleFactor();
1739 1747
1740 m_size = newSize; 1748 m_size = newSize;
1741 1749
(...skipping 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after
4443 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4451 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4444 4452
4445 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4453 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4446 return false; 4454 return false;
4447 4455
4448 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4456 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4449 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4457 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4450 } 4458 }
4451 4459
4452 } // namespace blink 4460 } // 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