[webkit-reviews] review granted: [Bug 171154] Support writing link titles to the pasteboard when beginning data interaction on a link : [Attachment 307874] Really fix iOS build

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 21 21:43:29 PDT 2017


Andy Estes <aestes at apple.com> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 171154: Support writing link titles to the pasteboard when beginning data
interaction on a link
https://bugs.webkit.org/show_bug.cgi?id=171154

Attachment 307874: Really fix iOS build

https://bugs.webkit.org/attachment.cgi?id=307874&action=review




--- Comment #4 from Andy Estes <aestes at apple.com> ---
Comment on attachment 307874
  --> https://bugs.webkit.org/attachment.cgi?id=307874
Really fix iOS build

View in context: https://bugs.webkit.org/attachment.cgi?id=307874&action=review

> Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:42
> +#if ENABLE(DATA_INTERACTION)
> +#import <UIKit/NSURL+UIItemProvider.h>
> +#endif

This is fine for now, but the build will break once we start building against
the Public iOS 11 SDK because NSURL+UIItemProvider.h is a Private header. We'll
need to make a SPI header for this.

> Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:296
> +    RetainPtr<NSMutableArray> objectRepresentations =
adoptNS([[NSMutableArray alloc] init]);

This is one of the cases where I prefer auto, since the type is clear from the
right hand side.

> Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:299
> +    NSURL *nsURL = (NSURL *)url.url;
> +    if (nsURL) {

These two lines could be:

    if (NSURL *nsURL = (NSURL *)url.url) {

> Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:307
> +    [m_pasteboard setItemsFromObjectRepresentations:@[[WebPasteboardItemData
itemWithRepresentingObjects:objectRepresentations.get() additionalData:@{ }]]];

Can you use nil for the additionalData argument, or does it really need to be
an empty NSDictionary?

> Source/WebCore/platform/ios/WebItemProviderPasteboard.mm:176
> +	       [itemProvider
registerDataRepresentationForTypeIdentifier:typeIdentifier
visibility:UIItemProviderRepresentationOptionsVisibilityAll
loadHandler:^NSProgress *(void (^completionHandler)(NSData *, NSError *))

Can you use the UIItemProviderDataLoadHandler typedef here?


More information about the webkit-reviews mailing list