Changeset 164622 in webkit


Ignore:
Timestamp:
Feb 24, 2014, 6:59:18 PM (11 years ago)
Author:
Simon Fraser
Message:

Use RetainPtrs for two WKContentView data members
https://bugs.webkit.org/show_bug.cgi?id=129276

Reviewed by Benjamin Poulain.

The UITextInputTraits were leaked. Fix with RetainPtr goodness.

Rename the obscure _accessory to _formAccessoryView and
make it a RetainPtr.

Rearrange the data members of the WKContentView class extension
for better packing and readability.

  • UIProcess/ios/WKContentView.h:
  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView cleanupInteraction]):
(-[WKContentView inputAccessoryView]):
(-[WKContentView _updateAccessory]):
(-[WKContentView textInputTraits]):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r164621 r164622  
     12014-02-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Use RetainPtrs for two WKContentView data members
     4        https://bugs.webkit.org/show_bug.cgi?id=129276
     5
     6        Reviewed by Benjamin Poulain.
     7       
     8        The UITextInputTraits were leaked. Fix with RetainPtr goodness.
     9       
     10        Rename the obscure _accessory to _formAccessoryView and
     11        make it a RetainPtr.
     12       
     13        Rearrange the data members of the WKContentView class extension
     14        for better packing and readability.
     15
     16        * UIProcess/ios/WKContentView.h:
     17        * UIProcess/ios/WKContentViewInteraction.h:
     18        * UIProcess/ios/WKContentViewInteraction.mm:
     19        (-[WKContentView cleanupInteraction]):
     20        (-[WKContentView inputAccessoryView]):
     21        (-[WKContentView _updateAccessory]):
     22        (-[WKContentView textInputTraits]):
     23
    1242014-02-24  Simon Fraser  <simon.fraser@apple.com>
    225
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h

    r164621 r164622  
    7272@interface WKContentView () {
    7373    RetainPtr<UIWebTouchEventsGestureRecognizer> _touchEventGestureRecognizer;
     74
    7475    BOOL _canSendTouchEventsAsynchronously;
    7576    unsigned _nativeWebTouchEventUniqueIdBeingSentSynchronously;
     
    8586    RetainPtr<UIWKSelectionAssistant> _webSelectionAssistant;
    8687
    87     UITextInputTraits *_traits;
     88    RetainPtr<UITextInputTraits> _traits;
     89    RetainPtr<UIWebFormAccessory> _formAccessoryView;
     90    RetainPtr<_UIHighlightView> _highlightView;
     91    RetainPtr<NSString> _markedText;
     92    RetainPtr<WKActionSheetAssistant> _actionSheetAssistant;
     93
     94    id <UITextInputDelegate> _inputDelegate;
     95
     96    uint64_t _latestTapHighlightID;
     97
     98    WebKit::WKAutoCorrectionData _autocorrectionData;
     99    WebKit::InteractionInformationAtPosition _positionInformation;
     100
    88101    BOOL _isEditable;
    89     UIWebFormAccessory *_accessory;
    90     id <UITextInputDelegate> _inputDelegate;
    91102    BOOL _showingTextStyleOptions;
    92 
    93     RetainPtr<_UIHighlightView> _highlightView;
    94     uint64_t _latestTapHighlightID;
     103    BOOL _hasValidPositionInformation;
    95104    BOOL _isTapHighlightIDValid;
    96     WebKit::WKAutoCorrectionData _autocorrectionData;
    97     RetainPtr<NSString> _markedText;
    98     WebKit::InteractionInformationAtPosition _positionInformation;
    99     BOOL _hasValidPositionInformation;
    100     RetainPtr<WKActionSheetAssistant> _actionSheetAssistant;
    101105}
    102106
     
    106110
    107111@property (nonatomic, readonly) BOOL isEditable;
     112@property (nonatomic, readonly) const WebKit::InteractionInformationAtPosition& positionInformation;
     113@property (nonatomic, readonly) const WebKit::WKAutoCorrectionData& autocorrectionData;
    108114
    109115- (void)setupInteraction;
     
    126132- (void)_didUpdateBlockSelectionWithTouch:(WebKit::WKSelectionTouch)touch withFlags:(WebKit::WKSelectionFlags)flags growThreshold:(CGFloat)growThreshold shrinkThreshold:(CGFloat)shrinkThreshold;
    127133
    128 @property (readonly, nonatomic) const WebKit::InteractionInformationAtPosition& positionInformation;
    129 @property (readonly, nonatomic) const WebKit::WKAutoCorrectionData& autocorrectionData;
    130 
    131134@end
  • trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm

    r164621 r164622  
    185185    [_longPressGestureRecognizer setDelegate:nil];
    186186    [_twoFingerPanGestureRecognizer setDelegate:nil];
    187 
    188     [_accessory release];
    189187}
    190188
     
    678676        return nil;
    679677   
    680     if (!_accessory) {
    681         _accessory = [[UIWebFormAccessory alloc] init];
    682         _accessory.delegate = self;
     678    if (!_formAccessoryView) {
     679        _formAccessoryView = adoptNS([[UIWebFormAccessory alloc] init]);
     680        [_formAccessoryView setDelegate:self];
    683681    }
    684682   
    685     return _accessory;
     683    return _formAccessoryView.get();
    686684}
    687685
     
    12271225{
    12281226    // FIXME: We need to initialize with values from the WebProcess.
    1229     _accessory.nextEnabled = YES;
    1230     _accessory.previousEnabled = YES;
     1227    [_formAccessoryView setNextEnabled:YES];
     1228    [_formAccessoryView setPreviousEnabled:YES];
    12311229   
    1232     [_accessory setClearVisible:NO];
     1230    [_formAccessoryView setClearVisible:NO];
    12331231
    12341232    // FIXME: hide or show the AutoFill button as needed.
     
    14111409{
    14121410    if (!_traits)
    1413         _traits = [[UITextInputTraits alloc] init];
    1414     return _traits;
     1411        _traits = adoptNS([[UITextInputTraits alloc] init]);
     1412
     1413    return _traits.get();
    14151414}
    14161415
Note: See TracChangeset for help on using the changeset viewer.