WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
209607
Add SPI to specify whether file upload panels are uploading to an enterprise-managed destination
https://bugs.webkit.org/show_bug.cgi?id=209607
Summary
Add SPI to specify whether file upload panels are uploading to an enterprise-...
David Quesada
Reported
2020-03-26 10:30:34 PDT
rdar://problem/60888386
Attachments
Patch
(14.96 KB, patch)
2020-03-26 10:43 PDT
,
David Quesada
darin
: review+
Details
Formatted Diff
Diff
Patch for landing
(14.93 KB, patch)
2020-03-26 11:15 PDT
,
David Quesada
david_quesada
: commit-queue-
Details
Formatted Diff
Diff
Patch for landing II
(14.94 KB, patch)
2020-03-26 11:27 PDT
,
David Quesada
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
David Quesada
Comment 1
2020-03-26 10:43:36 PDT
Created
attachment 394626
[details]
Patch
Darin Adler
Comment 2
2020-03-26 10:54:51 PDT
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.
David Quesada
Comment 3
2020-03-26 11:07:48 PDT
(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.
David Quesada
Comment 4
2020-03-26 11:15:08 PDT
Created
attachment 394631
[details]
Patch for landing
Darin Adler
Comment 5
2020-03-26 11:19:08 PDT
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()))];
David Quesada
Comment 6
2020-03-26 11:27:06 PDT
(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.
David Quesada
Comment 7
2020-03-26 11:27:58 PDT
Created
attachment 394633
[details]
Patch for landing II Fixed the formatting in -fileUploadPanelDestinationIsManaged:.
EWS
Comment 8
2020-03-26 11:58:48 PDT
Committed
r259061
: <
https://trac.webkit.org/changeset/259061
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 394633
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug