rdar://problem/60888386
Created attachment 394626 [details] Patch
Comment on attachment 394626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394626&action=review > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6609 > + auto webView = _webView.get(); A little strange to make this local variable but only use it once. > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6614 > + if ([uiDelegate respondsToSelector:@selector(_webView:fileUploadPanelContentIsManagedWithInitiatingFrame:)]) > + return [uiDelegate _webView:webView.get() fileUploadPanelContentIsManagedWithInitiatingFrame:wrapper(API::FrameInfo::create(WTFMove(_frameInfoForFileUploadPanel), _page.get()))]; > + > + return NO; I would have used && here.
(In reply to Darin Adler from comment #2) > Comment on attachment 394626 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=394626&action=review > > > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6609 > > + auto webView = _webView.get(); > > A little strange to make this local variable but only use it once. It's used twice -- on line 6610 to call -UIDelegate, and again on line 6612 for the first parameter of _webView:fileUpload... > > > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6614 > > + if ([uiDelegate respondsToSelector:@selector(_webView:fileUploadPanelContentIsManagedWithInitiatingFrame:)]) > > + return [uiDelegate _webView:webView.get() fileUploadPanelContentIsManagedWithInitiatingFrame:wrapper(API::FrameInfo::create(WTFMove(_frameInfoForFileUploadPanel), _page.get()))]; > > + > > + return NO; > > I would have used && here. Sure.
Created attachment 394631 [details] Patch for landing
Comment on attachment 394631 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=394631&action=review > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6611 > + auto webView = _webView.get(); > + id <WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([webView UIDelegate]); > + return [uiDelegate respondsToSelector:@selector(_webView:fileUploadPanelContentIsManagedWithInitiatingFrame:)] && [uiDelegate _webView:webView.get() fileUploadPanelContentIsManagedWithInitiatingFrame:wrapper(API::FrameInfo::create(WTFMove(_frameInfoForFileUploadPanel), _page.get()))]; Gotta admit I am surprised we can call _webView.get() and then call get() again on that! Also, sorry I suggested the && but didn’t point out the cool way to format it: return [uiDelegate respondsToSelector:@selector(_webView:fileUploadPanelContentIsManagedWithInitiatingFrame:)] && [uiDelegate _webView:webView.get() fileUploadPanelContentIsManagedWithInitiatingFrame:wrapper(API::FrameInfo::create(WTFMove(_frameInfoForFileUploadPanel), _page.get()))];
(In reply to Darin Adler from comment #5) > Comment on attachment 394631 [details] > Patch for landing > > View in context: > https://bugs.webkit.org/attachment.cgi?id=394631&action=review > > > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:6611 > > + auto webView = _webView.get(); > > + id <WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([webView UIDelegate]); > > + return [uiDelegate respondsToSelector:@selector(_webView:fileUploadPanelContentIsManagedWithInitiatingFrame:)] && [uiDelegate _webView:webView.get() fileUploadPanelContentIsManagedWithInitiatingFrame:wrapper(API::FrameInfo::create(WTFMove(_frameInfoForFileUploadPanel), _page.get()))]; > > Gotta admit I am surprised we can call _webView.get() and then call get() > again on that! Yup. The first get() converts from a WeakObjCPtr to RetainPtr, then the second get() returns the raw pointer. > > Also, sorry I suggested the && but didn’t point out the cool way to format > it: > > return [uiDelegate > respondsToSelector:@selector(_webView: > fileUploadPanelContentIsManagedWithInitiatingFrame:)] > && [uiDelegate _webView:webView.get() > fileUploadPanelContentIsManagedWithInitiatingFrame:wrapper(API::FrameInfo:: > create(WTFMove(_frameInfoForFileUploadPanel), _page.get()))]; I like that formatting better. I'll use it.
Created attachment 394633 [details] Patch for landing II Fixed the formatting in -fileUploadPanelDestinationIsManaged:.
Committed r259061: <https://trac.webkit.org/changeset/259061> All reviewed patches have been landed. Closing bug and clearing flags on attachment 394633 [details].