Changeset 174799 in webkit


Ignore:
Timestamp:
Oct 16, 2014 4:39:09 PM (10 years ago)
Author:
Simon Fraser
Message:

Crash under RemoteLayerTreeHost::getLayer() when closing a tab
https://bugs.webkit.org/show_bug.cgi?id=137796
rdar://problem/18547565

Reviewed by Tim Horton.

CA can call our animation delegate after the RemoteLayerTreeHost has been
destroyed. CAAnimation retains its delegate, so it's safe for us to null out
the WKAnimationDelegate's pointer to the RemoteLayerTreeHost when tearing down
the RemoteLayerTreeHost.

  • UIProcess/mac/RemoteLayerTreeHost.mm:

(WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost):
(WebKit::RemoteLayerTreeHost::animationDidEnd):

  • WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:

(-[WKAnimationDelegate invalidate]):
(-[WKAnimationDelegate animationDidStart:]):
(-[WKAnimationDelegate animationDidStop:finished:]):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r174791 r174799  
     12014-10-16  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Crash under RemoteLayerTreeHost::getLayer() when closing a tab
     4        https://bugs.webkit.org/show_bug.cgi?id=137796
     5        rdar://problem/18547565
     6
     7        Reviewed by Tim Horton.
     8       
     9        CA can call our animation delegate after the RemoteLayerTreeHost has been
     10        destroyed. CAAnimation retains its delegate, so it's safe for us to null out
     11        the WKAnimationDelegate's pointer to the RemoteLayerTreeHost when tearing down
     12        the RemoteLayerTreeHost.
     13
     14        * UIProcess/mac/RemoteLayerTreeHost.mm:
     15        (WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost):
     16        (WebKit::RemoteLayerTreeHost::animationDidEnd):
     17        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
     18        (-[WKAnimationDelegate invalidate]):
     19        (-[WKAnimationDelegate animationDidStart:]):
     20        (-[WKAnimationDelegate animationDidStop:finished:]):
     21
    1222014-10-16  Tim Horton  <timothy_horton@apple.com>
    223
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm

    r172836 r174799  
    5555RemoteLayerTreeHost::~RemoteLayerTreeHost()
    5656{
     57    for (auto& delegate : m_animationDelegates.values())
     58        [delegate.get() invalidate];
     59
    5760    clearLayers();
    5861}
     
    169172    if (!animationKey.isEmpty())
    170173        m_drawingArea.acceleratedAnimationDidEnd(layerID, animationKey);
    171 
    172174}
    173175
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm

    r174715 r174799  
    5555
    5656- (instancetype)initWithLayerID:(GraphicsLayer::PlatformLayerID)layerID layerTreeHost:(WebKit::RemoteLayerTreeHost*)layerTreeHost;
     57- (void)invalidate;
    5758@end
    5859
     
    6869}
    6970
     71- (void)invalidate
     72{
     73    _layerTreeHost = nullptr;
     74}
     75
    7076- (void)animationDidStart:(CAAnimation *)animation
    7177{
     78    if (!_layerTreeHost)
     79        return;
     80
    7281    bool hasExplicitBeginTime = [[animation valueForKey:WKExplicitBeginTimeFlag] boolValue];
    7382    CFTimeInterval startTime;
     
    8594- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)finished
    8695{
     96    if (!_layerTreeHost)
     97        return;
     98
    8799    _layerTreeHost->animationDidEnd(_layerID, animation);
    88100}
Note: See TracChangeset for help on using the changeset viewer.