Title: [226665] trunk/Source/WebKit
Revision
226665
Author
[email protected]
Date
2018-01-09 15:54:35 -0800 (Tue, 09 Jan 2018)

Log Message

WKOpenPanelParameters SPI should return autoreleased objects
https://bugs.webkit.org/show_bug.cgi?id=181457
<rdar://problem/35884960>

Reviewed by Tim Horton.

In r226607 I made a mistake by returning an object that has been released.
I instead follow a pattern of leaking and autoreleasing that we use elsewhere in the ObjC API.

* UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
(-[WKOpenPanelParameters _acceptedMIMETypes]):
(-[WKOpenPanelParameters _acceptedFileExtensions]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (226664 => 226665)


--- trunk/Source/WebKit/ChangeLog	2018-01-09 23:47:37 UTC (rev 226664)
+++ trunk/Source/WebKit/ChangeLog	2018-01-09 23:54:35 UTC (rev 226665)
@@ -1,3 +1,18 @@
+2018-01-09  Alex Christensen  <[email protected]>
+
+        WKOpenPanelParameters SPI should return autoreleased objects
+        https://bugs.webkit.org/show_bug.cgi?id=181457
+        <rdar://problem/35884960>
+
+        Reviewed by Tim Horton.
+
+        In r226607 I made a mistake by returning an object that has been released.
+        I instead follow a pattern of leaking and autoreleasing that we use elsewhere in the ObjC API.
+
+        * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
+        (-[WKOpenPanelParameters _acceptedMIMETypes]):
+        (-[WKOpenPanelParameters _acceptedFileExtensions]):
+
 2018-01-09  Dan Bernstein  <[email protected]>
 
         Removed some empty directories that were left behind

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParameters.mm (226664 => 226665)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParameters.mm	2018-01-09 23:47:37 UTC (rev 226664)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParameters.mm	2018-01-09 23:54:35 UTC (rev 226665)
@@ -55,12 +55,12 @@
 
 - (NSArray<NSString *> *)_acceptedMIMETypes
 {
-    return wrapper(_openPanelParameters->acceptMIMETypes());
+    return [wrapper(_openPanelParameters->acceptMIMETypes().leakRef()) autorelease];
 }
 
 - (NSArray<NSString *> *)_acceptedFileExtensions
 {
-    return wrapper(_openPanelParameters->acceptFileExtensions());
+    return [wrapper(_openPanelParameters->acceptFileExtensions().leakRef()) autorelease];
 }
 
 @end
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to