Title: [255313] trunk/Source/WebKit
Revision
255313
Author
[email protected]
Date
2020-01-28 14:17:49 -0800 (Tue, 28 Jan 2020)

Log Message

Fix for crash in AppKit accessibility.
https://bugs.webkit.org/show_bug.cgi?id=206902

Reviewed by Chris Fleizach.

Accessibility methods invoked in the secondary thread that Return id
values retrieved from the main thread, need to retain/autoRelease the returned ids.

* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
(-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
(-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (255312 => 255313)


--- trunk/Source/WebKit/ChangeLog	2020-01-28 22:17:02 UTC (rev 255312)
+++ trunk/Source/WebKit/ChangeLog	2020-01-28 22:17:49 UTC (rev 255313)
@@ -1,3 +1,19 @@
+2020-01-28  Andres Gonzalez  <[email protected]>
+
+        Fix for crash in AppKit accessibility.
+        https://bugs.webkit.org/show_bug.cgi?id=206902
+
+        Reviewed by Chris Fleizach.
+
+        Accessibility methods invoked in the secondary thread that Return id
+        values retrieved from the main thread, need to retain/autoRelease the returned ids.
+
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+        (-[WKAccessibilityWebPageObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
+        (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]):
+        (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]):
+        (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]):
+
 2020-01-28  Brent Fulgham  <[email protected]>
 
         Unreviewed test fix after r255217

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (255312 => 255313)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm	2020-01-28 22:17:02 UTC (rev 255312)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm	2020-01-28 22:17:49 UTC (rev 255313)
@@ -86,7 +86,7 @@
 - (NSArray *)accessibilityParameterizedAttributeNames
 ALLOW_DEPRECATED_IMPLEMENTATIONS_END
 {
-    return ax::retrieveValueFromMainThread<id>([PROTECTED_SELF] () -> id {
+    return ax::retrieveValueFromMainThread<RetainPtr<id>>([PROTECTED_SELF] () -> RetainPtr<id> {
         NSMutableArray *names = [NSMutableArray array];
         if (!protectedSelf->m_page)
             return names;
@@ -96,7 +96,7 @@
                 [names addObject:(NSString *)name];
         }
         return names;
-    });
+    }).autorelease();
 }
 
 ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN
@@ -182,25 +182,25 @@
 
 - (NSValue *)accessibilityAttributeSizeValue
 {
-    return ax::retrieveValueFromMainThread<id>([PROTECTED_SELF] () -> id {
+    return ax::retrieveValueFromMainThread<RetainPtr<id>>([PROTECTED_SELF] () -> RetainPtr<id> {
         if (!protectedSelf->m_page)
             return nil;
         return [NSValue valueWithSize:(NSSize)protectedSelf->m_page->size()];
-    });
+    }).autorelease();
 }
 
 - (NSValue *)accessibilityAttributePositionValue
 {
-    return ax::retrieveValueFromMainThread<id>([PROTECTED_SELF] () -> id {
+    return ax::retrieveValueFromMainThread<RetainPtr<id>>([PROTECTED_SELF] () -> RetainPtr<id> {
         if (!protectedSelf->m_page)
             return nil;
         return [NSValue valueWithPoint:(NSPoint)protectedSelf->m_page->accessibilityPosition()];
-    });
+    }).autorelease();
 }
 
 - (id)accessibilityDataDetectorValue:(NSString *)attribute point:(WebCore::FloatPoint&)point
 {
-    return ax::retrieveValueFromMainThread<id>([&attribute, &point, PROTECTED_SELF] () -> id {
+    return ax::retrieveValueFromMainThread<RetainPtr<id>>([&attribute, &point, PROTECTED_SELF] () -> RetainPtr<id> {
         if (!protectedSelf->m_page)
             return nil;
         id value = nil;
@@ -215,7 +215,7 @@
                 value = [NSString stringWithString:stringValue];
         }
         return value;
-    });
+    }).autorelease();
 }
 
 ALLOW_DEPRECATED_IMPLEMENTATIONS_BEGIN
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to