RESOLVED FIXED 115314
Simplify WebHTMLRepresentation supportedMIMETypes methods
https://bugs.webkit.org/show_bug.cgi?id=115314
Summary Simplify WebHTMLRepresentation supportedMIMETypes methods
Benjamin Poulain
Reported 2013-04-27 16:01:06 PDT
Simplify WebHTMLRepresentation supportedMIMETypes methods
Attachments
Patch (4.28 KB, patch)
2013-04-27 16:05 PDT, Benjamin Poulain
no flags
Patch (4.59 KB, patch)
2013-04-29 21:01 PDT, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2013-04-27 16:05:08 PDT
Darin Adler
Comment 2 2013-04-27 19:33:45 PDT
Comment on attachment 199920 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=199920&action=review > Source/WebKit/mac/WebView/WebHTMLRepresentation.mm:87 > +static NSMutableArray *createArrayWithStrings(const HashSet<String>& set) It would be nice to use naming that tells the static analyzer this object is intentionally leaked. Or we could name this leak like we do other similar functions.
Anders Carlsson
Comment 3 2013-04-29 13:15:32 PDT
(In reply to comment #2) > (From update of attachment 199920 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=199920&action=review > > > Source/WebKit/mac/WebView/WebHTMLRepresentation.mm:87 > > +static NSMutableArray *createArrayWithStrings(const HashSet<String>& set) > > It would be nice to use naming that tells the static analyzer this object is intentionally leaked. Or we could name this leak like we do other similar functions. I prefer just returning a RetainPtr.
Benjamin Poulain
Comment 4 2013-04-29 21:01:00 PDT
Benjamin Poulain
Comment 5 2013-05-01 14:01:12 PDT
Comment on attachment 200078 [details] Patch Clearing flags on attachment: 200078 Committed r149453: <http://trac.webkit.org/changeset/149453>
Benjamin Poulain
Comment 6 2013-05-01 14:01:15 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 7 2013-05-01 14:10:49 PDT
Comment on attachment 200078 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=200078&action=review > Source/WebKit/mac/WebView/WebHTMLRepresentation.mm:88 > +static NSMutableArray *createArrayWithStrings(const HashSet<String>& set) NS_RETURNS_RETAINED; > +static NSMutableArray *createArrayWithStrings(const HashSet<String>& set) I missed this in my original review. Wouldn’t it be better to follow the preferred naming scheme so we don’t have to do NS_RETURNS_RETAINED explicitly? Could use the word “copy” or “new” instead of “create” perhaps? > Source/WebKit/mac/WebView/WebHTMLRepresentation.mm:98 > +static NSMutableArray *createArrayByConcatenatingArrays(NSArray *first, NSArray *second) NS_RETURNS_RETAINED; > +static NSMutableArray *createArrayByConcatenatingArrays(NSArray *first, NSArray *second) Ditto. > Source/WebKit/mac/WebView/WebHTMLRepresentation.mm:107 > + static __unsafe_unretained NSArray *staticSupportedMIMETypes = createArrayByConcatenatingArrays([self supportedNonImageMIMETypes], [self supportedImageMIMETypes]); Seems a little strange to start using __unsafe_unretained here. I suppose some day when we switch to ARC it will be handy.
Benjamin Poulain
Comment 8 2013-05-01 14:17:42 PDT
(In reply to comment #7) > (From update of attachment 200078 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=200078&action=review > > > Source/WebKit/mac/WebView/WebHTMLRepresentation.mm:88 > > +static NSMutableArray *createArrayWithStrings(const HashSet<String>& set) NS_RETURNS_RETAINED; > > +static NSMutableArray *createArrayWithStrings(const HashSet<String>& set) > > I missed this in my original review. Wouldn’t it be better to follow the preferred naming scheme so we don’t have to do NS_RETURNS_RETAINED explicitly? Could use the word “copy” or “new” instead of “create” perhaps? You did not miss that. I worked on the static analyzer and the ARC compatibility thingies and I forgot that particular comment. I'll update with the name fixed.
Note You need to log in before you can comment on or make changes to this bug.