Streamline decoding NSURL so it doesn't require allocating NSData and autoreleasing
Created attachment 421577 [details] Patch
Comment on attachment 421577 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=421577&action=review > Source/WTF/wtf/cocoa/NSURLExtras.mm:153 > +NSURL *URLWithData(const void* bytes, size_t length, NSURL *baseURL) What is the reason behind using const void* here rather than const uint8_t*? With string code, I like to be more specific if I can to avoid people accidentally passing in UChar* to a function like this.
Comment on attachment 421577 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=421577&action=review >> Source/WTF/wtf/cocoa/NSURLExtras.mm:153 >> +NSURL *URLWithData(const void* bytes, size_t length, NSURL *baseURL) > > What is the reason behind using const void* here rather than const uint8_t*? With string code, I like to be more specific if I can to avoid people accidentally passing in UChar* to a function like this. I was trying to side step the three different types for bytes and was a little bit influenced by the types in NSData methods. But your argument seems compelling, and CFData functions take uint8_t*. I will go with uint8_t instead.
Looks like Brent’s patch had to be rolled out. I’ll have to wait to land this until it’s landed again.
<rdar://problem/75061347>
Not needed any more. Brent’s latest is using CFURLCreateAbsoluteURLWithBytes now, not URLWithData, so there’s no need for this.