Changeset 267414 in webkit
- Timestamp:
- Sep 22, 2020, 9:32:11 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/en.lproj/Localizable.strings (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/WebPreferences.yaml (modified) (1 diff)
-
Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (modified) (1 diff)
-
Source/WebKit/Shared/WebPreferencesDefaultValues.h (modified) (1 diff)
-
Source/WebKit/Shared/WebPreferencesExperimental.yaml (modified) (1 diff)
-
Source/WebKit/Shared/WebPreferencesInternal.yaml (modified) (3 diffs)
-
Source/WebKit/UIProcess/Cocoa/UIDelegate.h (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (modified) (5 diffs)
-
Source/WebKit/UIProcess/Cocoa/WKUserMediaCaptureAccessAlert.h (added)
-
Source/WebKit/UIProcess/Cocoa/WKUserMediaCaptureAccessAlert.mm (added)
-
Source/WebKit/WebKit.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/MiniBrowser/MiniBrowser.entitlements (modified) (1 diff)
-
Tools/MiniBrowser/mac/WK2BrowserWindowController.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267413 r267414 1 2020-09-22 Youenn Fablet <youenn@apple.com> 2 3 Implement a default prompt for getUserMedia 4 https://bugs.webkit.org/show_bug.cgi?id=216821 5 6 Reviewed by Eric Carlson. 7 8 Manually tested by running Minibrowser. 9 10 * en.lproj/Localizable.strings: 11 1 12 2020-09-22 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WebCore/en.lproj/Localizable.strings
r266342 r267414 125 125 "Allow “%@” to use cookies and website data while browsing “%@”?" = "Allow “%@” to use cookies and website data while browsing “%@”?"; 126 126 127 /* Message for user media prompt */ 128 "Allow “%@” to use your camera and microphone?" = "Allow “%@” to use your camera and microphone?"; 129 130 /* Message for user camera access prompt */ 131 "Allow “%@” to use your camera?" = "Allow “%@” to use your camera?"; 132 133 /* Message for user microphone access prompt */ 134 "Allow “%@” to use your microphone?" = "Allow “%@” to use your microphone?"; 135 136 /* Allow button title in user media prompt */ 137 "Allow (usermedia)" = "Allow"; 138 139 /* Disallow button title in user media prompt */ 140 "Don’t Allow (usermedia)" = "Don’t Allow"; 141 127 142 /* WKErrorUnknown description */ 128 143 "An unknown error occurred" = "An unknown error occurred"; -
trunk/Source/WebKit/ChangeLog
r267412 r267414 1 2020-09-22 Youenn Fablet <youenn@apple.com> 2 3 Implement a default prompt for getUserMedia 4 https://bugs.webkit.org/show_bug.cgi?id=216821 5 6 Reviewed by Eric Carlson. 7 8 Move preferences used by WebRTC develop menu to internals. 9 This allows having them in MiniBrowser. 10 11 Enable video capture in UIProcess by default for non Safari applications. 12 Add support for a getUserMedia prompt, very similar to iOS current prompt. 13 Use the prompt in case the application does not implement any of the two delegates. 14 15 * Shared/WebPreferences.yaml: 16 * Shared/WebPreferencesDefaultValues.cpp: 17 (WebKit::defaultCaptureVideoInUIProcessEnabled): 18 * Shared/WebPreferencesDefaultValues.h: 19 * Shared/WebPreferencesExperimental.yaml: 20 * Shared/WebPreferencesInternal.yaml: 21 * UIProcess/Cocoa/UIDelegate.h: 22 * UIProcess/Cocoa/UIDelegate.mm: 23 (WebKit::UIDelegate::setDelegate): 24 (WebKit::requestUserMediaAuthorizationForFrame): 25 (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): 26 * UIProcess/Cocoa/WKUserMediaCaptureAccessAlert.h: Added. 27 * UIProcess/Cocoa/WKUserMediaCaptureAccessAlert.mm: Added. 28 (WebKit::visibleDomain): 29 (WebKit::alertMessageText): 30 (WebKit::presentUserMediaCaptureAccessAlert): 31 * WebKit.xcodeproj/project.pbxproj: 32 1 33 2020-09-22 Brady Eidson <beidson@apple.com> 2 34 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r267385 r267414 995 995 webcoreBinding: RuntimeEnabledFeatures 996 996 condition: ENABLE(ACCESSIBILITY_ISOLATED_TREE) 997 998 # Deprecated999 1000 ICECandidateFilteringEnabled:1001 type: bool1002 defaultValue: true1003 1004 MockCaptureDevicesEnabled:1005 type: bool1006 defaultValue: DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED1007 condition: ENABLE(MEDIA_STREAM)1008 1009 MediaCaptureRequiresSecureConnection:1010 type: bool1011 defaultValue: true1012 condition: ENABLE(MEDIA_STREAM) -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
r267400 r267414 170 170 } 171 171 172 bool defaultCaptureVideoInUIProcessEnabled() 173 { 174 #if PLATFORM(MAC) 175 return !MacApplication::isSafari(); 176 #endif 177 178 return false; 179 } 180 172 181 #endif // ENABLE(MEDIA_STREAM) 173 182 -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r267225 r267414 345 345 bool defaultCaptureAudioInUIProcessEnabled(); 346 346 bool defaultCaptureVideoInGPUProcessEnabled(); 347 bool defaultCaptureVideoInUIProcessEnabled(); 347 348 #endif 348 349 -
trunk/Source/WebKit/Shared/WebPreferencesExperimental.yaml
r267403 r267414 394 394 webcoreName: genericCueAPIEnabled 395 395 396 CaptureVideoInUIProcessEnabled:397 type: bool398 defaultValue: false399 humanReadableName: "Capture video in UI Process"400 humanReadableDescription: "Enable video capture in UI Process"401 webcoreBinding: none402 condition: ENABLE(MEDIA_STREAM)403 404 396 AspectRatioOfImgFromWidthAndHeightEnabled: 405 397 type: bool -
trunk/Source/WebKit/Shared/WebPreferencesInternal.yaml
r267403 r267414 107 107 humanReadableDescription: "Stop plugins smaller than a certain threshold from loading." 108 108 109 CaptureAudioInUIProcessEnabled: 110 type: bool 111 defaultValue: defaultCaptureAudioInUIProcessEnabled() 112 humanReadableName: "Capture audio in UI Process" 113 humanReadableDescription: "Enable audio capture in UI Process" 114 webcoreBinding: none 115 condition: ENABLE(MEDIA_STREAM) 116 117 CaptureAudioInGPUProcessEnabled: 118 type: bool 119 defaultValue: defaultCaptureAudioInGPUProcessEnabled() 120 humanReadableName: "Use GPU Process to capture audio" 121 humanReadableDescription: "Enable audio capture in GPU Process" 122 webcoreBinding: none 123 condition: ENABLE(MEDIA_STREAM) 124 125 CaptureVideoInUIProcessEnabled: 126 type: bool 127 defaultValue: defaultCaptureVideoInUIProcessEnabled() 128 humanReadableName: "Capture video in UI Process" 129 humanReadableDescription: "Enable video capture in UI Process" 130 webcoreBinding: none 131 condition: ENABLE(MEDIA_STREAM) 132 109 133 CaptureVideoInGPUProcessEnabled: 110 134 type: bool … … 300 324 condition: ENABLE(LAYOUT_FORMATTING_CONTEXT) 301 325 302 CaptureAudioInUIProcessEnabled:303 type: bool304 defaultValue: defaultCaptureAudioInUIProcessEnabled()305 humanReadableName: "Capture audio in UI Process"306 humanReadableDescription: "Enable audio capture in UI Process"307 webcoreBinding: none308 condition: ENABLE(MEDIA_STREAM)309 310 CaptureAudioInGPUProcessEnabled:311 type: bool312 defaultValue: defaultCaptureAudioInGPUProcessEnabled()313 humanReadableName: "Use GPU Process to capture audio"314 humanReadableDescription: "Enable audio capture in GPU Process"315 webcoreBinding: none316 condition: ENABLE(MEDIA_STREAM)317 318 326 RenderCanvasInGPUProcessEnabled: 319 327 type: bool … … 408 416 humanReadableName: "Live Ranges in Selection" 409 417 humanReadableDescription: "Live range behavior for ranges in the Selection object" 410 category: internal 418 419 ICECandidateFilteringEnabled: 420 type: bool 421 defaultValue: true 422 humanReadableName: "Enable ICE Candidate Filtering" 423 humanReadableDescription: "Enable ICE Candidate Filtering" 424 425 MockCaptureDevicesEnabled: 426 type: bool 427 defaultValue: DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED 428 condition: ENABLE(MEDIA_STREAM) 429 humanReadableName: "Enable Mock Capture Devices" 430 humanReadableDescription: "Enable Mock Capture Devices" 431 432 MediaCaptureRequiresSecureConnection: 433 type: bool 434 defaultValue: true 435 condition: ENABLE(MEDIA_STREAM) 436 humanReadableName: "Limit Media Capture to Secure Sites" 437 humanReadableDescription: "Limit Media Capture to Secure Sites" -
trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.h
r266890 r267414 216 216 bool webViewDidEnterFullscreen : 1; 217 217 bool webViewDidExitFullscreen : 1; 218 bool webViewRequestMediaCaptureAuthorizationForFrameDecisionHandler : 1;219 218 bool webViewIsMediaCaptureAuthorizedForFrameDecisionHandler : 1; 220 219 bool webViewMediaCaptureStateDidChange : 1; -
trunk/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
r266890 r267414 45 45 #import "WKStorageAccessAlert.h" 46 46 #import "WKUIDelegatePrivate.h" 47 #import "WKUserMediaCaptureAccessAlert.h" 47 48 #import "WKWebViewConfigurationInternal.h" 48 49 #import "WKWebViewInternal.h" … … 154 155 m_delegateMethods.presentingViewControllerForWebView = [delegate respondsToSelector:@selector(_presentingViewControllerForWebView:)]; 155 156 #endif 156 m_delegateMethods.webViewRequestMediaCaptureAuthorizationForFrameDecisionHandler = [delegate respondsToSelector:@selector(_webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:)] || [delegate respondsToSelector:@selector(_webView:requestMediaCaptureAuthorization:decisionHandler:)];157 157 m_delegateMethods.webViewIsMediaCaptureAuthorizedForFrameDecisionHandler = [delegate respondsToSelector:@selector(_webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:)] || [delegate respondsToSelector:@selector(_webView:includeSensitiveMediaDeviceDetails:)]; 158 158 … … 922 922 } 923 923 924 const auto* mainFrame = frame.page()->mainFrame(); 924 bool respondsToRequestMediaCaptureAuthorization = [delegate respondsToSelector:@selector(_webView:requestMediaCaptureAuthorization:decisionHandler:)]; 925 bool respondsToRequestUserMediaAuthorizationForDevices = [delegate respondsToSelector:@selector(_webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:)]; 926 if (!request.requiresDisplayCapture() && !respondsToRequestUserMediaAuthorizationForDevices && !respondsToRequestMediaCaptureAuthorization) { 927 presentUserMediaCaptureAccessAlert(&webView, topLevelOrigin, devices, [decisionHandler = WTFMove(decisionHandler)](bool authorized) mutable { 928 decisionHandler(authorized); 929 }); 930 return; 931 } 925 932 926 933 // FIXME: Provide a specific delegate for display capture. 927 if (!request.requiresDisplayCapture() && [delegate respondsToSelector:@selector(_webView:requestMediaCaptureAuthorization:decisionHandler:)]) { 928 934 if (!request.requiresDisplayCapture() && respondsToRequestMediaCaptureAuthorization) { 929 935 [delegate _webView:&webView requestMediaCaptureAuthorization:devices decisionHandler:decisionHandler.get()]; 930 936 return; … … 932 938 933 939 URL requestFrameURL { frame.url() }; 934 URL mainFrameURL { mainFrame->url() };940 URL mainFrameURL { frame.page()->mainFrame()->url() }; 935 941 936 942 [delegate _webView:&webView requestUserMediaAuthorizationForDevices:devices url:requestFrameURL mainFrameURL:mainFrameURL decisionHandler:decisionHandler.get()]; … … 942 948 #if ENABLE(MEDIA_STREAM) 943 949 auto delegate = m_uiDelegate.m_delegate.get(); 944 if (!delegate || !m_uiDelegate.m_delegateMethods.webViewRequestMediaCaptureAuthorizationForFrameDecisionHandler) {950 if (!delegate) { 945 951 request.deny(UserMediaPermissionRequestProxy::UserMediaAccessDenialReason::UserMediaDisabled); 946 952 return; -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r267411 r267414 906 906 413CCD5020DEBC740065A21A /* com.google.googletalkbrowserplugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 413CCD4F20DEBC2F0065A21A /* com.google.googletalkbrowserplugin.sb */; }; 907 907 4143751C20EAEA2D00FAD06C /* cn.microdone.cmb.safari.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 4143751B20EAEA1E00FAD06C /* cn.microdone.cmb.safari.sb */; }; 908 4147DC692519EC3300214EE7 /* WKUserMediaCaptureAccessAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4147DC672519E29D00214EE7 /* WKUserMediaCaptureAccessAlert.mm */; }; 908 909 414DD37920BF43F5006959FB /* com.cisco.webex.plugin.gpc64.sb in Resources */ = {isa = PBXBuildFile; fileRef = 414DD37820BF43EA006959FB /* com.cisco.webex.plugin.gpc64.sb */; }; 909 910 414DD37A20BF49A5006959FB /* com.cisco.webex.plugin.gpc64.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 414DD37820BF43EA006959FB /* com.cisco.webex.plugin.gpc64.sb */; }; … … 3419 3420 413CCD4F20DEBC2F0065A21A /* com.google.googletalkbrowserplugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.google.googletalkbrowserplugin.sb; sourceTree = "<group>"; }; 3420 3421 4143751B20EAEA1E00FAD06C /* cn.microdone.cmb.safari.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cn.microdone.cmb.safari.sb; sourceTree = "<group>"; }; 3422 4147DC672519E29D00214EE7 /* WKUserMediaCaptureAccessAlert.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WKUserMediaCaptureAccessAlert.mm; sourceTree = "<group>"; }; 3423 4147DC682519E29D00214EE7 /* WKUserMediaCaptureAccessAlert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKUserMediaCaptureAccessAlert.h; sourceTree = "<group>"; }; 3421 3424 414DD37820BF43EA006959FB /* com.cisco.webex.plugin.gpc64.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.cisco.webex.plugin.gpc64.sb; sourceTree = "<group>"; }; 3422 3425 4150A5A023E06C910051264A /* GPUProcessSessionParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUProcessSessionParameters.h; sourceTree = "<group>"; }; … … 6402 6405 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */, 6403 6406 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */, 6407 4147DC682519E29D00214EE7 /* WKUserMediaCaptureAccessAlert.h */, 6408 4147DC672519E29D00214EE7 /* WKUserMediaCaptureAccessAlert.mm */, 6404 6409 C1710CF224A7BD0300D7C112 /* XPCEventHandler.h */, 6405 6410 ); … … 12991 12996 2D11B7C12126A283006F8878 /* UnifiedSource57-mm.mm in Sources */, 12992 12997 2D11B7C22126A283006F8878 /* UnifiedSource57.cpp in Sources */, 12998 4147DC692519EC3300214EE7 /* WKUserMediaCaptureAccessAlert.mm in Sources */, 12993 12999 2D11B7C32126A283006F8878 /* UnifiedSource58-mm.mm in Sources */, 12994 13000 2D11B7C42126A283006F8878 /* UnifiedSource58.cpp in Sources */, -
trunk/Tools/ChangeLog
r267411 r267414 1 2020-09-22 Youenn Fablet <youenn@apple.com> 2 3 Implement a default prompt for getUserMedia 4 https://bugs.webkit.org/show_bug.cgi?id=216821 5 6 Reviewed by Eric Carlson. 7 8 Remove getUserMedia delegate implementations to use WebKit built-in prompt. 9 Add camera and microphone entitlements to allow using real cameras and microphones. 10 Keep using mock devices as the default. 11 12 * MiniBrowser/MiniBrowser.entitlements: 13 * MiniBrowser/mac/WK2BrowserWindowController.m: 14 (-[WK2BrowserWindowController _webView:requestMediaCaptureAuthorization:decisionHandler:]): Deleted. 15 (-[WK2BrowserWindowController _webView:includeSensitiveMediaDeviceDetails:]): Deleted. 16 1 17 2020-09-22 Brian Burg <bburg@apple.com> 2 18 -
trunk/Tools/MiniBrowser/MiniBrowser.entitlements
r259279 r267414 23 23 <string>(allow mach-issue-extension (require-all (extension-class "com.apple.webkit.extension.mach")))</string> 24 24 </array> 25 <key>com.apple.security.device.camera</key> 26 <true/> 27 <key>com.apple.security.device.microphone</key> 28 <true/> 25 29 </dict> 26 30 </plist> -
trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m
r265061 r267414 874 874 } 875 875 876 - (void)_webView:(WKWebView *)webView requestMediaCaptureAuthorization: (_WKCaptureDevices)devices decisionHandler:(void (^)(BOOL authorized))decisionHandler877 {878 decisionHandler(true);879 }880 881 - (void)_webView:(WKWebView *)webView includeSensitiveMediaDeviceDetails:(void (^)(BOOL includeSensitiveDetails))decisionHandler882 {883 decisionHandler(false);884 }885 886 876 - (IBAction)saveAsPDF:(id)sender 887 877 {
Note:
See TracChangeset
for help on using the changeset viewer.