Title: [287619] branches/safari-612-branch/Source/WebKit
- Revision
- 287619
- Author
- repst...@apple.com
- Date
- 2022-01-05 10:20:36 -0800 (Wed, 05 Jan 2022)
Log Message
Cherry-pick r285431. rdar://problem/87124705
WKSyntheticTapGestureRecognizer's action targets should be weak pointers
https://bugs.webkit.org/show_bug.cgi?id=232812
Reviewed by Tim Horton.
Make WKSyntheticTapGestureRecognizer robust against the case where it outlives its WKContentView, by making its
"reset", "gesture identified", and "gesture failed" targets weak pointers instead of raw pointers.
* UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
(-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
Drive-by fix: we can also make `_lastTouchedScrollView` use the __weak ivar attribute instead of WeakObjCPtr,
now that __weak is enabled in WebKit2.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-612-branch/Source/WebKit/ChangeLog (287618 => 287619)
--- branches/safari-612-branch/Source/WebKit/ChangeLog 2022-01-05 18:20:33 UTC (rev 287618)
+++ branches/safari-612-branch/Source/WebKit/ChangeLog 2022-01-05 18:20:36 UTC (rev 287619)
@@ -1,3 +1,39 @@
+2022-01-05 Russell Epstein <repst...@apple.com>
+
+ Cherry-pick r285431. rdar://problem/87124705
+
+ WKSyntheticTapGestureRecognizer's action targets should be weak pointers
+ https://bugs.webkit.org/show_bug.cgi?id=232812
+
+ Reviewed by Tim Horton.
+
+ Make WKSyntheticTapGestureRecognizer robust against the case where it outlives its WKContentView, by making its
+ "reset", "gesture identified", and "gesture failed" targets weak pointers instead of raw pointers.
+
+ * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
+ (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
+
+ Drive-by fix: we can also make `_lastTouchedScrollView` use the __weak ivar attribute instead of WeakObjCPtr,
+ now that __weak is enabled in WebKit2.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2021-11-08 Wenson Hsieh <wenson_hs...@apple.com>
+
+ WKSyntheticTapGestureRecognizer's action targets should be weak pointers
+ https://bugs.webkit.org/show_bug.cgi?id=232812
+
+ Reviewed by Tim Horton.
+
+ Make WKSyntheticTapGestureRecognizer robust against the case where it outlives its WKContentView, by making its
+ "reset", "gesture identified", and "gesture failed" targets weak pointers instead of raw pointers.
+
+ * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
+ (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
+
+ Drive-by fix: we can also make `_lastTouchedScrollView` use the __weak ivar attribute instead of WeakObjCPtr,
+ now that __weak is enabled in WebKit2.
+
2021-12-22 Alan Coon <alanc...@apple.com>
Cherry-pick r287366. rdar://problem/84379650
Modified: branches/safari-612-branch/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm (287618 => 287619)
--- branches/safari-612-branch/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm 2022-01-05 18:20:33 UTC (rev 287618)
+++ branches/safari-612-branch/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm 2022-01-05 18:20:36 UTC (rev 287619)
@@ -30,17 +30,16 @@
#import <UIKit/UIGestureRecognizerSubclass.h>
#import <wtf/RetainPtr.h>
-#import <wtf/WeakObjCPtr.h>
@implementation WKSyntheticTapGestureRecognizer {
- id _gestureIdentifiedTarget;
+ __weak id _gestureIdentifiedTarget;
SEL _gestureIdentifiedAction;
- id _gestureFailedTarget;
+ __weak id _gestureFailedTarget;
SEL _gestureFailedAction;
- id _resetTarget;
+ __weak id _resetTarget;
SEL _resetAction;
RetainPtr<NSNumber> _lastActiveTouchIdentifier;
- WeakObjCPtr<UIScrollView> _lastTouchedScrollView;
+ __weak UIScrollView *_lastTouchedScrollView;
}
- (void)setGestureIdentifiedTarget:(id)target action:(SEL)action
@@ -108,7 +107,7 @@
- (UIScrollView *)lastTouchedScrollView
{
- return _lastTouchedScrollView.get().get();
+ return _lastTouchedScrollView;
}
- (NSNumber*)lastActiveTouchIdentifier
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes