Fix crash when reloading a page using requestAnimationFrame on iOS
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2016 21:32:38 +0000 (21:32 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2016 21:32:38 +0000 (21:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155465
rdar://problem/25100202

Reviewed by Tim Horton.

On iOS, it's possible for all clients for a DisplayRefreshMonitor
to be unregistered, but still get a subsequent displayDidRefresh() for that monitor.
In this case, we would remove(notFound) which release-asserts.

Fix by just checking for notFound.

Unable to test because requestAnimationFrame doesn't work in the simulator.

* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayDidRefresh):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp

index 1afa08f..65f9a9b 100644 (file)
@@ -1,3 +1,22 @@
+2016-03-14  Simon Fraser  <simon.fraser@apple.com>
+
+        Fix crash when reloading a page using requestAnimationFrame on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=155465
+        rdar://problem/25100202
+
+        Reviewed by Tim Horton.
+
+        On iOS, it's possible for all clients for a DisplayRefreshMonitor
+        to be unregistered, but still get a subsequent displayDidRefresh() for that monitor.
+        In this case, we would remove(notFound) which release-asserts.
+        
+        Fix by just checking for notFound.
+        
+        Unable to test because requestAnimationFrame doesn't work in the simulator.
+
+        * platform/graphics/DisplayRefreshMonitorManager.cpp:
+        (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
+
 2016-03-14  Per Arne Vollan  <peavo@outlook.com>
 
         [WinCairo][MediaFoundation] Implement float versions of MediaPlayer methods.
index 8452140..9782d28 100644 (file)
@@ -109,8 +109,8 @@ void DisplayRefreshMonitorManager::displayDidRefresh(DisplayRefreshMonitor& moni
         return;
 
     size_t monitorIndex = m_monitors.find(&monitor);
-    ASSERT(monitorIndex != notFound);
-    m_monitors.remove(monitorIndex);
+    if (monitorIndex != notFound)
+        m_monitors.remove(monitorIndex);
 }
 
 void DisplayRefreshMonitorManager::windowScreenDidChange(PlatformDisplayID displayID, DisplayRefreshMonitorClient& client)