Align device orientation delegate to getUserMedia/geolocation delegates
Created attachment 423314 [details] Patch
Created attachment 423337 [details] Patch
Comment on attachment 423337 [details] Patch r=me once the bots are satisfied
Comment on attachment 423337 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423337&action=review > Source/WebKit/ChangeLog:8 > + Refactor code to move device orientation prompt implementation with other prompts in MediaPermissionUtilities. Well, then *Media*PermissionUtilities does not seem like a great name for it. > Source/WebKit/ChangeLog:11 > + Update the decision handler to taker grant, deny or prompt parameter. typo: taker > Source/WebKit/UIProcess/API/C/WKPageUIClient.h:136 > +typedef bool (*WKPageShouldAllowDeviceOrientationAndMotionAccessCallback)(WKPageRef page, WKSecurityOriginRef securityOrigin, WKFrameInfoRef frame, const void *clientInfo); Is it really OK to modify the existing callback type like that? Wouldn't it break clients using the old prototype? I thought we were adding new delegates whenever the prototype changes. > Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:226 > +- (void)_webView:(WKWebView *)webView requestDeviceOrientationAndMotionPermissionForOrigin:(WKSecurityOrigin*)origin initiatedByFrame:(WKFrameInfo *)frame decisionHandler:(void (^)(_WKPermissionDecision decision))decisionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA)); Same, seems risky to just rename the existing SPI. I feel we should deprecate the old one and add a new one.
> > Source/WebKit/ChangeLog:11 > > + Update the decision handler to taker grant, deny or prompt parameter. > > typo: taker OK > > Source/WebKit/UIProcess/API/C/WKPageUIClient.h:136 > > +typedef bool (*WKPageShouldAllowDeviceOrientationAndMotionAccessCallback)(WKPageRef page, WKSecurityOriginRef securityOrigin, WKFrameInfoRef frame, const void *clientInfo); > > Is it really OK to modify the existing callback type like that? Wouldn't it > break clients using the old prototype? I thought we were adding new > delegates whenever the prototype changes. I think there is no other user right now except WebKit Tools. > > Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:226 > > +- (void)_webView:(WKWebView *)webView requestDeviceOrientationAndMotionPermissionForOrigin:(WKSecurityOrigin*)origin initiatedByFrame:(WKFrameInfo *)frame decisionHandler:(void (^)(_WKPermissionDecision decision))decisionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA)); > > Same, seems risky to just rename the existing SPI. I feel we should > deprecate the old one and add a new one. Ditto.
Created attachment 423449 [details] Patch for landing
Committed r274558: <https://commits.webkit.org/r274558> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423449 [details].
<rdar://problem/75523911>