Changeset 240045 in webkit


Ignore:
Timestamp:
Jan 16, 2019 12:35:09 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=193468
<rdar://problem/38645869>

Reviewed by Zalan Bujtas.

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
Adjust the null-check a bit; Zalan pointed out that the layout could
be responsible for the Frame/RenderView going away, so we should bail
*after* layout, not before.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r240032 r240045  
     12019-01-16  Tim Horton  <timothy_horton@apple.com>
     2
     3        Frequent null-deref under TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded()
     4        https://bugs.webkit.org/show_bug.cgi?id=193468
     5        <rdar://problem/38645869>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     10        (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
     11        Adjust the null-check a bit; Zalan pointed out that the layout could
     12        be responsible for the Frame/RenderView going away, so we should bail
     13        *after* layout, not before.
     14
    1152019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
    216
  • trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r240016 r240045  
    313313        return;
    314314
    315     if (!m_webPage.mainFrameView()->renderView())
    316         return;
    317 
    318315    LOG(Resize, "TiledCoreAnimationDrawingArea %p scaleViewToFitDocumentIfNeeded", this);
    319316    m_webPage.layoutIfNeeded();
     317
     318    if (!m_webPage.mainFrameView() || !m_webPage.mainFrameView()->renderView())
     319        return;
    320320
    321321    int viewWidth = m_webPage.size().width();
     
    365365    m_webPage.layoutIfNeeded();
    366366
     367    if (!m_webPage.mainFrameView() || !m_webPage.mainFrameView()->renderView())
     368        return;
     369
    367370    IntSize documentSize = m_webPage.mainFrameView()->renderView()->unscaledDocumentRect().size();
    368371    m_lastViewSizeForScaleToFit = m_webPage.size();
Note: See TracChangeset for help on using the changeset viewer.