Changeset 258681 in webkit
- Timestamp:
- Mar 18, 2020 10:18:29 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r258680 r258681 1 2020-03-18 Andres Gonzalez <andresg_22@apple.com> 2 3 Use helper function retainPtr(T*) instead of creating one. 4 https://bugs.webkit.org/show_bug.cgi?id=209269 5 6 Reviewed by Chris Fleizach. 7 8 This is acorrection to patch in bug: https://bugs.webkit.org/show_bug.cgi?id=209247. 9 Use the existing retainPtr helper funtion instead of creating a new helper. 10 11 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: 12 (-[WebAccessibilityObjectWrapper attachmentView]): 13 (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): 14 (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]): 15 (-[WebAccessibilityObjectWrapper associatedPluginParent]): 16 (-[WebAccessibilityObjectWrapper windowElement:]): 17 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): 18 (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]): 19 (-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]): 20 (-[WebAccessibilityObjectWrapper lineTextMarkerRangeForTextMarker:forUnit:]): 21 (-[WebAccessibilityObjectWrapper textMarkerForTextMarker:atUnit:]): 22 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]): 23 (retainWrapper): Deleted. 24 1 25 2020-03-18 Zalan Bujtas <zalan@apple.com> 2 26 -
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
r258673 r258681 554 554 } 555 555 556 static inline RetainPtr<WebAccessibilityObjectWrapper> retainWrapper(WebAccessibilityObjectWrapper* wrapper)557 {558 return RetainPtr<WebAccessibilityObjectWrapper>(wrapper);559 }560 561 556 - (id)attachmentView 562 557 { 563 558 ASSERT(self.axBackingObject->isAttachment()); 564 559 565 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {560 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 566 561 auto* widget = protectedSelf.get().axBackingObject->widgetForAttachmentView(); 567 562 if (!widget) … … 1253 1248 - (NSAttributedString*)doAXAttributedStringForTextMarkerRange:(id)textMarkerRange spellCheck:(BOOL)spellCheck 1254 1249 { 1255 return Accessibility::retrieveValueFromMainThread<NSAttributedString *>([&textMarkerRange, &spellCheck, protectedSelf = retain Wrapper(self)] () -> NSAttributedString * {1250 return Accessibility::retrieveValueFromMainThread<NSAttributedString *>([&textMarkerRange, &spellCheck, protectedSelf = retainPtr(self)] () -> NSAttributedString * { 1256 1251 auto* backingObject = protectedSelf.get().axBackingObject; 1257 1252 if (!backingObject) … … 1299 1294 - (id)textMarkerRangeFromVisiblePositions:(const VisiblePosition&)startPosition endPosition:(const VisiblePosition&)endPosition 1300 1295 { 1301 return Accessibility::retrieveValueFromMainThread<NSAttributedString *>([&startPosition, &endPosition, protectedSelf = retain Wrapper(self)] () -> id {1296 return Accessibility::retrieveValueFromMainThread<NSAttributedString *>([&startPosition, &endPosition, protectedSelf = retainPtr(self)] () -> id { 1302 1297 auto* backingObject = protectedSelf.get().axBackingObject; 1303 1298 if (!backingObject) … … 1920 1915 - (id)associatedPluginParent 1921 1916 { 1922 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {1917 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 1923 1918 auto* backingObject = protectedSelf.get().axBackingObject; 1924 1919 if (!backingObject || !backingObject->hasApplePDFAnnotationAttribute()) … … 2290 2285 - (id)windowElement:(NSString*)attributeName 2291 2286 { 2292 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([attributeName, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {2287 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([attributeName, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 2293 2288 id remoteParent = [protectedSelf remoteAccessibilityParentObject]; 2294 2289 if (remoteParent) { … … 2825 2820 2826 2821 if ([attributeName isEqualToString:@"AXSelectedTextMarkerRange"]) { 2827 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {2822 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 2828 2823 return [protectedSelf textMarkerRangeForSelection]; 2829 2824 }); … … 2831 2826 2832 2827 if ([attributeName isEqualToString:@"AXStartTextMarker"]) { 2833 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {2828 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 2834 2829 if (auto* backingObject = protectedSelf.get().axBackingObject) 2835 2830 return [protectedSelf textMarkerForVisiblePosition:startOfDocument(backingObject->document())]; … … 2839 2834 2840 2835 if ([attributeName isEqualToString:@"AXEndTextMarker"]) { 2841 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {2836 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 2842 2837 if (auto* backingObject = protectedSelf.get().axBackingObject) 2843 2838 return [protectedSelf textMarkerForVisiblePosition:endOfDocument(backingObject->document())]; … … 3407 3402 - (void)accessibilityShowContextMenu 3408 3403 { 3409 Accessibility::performFunctionOnMainThread([protectedSelf = retain Wrapper(self)] {3404 Accessibility::performFunctionOnMainThread([protectedSelf = retainPtr(self)] { 3410 3405 [protectedSelf _accessibilityShowContextMenu]; 3411 3406 }); … … 3784 3779 - (id)textMarkerRangeAtTextMarker:(id)textMarker forUnit:(TextUnit)textUnit 3785 3780 { 3786 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, &textUnit, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {3781 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, &textUnit, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 3787 3782 auto* backingObject = protectedSelf.get().axBackingObject; 3788 3783 if (!backingObject) … … 3819 3814 - (id)lineTextMarkerRangeForTextMarker:(id)textMarker forUnit:(TextUnit)textUnit 3820 3815 { 3821 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, &textUnit, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {3816 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, &textUnit, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 3822 3817 auto* backingObject = protectedSelf.get().axBackingObject; 3823 3818 if (!backingObject) … … 3851 3846 - (id)textMarkerForTextMarker:(id)textMarker atUnit:(TextUnit)textUnit 3852 3847 { 3853 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, &textUnit, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {3848 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, &textUnit, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 3854 3849 auto* backingObject = protectedSelf.get().axBackingObject; 3855 3850 if (!backingObject) … … 3953 3948 if ([attribute isEqualToString:NSAccessibilitySelectTextWithCriteriaParameterizedAttribute]) { 3954 3949 // To be deprecated. 3955 auto result = Accessibility::retrieveValueFromMainThread<Vector<String>>([dictionary, protectedSelf = retain Wrapper(self)] () -> Vector<String> {3950 auto result = Accessibility::retrieveValueFromMainThread<Vector<String>>([dictionary, protectedSelf = retainPtr(self)] () -> Vector<String> { 3956 3951 auto* backingObject = protectedSelf.get().axBackingObject; 3957 3952 if (!backingObject) … … 3971 3966 if ([attribute isEqualToString:NSAccessibilitySearchTextWithCriteriaParameterizedAttribute]) { 3972 3967 auto criteria = accessibilitySearchTextCriteriaForParameterizedAttribute(dictionary); 3973 return Accessibility::retrieveAutoreleasedValueFromMainThread<NSArray *>([&criteria, protectedSelf = retain Wrapper(self)] () -> RetainPtr<NSArray> {3968 return Accessibility::retrieveAutoreleasedValueFromMainThread<NSArray *>([&criteria, protectedSelf = retainPtr(self)] () -> RetainPtr<NSArray> { 3974 3969 auto* backingObject = protectedSelf.get().axBackingObject; 3975 3970 if (!backingObject) … … 3989 3984 3990 3985 if ([attribute isEqualToString:NSAccessibilityTextOperationParameterizedAttribute]) { 3991 auto operationResult = Accessibility::retrieveValueFromMainThread<Vector<String>>([dictionary, protectedSelf = retain Wrapper(self)] () -> Vector<String> {3986 auto operationResult = Accessibility::retrieveValueFromMainThread<Vector<String>>([dictionary, protectedSelf = retainPtr(self)] () -> Vector<String> { 3992 3987 auto* backingObject = protectedSelf.get().axBackingObject; 3993 3988 if (!backingObject) … … 4020 4015 4021 4016 if ([attribute isEqualToString:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute]) { 4022 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&rect, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4017 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&rect, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4023 4018 auto* backingObject = protectedSelf.get().axBackingObject; 4024 4019 if (!backingObject) … … 4036 4031 4037 4032 if ([attribute isEqualToString:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute]) { 4038 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&rect, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4033 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&rect, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4039 4034 auto* backingObject = protectedSelf.get().axBackingObject; 4040 4035 if (!backingObject) … … 4056 4051 if ([attribute isEqualToString:NSAccessibilityMisspellingTextMarkerRangeParameterizedAttribute]) { 4057 4052 auto criteria = accessibilityMisspellingSearchCriteriaForParameterizedAttribute(self, dictionary); 4058 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&criteria, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4053 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&criteria, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4059 4054 auto* backingObject = protectedSelf.get().axBackingObject; 4060 4055 if (!backingObject) … … 4068 4063 4069 4064 if ([attribute isEqualToString:NSAccessibilityTextMarkerIsValidParameterizedAttribute]) { 4070 bool result = Accessibility::retrieveValueFromMainThread<bool>([&textMarker, protectedSelf = retain Wrapper(self)] () -> bool {4065 bool result = Accessibility::retrieveValueFromMainThread<bool>([&textMarker, protectedSelf = retainPtr(self)] () -> bool { 4071 4066 VisiblePosition pos = [protectedSelf visiblePositionForTextMarker:textMarker]; 4072 4067 return !pos.isNull(); … … 4076 4071 4077 4072 if ([attribute isEqualToString:NSAccessibilityIndexForTextMarkerParameterizedAttribute]) { 4078 auto result = Accessibility::retrieveValueFromMainThread<NSInteger>([&textMarker, protectedSelf = retain Wrapper(self)] () -> NSInteger {4073 auto result = Accessibility::retrieveValueFromMainThread<NSInteger>([&textMarker, protectedSelf = retainPtr(self)] () -> NSInteger { 4079 4074 return [protectedSelf _indexForTextMarker:textMarker]; 4080 4075 }); … … 4083 4078 4084 4079 if ([attribute isEqualToString:NSAccessibilityTextMarkerForIndexParameterizedAttribute]) { 4085 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&number, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4080 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&number, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4086 4081 return [protectedSelf _textMarkerForIndex:[number integerValue]]; 4087 4082 }); … … 4090 4085 if ([attribute isEqualToString:@"AXUIElementForTextMarker"]) { 4091 4086 // FIXME: we need to return an IsolatedObject if this is called on the AX thread. 4092 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4087 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4093 4088 auto* axObject = [protectedSelf accessibilityObjectForTextMarker:textMarker]; 4094 4089 if (!axObject) … … 4101 4096 4102 4097 if ([attribute isEqualToString:@"AXTextMarkerRangeForUIElement"]) { 4103 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&uiElement, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4098 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&uiElement, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4104 4099 RefPtr<Range> range = uiElement.get()->elementRange(); 4105 4100 return [protectedSelf textMarkerRangeFromRange:range]; … … 4108 4103 4109 4104 if ([attribute isEqualToString:@"AXLineForTextMarker"]) { 4110 int result = Accessibility::retrieveValueFromMainThread<int>([&textMarker, protectedSelf = retain Wrapper(self)] () -> int {4105 int result = Accessibility::retrieveValueFromMainThread<int>([&textMarker, protectedSelf = retainPtr(self)] () -> int { 4111 4106 auto* backingObject = protectedSelf.get().axBackingObject; 4112 4107 if (!backingObject) … … 4120 4115 4121 4116 if ([attribute isEqualToString:@"AXTextMarkerRangeForLine"]) { 4122 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&number, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4117 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&number, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4123 4118 auto* backingObject = protectedSelf.get().axBackingObject; 4124 4119 VisiblePositionRange vpRange; … … 4130 4125 4131 4126 if ([attribute isEqualToString:@"AXStringForTextMarkerRange"]) { 4132 return Accessibility::retrieveValueFromMainThread<String>([&textMarkerRange, protectedSelf = retain Wrapper(self)] () -> String {4127 return Accessibility::retrieveValueFromMainThread<String>([&textMarkerRange, protectedSelf = retainPtr(self)] () -> String { 4133 4128 RefPtr<Range> range = [protectedSelf rangeForTextMarkerRange:textMarkerRange]; 4134 4129 auto* backingObject = protectedSelf.get().axBackingObject; … … 4142 4137 return nil; 4143 4138 4144 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&webCorePoint, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4139 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&webCorePoint, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4145 4140 auto* backingObject = protectedSelf.get().axBackingObject; 4146 4141 if (!backingObject) … … 4157 4152 4158 4153 if ([attribute isEqualToString:@"AXBoundsForTextMarkerRange"]) { 4159 NSRect rect = Accessibility::retrieveValueFromMainThread<NSRect>([&textMarkerRange, protectedSelf = retain Wrapper(self)] () -> NSRect {4154 NSRect rect = Accessibility::retrieveValueFromMainThread<NSRect>([&textMarkerRange, protectedSelf = retainPtr(self)] () -> NSRect { 4160 4155 auto* backingObject = protectedSelf.get().axBackingObject; 4161 4156 if (!backingObject) … … 4170 4165 4171 4166 if ([attribute isEqualToString:NSAccessibilityBoundsForRangeParameterizedAttribute]) { 4172 NSRect rect = Accessibility::retrieveValueFromMainThread<NSRect>([&range, protectedSelf = retain Wrapper(self)] () -> NSRect {4167 NSRect rect = Accessibility::retrieveValueFromMainThread<NSRect>([&range, protectedSelf = retainPtr(self)] () -> NSRect { 4173 4168 auto* backingObject = protectedSelf.get().axBackingObject; 4174 4169 if (!backingObject) … … 4197 4192 } 4198 4193 4199 return Accessibility::retrieveValueFromMainThread<String>([&range, protectedSelf = retain Wrapper(self)] () -> String {4194 return Accessibility::retrieveValueFromMainThread<String>([&range, protectedSelf = retainPtr(self)] () -> String { 4200 4195 auto* backingObject = protectedSelf.get().axBackingObject; 4201 4196 if (!backingObject) … … 4245 4240 return nil; 4246 4241 4247 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker1, &textMarker2, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4242 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker1, &textMarker2, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4248 4243 auto* backingObject = protectedSelf.get().axBackingObject; 4249 4244 if (!backingObject) … … 4262 4257 4263 4258 if ([attribute isEqualToString:@"AXNextTextMarkerForTextMarker"]) { 4264 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4259 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4265 4260 CharacterOffset characterOffset = [protectedSelf characterOffsetForTextMarker:textMarker]; 4266 4261 return [protectedSelf nextTextMarkerForCharacterOffset:characterOffset]; … … 4269 4264 4270 4265 if ([attribute isEqualToString:@"AXPreviousTextMarkerForTextMarker"]) { 4271 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4266 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4272 4267 CharacterOffset characterOffset = [protectedSelf characterOffsetForTextMarker:textMarker]; 4273 4268 return [protectedSelf previousTextMarkerForCharacterOffset:characterOffset]; … … 4318 4313 4319 4314 if ([attribute isEqualToString:@"AXStyleTextMarkerRangeForTextMarker"]) { 4320 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4315 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarker, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4321 4316 auto* backingObject = protectedSelf.get().axBackingObject; 4322 4317 if (!backingObject) … … 4334 4329 4335 4330 if ([attribute isEqualToString:@"AXLengthForTextMarkerRange"]) { 4336 int length = Accessibility::retrieveValueFromMainThread<int>([&textMarkerRange, protectedSelf = retain Wrapper(self)] () -> int {4331 int length = Accessibility::retrieveValueFromMainThread<int>([&textMarkerRange, protectedSelf = retainPtr(self)] () -> int { 4337 4332 auto* backingObject = protectedSelf.get().axBackingObject; 4338 4333 if (!backingObject) … … 4349 4344 // Used only by DumpRenderTree (so far). 4350 4345 if ([attribute isEqualToString:@"AXStartTextMarkerForTextMarkerRange"]) { 4351 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarkerRange, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4346 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarkerRange, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4352 4347 RefPtr<Range> range = [protectedSelf rangeForTextMarkerRange:textMarkerRange]; 4353 4348 return [protectedSelf startOrEndTextMarkerForRange:range isStart:YES]; … … 4356 4351 4357 4352 if ([attribute isEqualToString:@"AXEndTextMarkerForTextMarkerRange"]) { 4358 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarkerRange, protectedSelf = retain Wrapper(self)] () -> RetainPtr<id> {4353 return Accessibility::retrieveAutoreleasedValueFromMainThread<id>([&textMarkerRange, protectedSelf = retainPtr(self)] () -> RetainPtr<id> { 4359 4354 RefPtr<Range> range = [protectedSelf rangeForTextMarkerRange:textMarkerRange]; 4360 4355 return [protectedSelf startOrEndTextMarkerForRange:range isStart:NO];
Note: See TracChangeset
for help on using the changeset viewer.