Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor)
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 May 2014 18:19:03 +0000 (18:19 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 May 2014 18:19:03 +0000 (18:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133370
<rdar://problem/17061361>

Reviewed by Anders Carlsson.

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::didUpdate):
Copy the set of refresh monitors so that we don't try to mutate the list we're iterating,
and don't try to fire refresh monitors that were removed in a previous iteration of the loop.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169456 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm

index ccee083..8a5dc62 100644 (file)
@@ -1,5 +1,18 @@
 2014-05-29  Timothy Horton  <timothy_horton@apple.com>
 
+        Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor)
+        https://bugs.webkit.org/show_bug.cgi?id=133370
+        <rdar://problem/17061361>
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
+        Copy the set of refresh monitors so that we don't try to mutate the list we're iterating,
+        and don't try to fire refresh monitors that were removed in a previous iteration of the loop.
+
+2014-05-29  Timothy Horton  <timothy_horton@apple.com>
+
         REGRESSION (iOS WebKit2): Find-in-Page doesn't work in subframes
         https://bugs.webkit.org/show_bug.cgi?id=133372
         <rdar://problem/17045070>
index f5df88e..bbf2235 100644 (file)
@@ -330,8 +330,15 @@ void RemoteLayerTreeDrawingArea::didUpdate()
     [CATransaction begin];
     [CATransaction commit];
 
+    Vector<RemoteLayerTreeDisplayRefreshMonitor*> monitors;
+    monitors.reserveCapacity(m_displayRefreshMonitors.size());
     for (auto& monitor : m_displayRefreshMonitors)
-        monitor->didUpdateLayers();
+        monitors.append(monitor);
+    for (auto& monitor : monitors) {
+        // The monitor might have been removed by an earlier didUpdateLayers callback.
+        if (m_displayRefreshMonitors.contains(monitor))
+            monitor->didUpdateLayers();
+    }
 }
 
 void RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged(const IntSize& contentsSize)