Changeset 215619 in webkit
- Timestamp:
- Apr 21, 2017, 11:32:58 AM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/Cocoa/WKUIDelegatePrivate.h (modified) (1 diff)
-
UIProcess/API/Cocoa/WKWebViewPrivate.h (modified) (1 diff)
-
UIProcess/Cocoa/UIDelegate.h (modified) (1 diff)
-
UIProcess/Cocoa/UIDelegate.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r215611 r215619 1 2017-04-21 Andrew Gold <agold@apple.com> 2 3 -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] 4 decision handler should only have one parameter. 5 https://bugs.webkit.org/show_bug.cgi?id=171081 6 7 Reviewed by Tim Horton. 8 9 Because user media authorization is all or nothing, we should not have separate booleans 10 to indicate authorization. Additionally, rather than passing two separate booleans to the 11 UIDelegate, we now pass an NS_OPTIONS parameter. 12 13 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 14 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS. 15 16 * UIProcess/Cocoa/UIDelegate.mm: 17 * UIProcess/Cocoa/UIDelegate.mm: 18 (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method. 19 (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto. 20 1 21 2017-04-21 Konstantin Tokarev <annulen@yandex.ru> 2 22 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
r215545 r215619 65 65 - (void)_webView:(WKWebView *)webView imageOrMediaDocumentSizeChanged:(CGSize)size WK_API_AVAILABLE(macosx(10.12), ios(10.0)); 66 66 - (NSDictionary *)_dataDetectionContextForWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12), ios(10.0)); 67 - (void)_webView:(WKWebView *)webView requestUserMediaAuthorizationFor Microphone:(BOOL)microphone camera:(BOOL)camera url:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL decisionHandler:(void (^)(BOOL authorizedMicrophone, BOOL authorizedCamera))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));67 - (void)_webView:(WKWebView *)webView requestUserMediaAuthorizationForDevices:(_WKCaptureDevices)devices url:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL decisionHandler:(void (^)(BOOL authorized))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 68 68 - (void)_webView:(WKWebView *)webView checkUserMediaPermissionForURL:(NSURL *)url mainFrameURL:(NSURL *)mainFrameURL frameIdentifier:(NSUInteger)frameIdentifier decisionHandler:(void (^)(NSString *salt, BOOL authorized))decisionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 69 69 - (void)_webView:(WKWebView *)webView mediaCaptureStateDidChange:(_WKMediaCaptureState)state WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r215587 r215619 54 54 } WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 55 55 56 typedef NS_OPTIONS(NSUInteger, _WKCaptureDevices) { 57 _WKCaptureDeviceMicrophone = 1 << 0, 58 _WKCaptureDeviceCamera = 1 << 1, 59 } WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 60 56 61 #if !TARGET_OS_IPHONE 57 62 -
trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h
r215545 r215619 137 137 bool webViewDidEnterFullscreen : 1; 138 138 bool webViewDidExitFullscreen : 1; 139 bool webViewRequestUserMediaAuthorizationFor MicrophoneCameraURLMainFrameURLDecisionHandler : 1;139 bool webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler : 1; 140 140 bool webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler : 1; 141 141 bool webViewMediaCaptureStateDidChange : 1; -
trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
r215598 r215619 116 116 m_delegateMethods.webViewActionsForElementDefaultActions = [delegate respondsToSelector:@selector(_webView:actionsForElement:defaultActions:)]; 117 117 m_delegateMethods.webViewDidNotHandleTapAsClickAtPoint = [delegate respondsToSelector:@selector(_webView:didNotHandleTapAsClickAtPoint:)]; 118 m_delegateMethods.webViewRequestUserMediaAuthorizationFor MicrophoneCameraURLMainFrameURLDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:)];118 m_delegateMethods.webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:)]; 119 119 m_delegateMethods.webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler = [delegate respondsToSelector:@selector(_webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:)]; 120 120 m_delegateMethods.webViewMediaCaptureStateDidChange = [delegate respondsToSelector:@selector(_webView:mediaCaptureStateDidChange:)]; … … 378 378 { 379 379 auto delegate = m_uiDelegate.m_delegate.get(); 380 if (!delegate || !m_uiDelegate.m_delegateMethods.webViewRequestUserMediaAuthorizationFor MicrophoneCameraURLMainFrameURLDecisionHandler) {380 if (!delegate || !m_uiDelegate.m_delegateMethods.webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler) { 381 381 request.deny(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::UserMediaDisabled); 382 382 return true; … … 396 396 WebCore::URL mainFrameURL(WebCore::URL(), mainFrame->url()); 397 397 398 [(id <WKUIDelegatePrivate>)delegate _webView:webView requestUserMediaAuthorizationForMicrophone:requiresAudio camera:requiresVideo url:requestFrameURL mainFrameURL:mainFrameURL decisionHandler:^(BOOL authorizedMicrophone, BOOL authorizedCamera) { 399 if ((requiresAudio != authorizedMicrophone) || (requiresVideo != authorizedCamera)) { 398 _WKCaptureDevices devices = 0; 399 if (requiresAudio) 400 devices |= _WKCaptureDeviceMicrophone; 401 if (requiresVideo) 402 devices |= _WKCaptureDeviceCamera; 403 404 [(id <WKUIDelegatePrivate>)delegate _webView:webView requestUserMediaAuthorizationForDevices:devices url:requestFrameURL mainFrameURL:mainFrameURL decisionHandler:^(BOOL authorized) { 405 if (!authorized) { 400 406 request.deny(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::PermissionDenied); 401 407 return;
Note:
See TracChangeset
for help on using the changeset viewer.