[MediaStream] Clear cached gUM prompt state
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2017 22:15:05 +0000 (22:15 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Oct 2017 22:15:05 +0000 (22:15 +0000)
commit395e28421288d9c9d385391e54e741b2a4a217bc
treec8926edbb5dbba37cf6f5ccad6de64954e326851
parent605cee1e5a5969616ae8f77eeb1b042062391772
[MediaStream] Clear cached gUM prompt state
https://bugs.webkit.org/show_bug.cgi?id=178754
<rdar://problem/32742356>

Reviewed by Youenn Fablet.

Source/WebKit:

* Shared/WebPreferences.yaml: Define new settings.

* Shared/WebPreferencesDefinitionsBase.h: New default values.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes): New.
(WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes): Ditto.
* UIProcess/API/C/WKPreferencesRefPrivate.h:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _inactiveMediaCaptureSteamRepromptIntervalInMinutes]): Ditto.
(-[WKPreferences _setInactiveMediaCaptureSteamRepromptIntervalInMinutes:]): Ditto.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize
the timer.
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Remove unneeded namespace.
(WebKit::toWebCore): Remove unneeded breaks.
(WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Remove unneeded namespace.
(WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Set the watchdog timer
to the correct interval based on capture state.
(WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear cached state.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add new test

* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm: Added.
(-[GetUserMediaRepromptUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[GetUserMediaRepromptUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(TestWebKitAPI::TEST):

* TestWebKitAPI/Tests/WebKit/getUserMedia.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/Shared/WebPreferencesDefinitionsBase.h
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit/getUserMedia.html