Changeset 262028 in webkit


Ignore:
Timestamp:
May 21, 2020 2:20:53 PM (4 years ago)
Author:
Simon Fraser
Message:

Fix rare crash in TileGrid::platformCALayerShowRepaintCounter()
https://bugs.webkit.org/show_bug.cgi?id=212182
<rdar://problem/55618414>

Reviewed by Darin Adler.

Crash data suggest that owner() can be null in platformCALayerShowRepaintCounter(),
so null-check in these functions.

  • platform/graphics/ca/TileGrid.cpp:

(WebCore::TileGrid::platformCALayerDeviceScaleFactor const):
(WebCore::TileGrid::platformCALayerShowDebugBorders const):
(WebCore::TileGrid::platformCALayerShowRepaintCounter const):
(WebCore::TileGrid::isUsingDisplayListDrawing const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r262026 r262028  
     12020-05-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix rare crash in TileGrid::platformCALayerShowRepaintCounter()
     4        https://bugs.webkit.org/show_bug.cgi?id=212182
     5        <rdar://problem/55618414>
     6
     7        Reviewed by Darin Adler.
     8
     9        Crash data suggest that owner() can be null in platformCALayerShowRepaintCounter(),
     10        so null-check in these functions.
     11
     12        * platform/graphics/ca/TileGrid.cpp:
     13        (WebCore::TileGrid::platformCALayerDeviceScaleFactor const):
     14        (WebCore::TileGrid::platformCALayerShowDebugBorders const):
     15        (WebCore::TileGrid::platformCALayerShowRepaintCounter const):
     16        (WebCore::TileGrid::isUsingDisplayListDrawing const):
     17
    1182020-05-21  Youenn Fablet  <youenn@apple.com>
    219
  • trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp

    r252962 r262028  
    749749float TileGrid::platformCALayerDeviceScaleFactor() const
    750750{
    751     return m_controller.rootLayer().owner()->platformCALayerDeviceScaleFactor();
     751    if (auto* layerOwner = m_controller.rootLayer().owner())
     752        return layerOwner->platformCALayerDeviceScaleFactor();
     753    return 1.0f;
    752754}
    753755
    754756bool TileGrid::platformCALayerShowDebugBorders() const
    755757{
    756     return m_controller.rootLayer().owner()->platformCALayerShowDebugBorders();
     758    if (auto* layerOwner = m_controller.rootLayer().owner())
     759        return layerOwner->platformCALayerShowDebugBorders();
     760    return false;
    757761}
    758762
    759763bool TileGrid::platformCALayerShowRepaintCounter(PlatformCALayer*) const
    760764{
    761     return m_controller.rootLayer().owner()->platformCALayerShowRepaintCounter(nullptr);
     765    if (auto* layerOwner = m_controller.rootLayer().owner())
     766        return layerOwner->platformCALayerShowRepaintCounter(nullptr);
     767    return false;
    762768}
    763769
    764770bool TileGrid::isUsingDisplayListDrawing(PlatformCALayer*) const
    765771{
    766     return m_controller.rootLayer().owner()->isUsingDisplayListDrawing(nullptr);
     772    if (auto* layerOwner = m_controller.rootLayer().owner())
     773        return layerOwner->isUsingDisplayListDrawing(nullptr);
     774    return false;
    767775}
    768776
Note: See TracChangeset for help on using the changeset viewer.