RESOLVED FIXED 171320
WebItemProviderPasteboard should fetch preloaded assets from disk when possible
https://bugs.webkit.org/show_bug.cgi?id=171320
Summary WebItemProviderPasteboard should fetch preloaded assets from disk when possible
Wenson Hsieh
Reported 2017-04-26 03:31:59 PDT
Attachments
First pass (19.20 KB, patch)
2017-04-26 03:49 PDT, Wenson Hsieh
thorton: review+
Wenson Hsieh
Comment 1 2017-04-26 03:49:45 PDT
Created attachment 308235 [details] First pass
Tim Horton
Comment 2 2017-04-26 15:51:32 PDT
Comment on attachment 308235 [details] First pass View in context: https://bugs.webkit.org/attachment.cgi?id=308235&action=review > Source/WebCore/platform/ios/WebItemProviderPasteboard.mm:182 > + RetainPtr<NSArray> _typeToFileURLMaps; What's with all these NSArrays? (no need to fix in this patch though) > Source/WebCore/platform/ios/WebItemProviderPasteboard.mm:294 > + // We've already loaded data relevant for this UTI type into disk, so there's no need to ask the UIItemProvider for the same data again. into disk? onto disk? > Source/WebCore/platform/ios/WebItemProviderPasteboard.mm:295 > + if (NSData *result = [NSData dataWithContentsOfURL:typeToFileURLMap[loadedType] options:NSDataReadingMappedAlways error:nil]) Should we go with Always or IfSafe?
Wenson Hsieh
Comment 3 2017-04-26 20:47:27 PDT
(In reply to Tim Horton from comment #2) > Comment on attachment 308235 [details] > First pass > > View in context: > https://bugs.webkit.org/attachment.cgi?id=308235&action=review > > > Source/WebCore/platform/ios/WebItemProviderPasteboard.mm:182 > > + RetainPtr<NSArray> _typeToFileURLMaps; > > What's with all these NSArrays? (no need to fix in this patch though) There's no particular reason these are just NSArrays :/ I'll refactor these to be Vector<RetainPtr<NSString>> in a followup patch. > > > Source/WebCore/platform/ios/WebItemProviderPasteboard.mm:294 > > + // We've already loaded data relevant for this UTI type into disk, so there's no need to ask the UIItemProvider for the same data again. > > into disk? onto disk? s/into/onto/ > > > Source/WebCore/platform/ios/WebItemProviderPasteboard.mm:295 > > + if (NSData *result = [NSData dataWithContentsOfURL:typeToFileURLMap[loadedType] options:NSDataReadingMappedAlways error:nil]) > > Should we go with Always or IfSafe? Good point. Changed to use NSDataReadingMappedIfSafe. Committed <https://trac.webkit.org/changeset/215835>
Note You need to log in before you can comment on or make changes to this bug.