Title: [173029] trunk/Source/WebKit2
Revision
173029
Author
[email protected]
Date
2014-08-27 16:00:55 -0700 (Wed, 27 Aug 2014)

Log Message

Occasional crashes in commitTransientZoom's transaction completion block
https://bugs.webkit.org/show_bug.cgi?id=136309
<rdar://problem/17215064>

Reviewed by Dan Bernstein.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
Hold a reference to zoomLayer and the WebPage. It's possible that either
of these things could have gone away by the time the transaction is committed.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (173028 => 173029)


--- trunk/Source/WebKit2/ChangeLog	2014-08-27 22:56:06 UTC (rev 173028)
+++ trunk/Source/WebKit2/ChangeLog	2014-08-27 23:00:55 UTC (rev 173029)
@@ -1,3 +1,16 @@
+2014-08-27  Tim Horton  <[email protected]>
+
+        Occasional crashes in commitTransientZoom's transaction completion block
+        https://bugs.webkit.org/show_bug.cgi?id=136309
+        <rdar://problem/17215064>
+
+        Reviewed by Dan Bernstein.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
+        Hold a reference to zoomLayer and the WebPage. It's possible that either
+        of these things could have gone away by the time the transaction is committed.
+
 2014-08-27  Benjamin Poulain  <[email protected]>
 
         [iOS WK2] Provide a delegate callback to skip Geolocation authorization per page for WebApp

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (173028 => 173029)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2014-08-27 22:56:06 UTC (rev 173028)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2014-08-27 23:00:55 UTC (rev 173029)
@@ -637,14 +637,17 @@
     if (PlatformCALayer* shadowLayer = shadowLayerForTransientZoom())
         shadowCALayer = shadowLayer->platformLayer();
 
-    PlatformCALayer* zoomLayer = layerForTransientZoom();
+    RefPtr<PlatformCALayer> zoomLayer = layerForTransientZoom();
+    RefPtr<WebPage> page = &m_webPage;
 
     [CATransaction begin];
-    [CATransaction setCompletionBlock:^(void) {
+    [CATransaction setCompletionBlock:[zoomLayer, shadowCALayer, page, scale, origin] () {
         zoomLayer->removeAnimationForKey("transientZoomCommit");
         if (shadowCALayer)
             [shadowCALayer removeAllAnimations];
-        applyTransientZoomToPage(scale, origin);
+
+        if (TiledCoreAnimationDrawingArea* drawingArea = static_cast<TiledCoreAnimationDrawingArea*>(page->drawingArea()))
+            drawingArea->applyTransientZoomToPage(scale, origin);
     }];
 
     zoomLayer->addAnimationForKey("transientZoomCommit", renderViewAnimation.get());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to