Make navigator.mediaDevices SecureContext
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2019 19:22:35 +0000 (19:22 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2019 19:22:35 +0000 (19:22 +0000)
commitc567757de62f427e595a170ea68244c786829a7c
tree2ae08c435230447f6f3b1369a1e07a26fd061230
parentef58c21209a2ed8b154aff2fba0c8d91004ed054
Make navigator.mediaDevices SecureContext
https://bugs.webkit.org/show_bug.cgi?id=194666

Reviewed by Eric Carlson.

Source/WebCore:

Make navigator.mediaDevices SecureContext.
This can still be enabled for unsecure context using the existing page settings.
To cover that case, introduce ContextHasMediaDevices custom IDL keyword.

Covered by API test.

* Modules/mediastream/NavigatorMediaDevices.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::hasMediaDevices const):
(WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
* dom/ScriptExecutionContext.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/UserMediaDisabled.mm:
(MediaCaptureDisabledTest::loadTestAndWaitForMessage):
(TEST_F):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/NavigatorMediaDevices.idl
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.json
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptExecutionContext.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/UserMediaDisabled.mm