Clean up user media request internal API
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Sep 2015 02:23:00 +0000 (02:23 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Sep 2015 02:23:00 +0000 (02:23 +0000)
commit1953138c68b3f7d9a48ba1aa9ce297577fef567e
tree95ea04c4cd48e2a8219535d0c8eba5045b333952
parentce43dfe016abcc577b2e314fdb240822c85c5c4a
Clean up user media request internal API
https://bugs.webkit.org/show_bug.cgi?id=149527

Reviewed by Tim Horton.

Source/WebCore:

No new tests, no functional change.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::constraintsValidated): Use track persistent ID to create vectors
  as that is what the platform code needs to map to a capture device.
(WebCore::UserMediaRequest::userMediaAccessGranted): m_chosenXXDeviceUID -> m_XXDeviceUIDAllowed.
  Use the device IDs to create the MediaStream. Switch audio/video parameter order.
(WebCore::UserMediaRequest::didCreateStream): Don't assume constraints are valid.
* Modules/mediastream/UserMediaRequest.h:
(WebCore::UserMediaRequest::videoDeviceUIDs):
(WebCore::UserMediaRequest::audioDeviceUIDs):
(WebCore::UserMediaRequest::allowedVideoDeviceUID):
(WebCore::UserMediaRequest::allowedAudioDeviceUID):
(WebCore::UserMediaRequest::requiresAudio): Deleted.
(WebCore::UserMediaRequest::requiresVideo): Deleted.
(WebCore::UserMediaRequest::firstVideoDeviceUID): Deleted.
(WebCore::UserMediaRequest::firstAudioDeviceUID): Deleted.

* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Call setPersistentId.

Source/WebKit/mac:

* WebCoreSupport/WebUserMediaClient.mm:
(WebUserMediaClient::cancelRequest): Put UserMediaRequestsMap in a local instead or calling
  userMediaRequestsMap() three times.
(-[WebUserMediaPolicyListener allow]): Get rid of unneeded local variables.
(-[WebUserMediaPolicyListener allowDeviceWithVideoUID]): Deleted, unused.

Source/WebKit2:

* UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
(WKUserMediaPermissionRequestVideoDeviceUIDs): New, renamed from WKUserMediaPermissionRequestDeviceNamesVideo.
(WKUserMediaPermissionRequestAudioDeviceUIDs): New, renamed from WKUserMediaPermissionRequestDeviceNamesAudio.
(WKUserMediaPermissionRequestAllowBest): Deleted.
(WKUserMediaPermissionRequestDeviceNamesVideo): Deleted.
(WKUserMediaPermissionRequestDeviceNamesAudio): Deleted.
(WKUserMediaPermissionRequestFirstVideoDeviceUID): Deleted.
(WKUserMediaPermissionRequestFirstAudioDeviceUID): Deleted.
* UIProcess/API/C/WKUserMediaPermissionRequest.h:

* UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
(webkitUserMediaPermissionRequestAllow): Update for UserMediaRequest API change.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Get rid of the bool parameters.
  Switch audio/video parameter order to be consistent with everywhere else.
(WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Ditto.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy): Get rid of the bool parameters.
  Switch audio/video parameter order to be consistent with everywhere else.
(WebKit::UserMediaPermissionRequestProxy::allow): Switch audio/video parameter order.
(WebKit::UserMediaPermissionRequestProxy::getDeviceNameForUID): Deleted.
* UIProcess/UserMediaPermissionRequestProxy.h:
(WebKit::UserMediaPermissionRequestProxy::create):
(WebKit::UserMediaPermissionRequestProxy::videoDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::audioDeviceUIDs):
(WebKit::UserMediaPermissionRequestProxy::firstAudioDeviceUID):
(WebKit::UserMediaPermissionRequestProxy::requiresAudio): Deleted.
(WebKit::UserMediaPermissionRequestProxy::requiresVideo): Deleted.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Get rid of the bool parameters.
  Switch audio/video parameter order to be consistent with everywhere else.
* UIProcess/WebPageProxy.h: Ditto.
* UIProcess/WebPageProxy.messages.in: Ditto.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::startRequest): Get rid of bool params, the device
  vectors have the same information.
(WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): Switch audio/video
  parameter order to be consistent with everywhere else. deviceUIDVideo -> videoDeviceUID,
deviceUIDAudio -> audioDeviceUID.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceiveUserMediaPermissionDecision): Switch audio/video parameter order.
* WebProcess/WebPage/WebPage.h:

Tools:

* TestWebKitAPI/Tests/WebKit2/UserMedia.cpp:
(TestWebKitAPI::decidePolicyForUserMediaPermissionRequestCallBack): Update for API changes.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::decidePolicyForUserMediaPermissionRequestIfPossible): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSource.h
Source/WebCore/platform/mediastream/mac/AVMediaCaptureSource.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebUserMediaClient.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.cpp
Source/WebKit2/UIProcess/API/C/WKUserMediaPermissionRequest.h
Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp
Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.h
Source/WebKit2/UIProcess/UserMediaPermissionRequestProxy.cpp
Source/WebKit2/UIProcess/UserMediaPermissionRequestProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp
Source/WebKit2/WebProcess/MediaStream/UserMediaPermissionRequestManager.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/UserMedia.cpp
Tools/WebKitTestRunner/TestController.cpp