Remove UserMediaProcessManager processState map
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2019 19:53:42 +0000 (19:53 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2019 19:53:42 +0000 (19:53 +0000)
commit959e36c7d297b4dc801a8fb349d80e8333130d08
tree3d0117c31b170daa49a90227560f1cf1ff47852d
parente7683aa10f4b60a31f250273305cf97fbc4a8c0d
Remove UserMediaProcessManager processState map
https://bugs.webkit.org/show_bug.cgi?id=195056

Reviewed by Eric Carlson.

Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
To improve on this model, this patch does the following:
- Move the process state to WebProcessProxy.
- Remove the map and replace it by a set of all manager proxies.

This simplifies the handling.
On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::forEach):
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::endedCaptureSession):
(WebKit::UserMediaProcessManager::setCaptureEnabled):
(WebKit::UserMediaProcessManager::captureDevicesChanged):
(WebKit::ProcessState::ProcessState): Deleted.
(WebKit::ProcessState::hasVideoExtension const): Deleted.
(WebKit::ProcessState::grantVideoExtension): Deleted.
(WebKit::ProcessState::revokeVideoExtension): Deleted.
(WebKit::ProcessState::hasAudioExtension const): Deleted.
(WebKit::ProcessState::grantAudioExtension): Deleted.
(WebKit::ProcessState::revokeAudioExtension): Deleted.
(WebKit::stateMap): Deleted.
(WebKit::processState): Deleted.
(WebKit::ProcessState::addRequestManager): Deleted.
(WebKit::ProcessState::removeRequestManager): Deleted.
(WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
(WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
(WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
* UIProcess/UserMediaProcessManager.h:
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
(WebKit::WebProcessProxy::hasVideoCaptureExtension const):
(WebKit::WebProcessProxy::grantVideoCaptureExtension):
(WebKit::WebProcessProxy::revokeVideoCaptureExtension):
(WebKit::WebProcessProxy::hasAudioCaptureExtension const):
(WebKit::WebProcessProxy::grantAudioCaptureExtension):
(WebKit::WebProcessProxy::revokeAudioCaptureExtension):
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
(WebKit::UserMediaPermissionRequestManager::clear): Deleted.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
(WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
(WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
(WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.h
Source/WebKit/UIProcess/UserMediaProcessManager.cpp
Source/WebKit/UIProcess/UserMediaProcessManager.h
Source/WebKit/UIProcess/WebProcessProxy.h
Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp
Source/WebKit/WebProcess/MediaStream/UserMediaPermissionRequestManager.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/WebProcess.h
Source/WebKit/WebProcess/WebProcess.messages.in