Bug 145690

Summary: [iOS] Replace deprecated -[UIDocumentMenuViewController _setIgnoreApplicationEntitlementForImport:]
Product: WebKit Reporter: Jon Honeycutt <jhoneycutt>
Component: FormsAssignee: Jon Honeycutt <jhoneycutt>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, andersca, commit-queue, dbates, ddkilzer, lforschler, mitz, sam
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: iOS 8.2   
Attachments:
Description Flags
Patch
none
Patch
none
Rebaselined Patch none

Description Jon Honeycutt 2015-06-05 02:44:37 PDT
-[UIDocumentMenuViewController _setIgnoreApplicationEntitlementForImport:] is deprecated.
Comment 1 Jon Honeycutt 2015-06-05 02:46:51 PDT
<rdar://problem/20636577>
Comment 2 Jon Honeycutt 2015-06-05 02:52:43 PDT
Created attachment 254349 [details]
Patch
Comment 3 David Kilzer (:ddkilzer) 2015-06-05 06:33:55 PDT
Comment on attachment 254349 [details]
Patch

Unless the new method is supported in iOS 8.x, we need to add a #if version check here.
Comment 4 David Kilzer (:ddkilzer) 2015-06-05 10:57:13 PDT
Comment on attachment 254349 [details]
Patch

As I noted in the previous comment, to support building on iOS 8.x, we need to add version checks:

#if __IPHONE_OS_VERSION_MIN_REQUIRED < 90000
// iOS 8 code
#else
// Mysterious future code
#endif
Comment 5 David Kilzer (:ddkilzer) 2015-06-05 12:43:48 PDT
The content of attachment 254349 [details] has been deleted by
    David Kilzer (:ddkilzer) <ddkilzer@webkit.org>
without providing any reason.

The token used to delete this attachment was generated at 2015-06-05 12:43:37 PDT.
Comment 6 Jon Honeycutt 2015-06-05 14:49:41 PDT
Created attachment 254390 [details]
Patch
Comment 7 Brent Fulgham 2016-01-13 14:08:55 PST
Comment on attachment 254390 [details]
Patch

This looks correct. I'll attempt to merge and land if it builds and runs.
Comment 8 Brent Fulgham 2016-01-14 09:39:56 PST
Created attachment 268977 [details]
Rebaselined Patch
Comment 9 mitz 2016-01-16 00:54:33 PST
Comment on attachment 268977 [details]
Rebaselined Patch

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

> Source/WebKit2/Platform/spi/ios/UIKitSPI.h:88
>  #import <UIKit/UIDocumentMenuViewController_Private.h>
>  #else
>  @interface UIDocumentMenuViewController ()
> -@property (nonatomic, assign, setter = _setIgnoreApplicationEntitlementForImport:, getter = _ignoreApplicationEntitlementForImport) BOOL _ignoreApplicationEntitlementForImport;
> +- (instancetype)_initIgnoringApplicationEntitlementForImportOfTypes:(NSArray *)types;
>  @end
>  #endif

I suggest that you address the FIXME on line 81 instead of doing this here.

> Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:378
>      // FIXME: Remove this check and the fallback code when a new SDK is available. <rdar://problem/20150072>
> -    if ([UIDocumentMenuViewController instancesRespondToSelector:@selector(_setIgnoreApplicationEntitlementForImport:)]) {
> +    if ([UIDocumentMenuViewController instancesRespondToSelector:@selector(_initIgnoringApplicationEntitlementForImportOfTypes:)]) {

You should address the FIXME instead of changing this.

> Source/WebKit2/UIProcess/ios/forms/WKFileUploadPanel.mm:518
> +    _documentMenuController = adoptNS([[UIDocumentMenuViewController alloc] _initIgnoringApplicationEntitlementForImportOfTypes:[self _documentPickerMenuMediaTypes]]);

You can write self._documentPickerMenuMediaTypes instead of using brackets.
Comment 10 WebKit Commit Bot 2016-01-16 11:03:21 PST
Comment on attachment 268977 [details]
Rebaselined Patch

Clearing flags on attachment: 268977

Committed r195171: <http://trac.webkit.org/changeset/195171>
Comment 11 WebKit Commit Bot 2016-01-16 11:03:25 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 mitz 2016-01-16 11:07:18 PST
Kind of disappointing that none of my comments were addressed.