Adding a runtime flag specific to MediaDevices
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2017 20:42:40 +0000 (20:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2017 20:42:40 +0000 (20:42 +0000)
commit9b376f193ab74856febb7049f1ee35dfa3c3c984
tree755e167920263f32e9b0d2c01c1dc3cc380b2499
parent7ee430cb9ddd5601454595b6c44e0565ae61ac9c
Adding a runtime flag specific to MediaDevices
https://bugs.webkit.org/show_bug.cgi?id=171433

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-28
Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by existing tests.

Adding a preference for MediaDevices.
Setting media devices runtime flag to false by default.
Setting peer connection and media stream flags to true by default.
Activating mediaDevices and getUserMedia Navigator properties based on media devices flag.

* Modules/mediastream/NavigatorMediaDevices.idl:
* Modules/mediastream/NavigatorUserMedia.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled):
(WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled):

Source/WebKit/mac:

Adding a preference for MediaDevices.
Setting media devices runtime flag to false by default.
Setting peer connection and media stream flags to true by default.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaDevicesEnabled]):
(-[WebPreferences setMediaDevicesEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Adding a preference for MediaDevices.
Setting media devices runtime flag to false by default.
Setting peer connection and media stream flags to true by default.
Sending microphone sandbox extension based on media devices and not media stream flag.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetMediaDevicesEnabled):
(WKPreferencesGetMediaDevicesEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Updating WTR and DRT as peer connection and media stream runtime flags are enabled by default.
Setting media devices runtime flag to true for WTR and DRT.

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
* TestWebKitAPI/Tests/WebKit2/EnumerateMediaDevices.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/UserMedia.cpp:
(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setMediaDevicesEnabled):
(WTR::TestRunner::setMediaStreamEnabled): Deleted.
(WTR::TestRunner::setPeerConnectionEnabled): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215939 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/NavigatorMediaDevices.idl
Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl
Source/WebCore/page/RuntimeEnabledFeatures.cpp
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesRef.h
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/TestWebKitAPI/Tests/WebKit2/EnumerateMediaDevices.cpp
Tools/TestWebKitAPI/Tests/WebKit2/UserMedia.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/TestController.cpp