[MediaStream] Add screen capture IDL and stub functions
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Dec 2017 02:45:36 +0000 (02:45 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Dec 2017 02:45:36 +0000 (02:45 +0000)
commita04e64e048ac335bc5398128a4c98271372a88cb
treeb1a31f64cfec26be5ace3b36ef17fee126b326ac
parent0a27af85c8eb8d1c252051f04bcfd4ddb851a73e
[MediaStream] Add screen capture IDL and stub functions
https://bugs.webkit.org/show_bug.cgi?id=181070
<rdar://problem/35555184>

Reviewed by Youenn Fablet.

Source/WebCore:

Tests: fast/mediastream/screencapture-disabled.html
       fast/mediastream/screencapture-enabled.html

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getDisplayMedia const):
(WebCore::MediaDevices::getSupportedConstraints):
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaDevices.idl:
* Modules/mediastream/MediaTrackConstraints.cpp:
(WebCore::convertToInternalForm):
* Modules/mediastream/MediaTrackConstraints.h:
* Modules/mediastream/MediaTrackConstraints.idl:
* Modules/mediastream/MediaTrackSupportedConstraints.h:
* Modules/mediastream/MediaTrackSupportedConstraints.idl:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start):
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::deny):
* Modules/mediastream/UserMediaRequest.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::screenCaptureEnabled const):
(WebCore::RuntimeEnabledFeatures::setScreenCaptureEnabled):
* platform/mediastream/CaptureDevice.h:
* platform/mediastream/MediaConstraints.cpp:
(WebCore::MediaTrackConstraintSetMap::set):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaTrackConstraintSetMap::displaySurface const):
(WebCore::MediaTrackConstraintSetMap::logicalSurface const):
(WebCore::MediaTrackConstraintSetMap::encode const):
(WebCore::MediaTrackConstraintSetMap::decode):
* platform/mediastream/MediaStreamRequest.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance):
(WebCore::RealtimeMediaSource::applyConstraint):
(WebCore::RealtimeMediaSource::supportsConstraint const):
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
(WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID):
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::supportsDisplaySurface const):
(WebCore::RealtimeMediaSourceSettings::displaySurface const):
(WebCore::RealtimeMediaSourceSettings::setDisplaySurface):
(WebCore::RealtimeMediaSourceSettings::supportsLogicalSurface const):
(WebCore::RealtimeMediaSourceSettings::logicalSurface const):
(WebCore::RealtimeMediaSourceSettings::setLogicalSurface):
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
(WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint const):
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
(WebCore::RealtimeMediaSourceSupportedConstraints::supportsDisplaySurface const):
(WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsDisplaySurface):
(WebCore::RealtimeMediaSourceSupportedConstraints::supportsLogicalSurface const):
(WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsLogicalSurface):
(WebCore::RealtimeMediaSourceSupportedConstraints::encode const):
(WebCore::RealtimeMediaSourceSupportedConstraints::decode):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setScreenCaptureEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _screenCaptureEnabled]):
(-[WKPreferences _setScreenCaptureEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

LayoutTests:

* fast/mediastream/screencapture-disabled-expected.txt: Added.
* fast/mediastream/screencapture-disabled.html: Added.
* fast/mediastream/screencapture-enabled-expected.txt: Added.
* fast/mediastream/screencapture-enabled.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
36 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/screencapture-disabled-expected.txt [new file with mode: 0644]
LayoutTests/fast/mediastream/screencapture-disabled.html [new file with mode: 0644]
LayoutTests/fast/mediastream/screencapture-enabled-expected.txt [new file with mode: 0644]
LayoutTests/fast/mediastream/screencapture-enabled.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaDevices.cpp
Source/WebCore/Modules/mediastream/MediaDevices.h
Source/WebCore/Modules/mediastream/MediaDevices.idl
Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp
Source/WebCore/Modules/mediastream/MediaTrackConstraints.h
Source/WebCore/Modules/mediastream/MediaTrackConstraints.idl
Source/WebCore/Modules/mediastream/MediaTrackSupportedConstraints.h
Source/WebCore/Modules/mediastream/MediaTrackSupportedConstraints.idl
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/platform/mediastream/CaptureDevice.h
Source/WebCore/platform/mediastream/MediaConstraints.cpp
Source/WebCore/platform/mediastream/MediaConstraints.h
Source/WebCore/platform/mediastream/MediaStreamRequest.h
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSourceSettings.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSourceSupportedConstraints.h
Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp