⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287619 in webkit


Ignore:
Timestamp:
Jan 5, 2022, 10:20:36 AM (5 years ago)
Author:
Russell Epstein
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

Location:
branches/safari-612-branch/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612-branch/Source/WebKit/ChangeLog

    r287369 r287619  
     12022-01-05  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r285431. rdar://problem/87124705
     4
     5    WKSyntheticTapGestureRecognizer's action targets should be weak pointers
     6    https://bugs.webkit.org/show_bug.cgi?id=232812
     7   
     8    Reviewed by Tim Horton.
     9   
     10    Make WKSyntheticTapGestureRecognizer robust against the case where it outlives its WKContentView, by making its
     11    "reset", "gesture identified", and "gesture failed" targets weak pointers instead of raw pointers.
     12   
     13    * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
     14    (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
     15   
     16    Drive-by fix: we can also make `_lastTouchedScrollView` use the __weak ivar attribute instead of WeakObjCPtr,
     17    now that __weak is enabled in WebKit2.
     18   
     19    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     20
     21    2021-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
     22
     23            WKSyntheticTapGestureRecognizer's action targets should be weak pointers
     24            https://bugs.webkit.org/show_bug.cgi?id=232812
     25
     26            Reviewed by Tim Horton.
     27
     28            Make WKSyntheticTapGestureRecognizer robust against the case where it outlives its WKContentView, by making its
     29            "reset", "gesture identified", and "gesture failed" targets weak pointers instead of raw pointers.
     30
     31            * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
     32            (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
     33
     34            Drive-by fix: we can also make `_lastTouchedScrollView` use the __weak ivar attribute instead of WeakObjCPtr,
     35            now that __weak is enabled in WebKit2.
     36
    1372021-12-22  Alan Coon  <alancoon@apple.com>
    238
  • branches/safari-612-branch/Source/WebKit/UIProcess/ios/WKSyntheticTapGestureRecognizer.mm

    r258888 r287619  
    3131#import <UIKit/UIGestureRecognizerSubclass.h>
    3232#import <wtf/RetainPtr.h>
    33 #import <wtf/WeakObjCPtr.h>
    3433
    3534@implementation WKSyntheticTapGestureRecognizer {
    36     id _gestureIdentifiedTarget;
     35    __weak id _gestureIdentifiedTarget;
    3736    SEL _gestureIdentifiedAction;
    38     id _gestureFailedTarget;
     37    __weak id _gestureFailedTarget;
    3938    SEL _gestureFailedAction;
    40     id _resetTarget;
     39    __weak id _resetTarget;
    4140    SEL _resetAction;
    4241    RetainPtr<NSNumber> _lastActiveTouchIdentifier;
    43     WeakObjCPtr<UIScrollView> _lastTouchedScrollView;
     42    __weak UIScrollView *_lastTouchedScrollView;
    4443}
    4544
    … …  
    109108- (UIScrollView *)lastTouchedScrollView
    110109{
    111     return _lastTouchedScrollView.get().get();
     110    return _lastTouchedScrollView;
    112111}
    113112
Note: See TracChangeset for help on using the changeset viewer.