Title: [261495] trunk/Source/WebKit
Revision
261495
Author
[email protected]
Date
2020-05-11 15:13:01 -0700 (Mon, 11 May 2020)

Log Message

Fix possible crash in ViewGestureController on macOS
https://bugs.webkit.org/show_bug.cgi?id=211745

Reviewed by Tim Horton.

When ViewGestureController::resetState() clears m_swipeCancellationTracker, it should set it to canceled so that
any pending -trackSwipeEventWithOptions:... which is holding a reference to the WKSwipeCancellationTracker knows
to stop.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::resetState):
(WebKit::ViewGestureController::reset):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (261494 => 261495)


--- trunk/Source/WebKit/ChangeLog	2020-05-11 21:51:26 UTC (rev 261494)
+++ trunk/Source/WebKit/ChangeLog	2020-05-11 22:13:01 UTC (rev 261495)
@@ -1,3 +1,18 @@
+2020-05-11  Simon Fraser  <[email protected]>
+
+        Fix possible crash in ViewGestureController on macOS
+        https://bugs.webkit.org/show_bug.cgi?id=211745
+
+        Reviewed by Tim Horton.
+
+        When ViewGestureController::resetState() clears m_swipeCancellationTracker, it should set it to canceled so that
+        any pending -trackSwipeEventWithOptions:... which is holding a reference to the WKSwipeCancellationTracker knows
+        to stop.
+
+        * UIProcess/mac/ViewGestureControllerMac.mm:
+        (WebKit::ViewGestureController::resetState):
+        (WebKit::ViewGestureController::reset):
+
 2020-05-11  Peng Liu  <[email protected]>
 
         Enable the mock video presentation mode in related layout tests and fix test failures

Modified: trunk/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm (261494 => 261495)


--- trunk/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm	2020-05-11 21:51:26 UTC (rev 261494)
+++ trunk/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm	2020-05-11 22:13:01 UTC (rev 261495)
@@ -618,6 +618,10 @@
         m_currentSwipeSnapshot->setVolatile(true);
     m_currentSwipeSnapshot = nullptr;
 
+    if (m_swipeCancellationTracker)
+        [m_swipeCancellationTracker setIsCancelled:YES];
+    m_swipeCancellationTracker = nil;
+
     for (const auto& layer : m_currentSwipeLiveLayers)
         [layer setTransform:CATransform3DIdentity];
 
@@ -646,7 +650,6 @@
 {
     removeSwipeSnapshot();
     resetState();
-    m_swipeCancellationTracker = nil; // FIXME: Move to reset state()?
 }
 
 double ViewGestureController::magnification() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to