https://bugs.webkit.org/show_bug.cgi?id=165251
Reviewed by Dean Jackson.
Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
Source/JavaScriptCore:
* runtime/CommonIdentifiers.h: Add WebRTC and MediaStream identifiers.
Source/WebCore:
No new tests, covered by existing tests.
* Modules/mediastream/MediaStreamEvent.idl: Add "EnabledAtRuntime".
* Modules/mediastream/NavigatorMediaDevices.idl: Ditto.
* Modules/mediastream/NavigatorUserMedia.idl: Ditto.
* Modules/mediastream/RTCDTMFToneChangeEvent.idl: Ditto.
* Modules/mediastream/RTCIceCandidate.idl: Ditto.
* Modules/mediastream/RTCPeerConnection.idl: Ditto.
* Modules/mediastream/RTCRtpReceiver.idl: Ditto.
* Modules/mediastream/RTCRtpSender.idl: Ditto.
* Modules/mediastream/RTCRtpTransceiver.idl: Ditto.
* Modules/mediastream/RTCSessionDescription.idl: Ditto.
* Modules/mediastream/RTCTrackEvent.idl: Ditto.
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Set m_isMediaStreamEnabled in the
constructor instead of in reset() because the later is called by the Internals constructor,
making it impossible to override the runtime flag from WTR or DRT.
(WebCore::RuntimeEnabledFeatures::reset): Don't set m_isMediaStreamEnabled.
* page/Settings.in: Add peerConnectionEnabled.
Source/WebKit/mac:
* WebView/WebPreferenceKeysPrivate.h: Add MediaStream and PeerConnection preferences.
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaStreamEnabled]):
(-[WebPreferences setMediaStreamEnabled:]):
(-[WebPreferences peerConnectionEnabled]):
(-[WebPreferences setPeerConnectionEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
Source/WebKit2:
* Shared/WebPreferencesDefinitions.h: Add peerConnectionEnabled.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPeerConnectionEnabled): Added.
(WKPreferencesGetPeerConnectionEnabled): Added.
* UIProcess/API/C/WKPreferencesRef.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Add WebKitMediaStreamEnabled
and WebKitPeerConnectionEnabled.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Initialize the peerConnection preference.
Tools:
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues): Enable MediaStream and PeerConnection.
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting): Ditto.
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setMediaStreamEnabled): New.
(WTR::TestRunner::setPeerConnectionEnabled): New.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209643
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2016-12-09 Eric Carlson <eric.carlson@apple.com>
+
+ Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
+ https://bugs.webkit.org/show_bug.cgi?id=165251
+
+ Reviewed by Dean Jackson.
+
+ Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
+
+ * runtime/CommonIdentifiers.h: Add WebRTC and MediaStream identifiers.
+
2016-12-09 JF Bastien <jfbastien@apple.com>
WebAssembly JS API: implement start function
macro(MediaKeyStatusMap) \
macro(MediaKeySystemAccess) \
macro(MediaKeys) \
+ macro(MediaStreamEvent) \
macro(ModernMediaControls) \
macro(NaN) \
+ macro(NavigatorMediaDevices) \
+ macro(NavigatorUserMedia) \
macro(Number) \
macro(NumberFormat) \
macro(Object) \
macro(RegExp) \
macro(Response) \
macro(Request) \
+ macro(RTCDTMFToneChangeEvent) \
+ macro(RTCIceCandidate) \
+ macro(RTCPeerConnection) \
+ macro(RTCRtpReceiver) \
+ macro(RTCRtpSender) \
+ macro(RTCRtpTransceiver) \
+ macro(RTCSessionDescription) \
+ macro(RTCTrackEvent) \
macro(Set)\
macro(SetIterator)\
macro(ShadowRoot) \
+2016-12-09 Eric Carlson <eric.carlson@apple.com>
+
+ Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
+ https://bugs.webkit.org/show_bug.cgi?id=165251
+
+ Reviewed by Dean Jackson.
+
+ Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
+ No new tests, covered by existing tests.
+
+ * Modules/mediastream/MediaStreamEvent.idl: Add "EnabledAtRuntime".
+ * Modules/mediastream/NavigatorMediaDevices.idl: Ditto.
+ * Modules/mediastream/NavigatorUserMedia.idl: Ditto.
+ * Modules/mediastream/RTCDTMFToneChangeEvent.idl: Ditto.
+ * Modules/mediastream/RTCIceCandidate.idl: Ditto.
+ * Modules/mediastream/RTCPeerConnection.idl: Ditto.
+ * Modules/mediastream/RTCRtpReceiver.idl: Ditto.
+ * Modules/mediastream/RTCRtpSender.idl: Ditto.
+ * Modules/mediastream/RTCRtpTransceiver.idl: Ditto.
+ * Modules/mediastream/RTCSessionDescription.idl: Ditto.
+ * Modules/mediastream/RTCTrackEvent.idl: Ditto.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Set m_isMediaStreamEnabled in the
+ constructor instead of in reset() because the later is called by the Internals constructor,
+ making it impossible to override the runtime flag from WTR or DRT.
+ (WebCore::RuntimeEnabledFeatures::reset): Don't set m_isMediaStreamEnabled.
+ * page/Settings.in: Add peerConnectionEnabled.
+
2016-12-09 Daniel Bates <dabates@apple.com>
Remove QuickLook scheme from the list of secure schemes
[
Conditional=WEB_RTC,
Constructor(DOMString type, MediaStreamEventInit eventInitDict),
+ EnabledAtRuntime=mediaStream,
] interface MediaStreamEvent : Event {
readonly attribute MediaStream? stream;
};
[
Conditional=MEDIA_STREAM,
+ EnabledAtRuntime=mediaStream,
] partial interface Navigator {
readonly attribute MediaDevices mediaDevices;
};
[
Conditional=MEDIA_STREAM,
+ EnabledAtRuntime=mediaStream,
] partial interface Navigator {
[JSBuiltin] void webkitGetUserMedia(MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
};
[
Conditional=WEB_RTC,
Constructor(DOMString type, optional RTCDTMFToneChangeEventInit eventInitDict),
+ EnabledAtRuntime=peerConnection,
] interface RTCDTMFToneChangeEvent : Event {
readonly attribute DOMString tone;
};
Conditional=WEB_RTC,
Constructor(Dictionary dictionary),
ConstructorMayThrowException,
+ EnabledAtRuntime=peerConnection,
ImplementationLacksVTable,
PrivateIdentifier,
PublicIdentifier
ActiveDOMObject,
Conditional=WEB_RTC,
ConstructorCallWith=ScriptExecutionContext,
+ EnabledAtRuntime=peerConnection,
ExportMacro=WEBCORE_EXPORT,
JSBuiltinConstructor,
] interface RTCPeerConnection : EventTarget {
*/
[
- Conditional=WEB_RTC
+ Conditional=WEB_RTC,
+ EnabledAtRuntime=peerConnection,
] interface RTCRtpReceiver {
readonly attribute MediaStreamTrack track;
};
[
Conditional=WEB_RTC,
+ EnabledAtRuntime=peerConnection,
] interface RTCRtpSender {
readonly attribute MediaStreamTrack? track;
*/
[
- Conditional=WEB_RTC
+ Conditional=WEB_RTC,
+ EnabledAtRuntime=peerConnection,
] interface RTCRtpTransceiver {
readonly attribute DOMString? mid;
readonly attribute RTCRtpSender sender;
Conditional=WEB_RTC,
Constructor(Dictionary dictionary),
ConstructorMayThrowException,
+ EnabledAtRuntime=peerConnection,
ImplementationLacksVTable,
PrivateIdentifier,
PublicIdentifier,
[
Conditional=WEB_RTC,
Constructor(DOMString type, RTCTrackEventInit eventInitDict),
+ EnabledAtRuntime=peerConnection,
] interface RTCTrackEvent : Event {
readonly attribute RTCRtpReceiver receiver;
readonly attribute MediaStreamTrack track;
RuntimeEnabledFeatures::RuntimeEnabledFeatures()
{
reset();
+#if ENABLE(MEDIA_STREAM) && PLATFORM(COCOA)
+ m_isMediaStreamEnabled = false;
+#endif
}
void RuntimeEnabledFeatures::reset()
#if ENABLE(INDEXED_DATABASE_IN_WORKERS)
m_isIndexedDBWorkersEnabled = true;
#endif
-#if ENABLE(MEDIA_STREAM) && PLATFORM(COCOA)
- m_isMediaStreamEnabled = false;
-#endif
#if ENABLE(WEB_RTC)
m_isPeerConnectionEnabled = true;
#endif
fullScreenEnabled initial=false, conditional=FULLSCREEN_API
asynchronousSpellCheckingEnabled initial=false
mediaStreamEnabled initial=false
+peerConnectionEnabled initial=false
# This feature requires an implementation of ValidationMessageClient.
interactiveFormValidationEnabled initial=false
+2016-12-09 Eric Carlson <eric.carlson@apple.com>
+
+ Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
+ https://bugs.webkit.org/show_bug.cgi?id=165251
+
+ Reviewed by Dean Jackson.
+
+ Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
+
+ * WebView/WebPreferenceKeysPrivate.h: Add MediaStream and PeerConnection preferences.
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences mediaStreamEnabled]):
+ (-[WebPreferences setMediaStreamEnabled:]):
+ (-[WebPreferences peerConnectionEnabled]):
+ (-[WebPreferences setPeerConnectionEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]):
+
2016-12-09 Ryosuke Niwa <rniwa@webkit.org>
Don’t expose pointer lock in WebKit1 Objective-C API
#define WebKitVisualViewportEnabledPreferenceKey @"WebKitVisualViewportEnabled"
#define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
#define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
+#define WebKitMediaStreamEnabledPreferenceKey @"WebKitMediaStreamEnabled"
+#define WebKitPeerConnectionEnabledPreferenceKey @"WebKitPeerConnectionEnabled"
#if !TARGET_OS_IPHONE
// These are private both because callers should be using the cover methods and because the
#if ENABLE(SUBTLE_CRYPTO)
[NSNumber numberWithBool:YES], WebKitSubtleCryptoEnabledPreferenceKey,
#endif
+
+#if ENABLE(MEDIA_STREAM)
+ [NSNumber numberWithBool:NO], WebKitMediaStreamEnabledPreferenceKey,
+#endif
+
+#if ENABLE(WEB_RTC)
+ [NSNumber numberWithBool:NO], WebKitPeerConnectionEnabledPreferenceKey,
+#endif
+
nil];
#if !PLATFORM(IOS)
[self _setBoolValue:flag forKey:WebKitSubtleCryptoEnabledPreferenceKey];
}
+- (BOOL)mediaStreamEnabled
+{
+ return [self _boolValueForKey:WebKitMediaStreamEnabledPreferenceKey];
+}
+
+- (void)setMediaStreamEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitMediaStreamEnabledPreferenceKey];
+}
+
+- (BOOL)peerConnectionEnabled
+{
+ return [self _boolValueForKey:WebKitPeerConnectionEnabledPreferenceKey];
+}
+
+- (void)setPeerConnectionEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitPeerConnectionEnabledPreferenceKey];
+}
- (void)setMetaRefreshEnabled:(BOOL)enabled
{
- (void)setSubtleCryptoEnabled:(BOOL)flag;
- (BOOL)subtleCryptoEnabled;
+- (void)setMediaStreamEnabled:(BOOL)flag;
+- (BOOL)mediaStreamEnabled;
+
+- (void)setPeerConnectionEnabled:(BOOL)flag;
+- (BOOL)peerConnectionEnabled;
+
#if !TARGET_OS_IPHONE
// zero means do AutoScale
- (float)PDFScaleFactor;
#if ENABLE(MEDIA_STREAM)
settings.setMockCaptureDevicesEnabled([preferences mockCaptureDevicesEnabled]);
settings.setMediaCaptureRequiresSecureConnection([preferences mediaCaptureRequiresSecureConnection]);
+ RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled([preferences mediaStreamEnabled]);
+#endif
+
+#if ENABLE(WEB_RTC)
+ RuntimeEnabledFeatures::sharedFeatures().setPeerConnectionEnabled([preferences peerConnectionEnabled]);
#endif
#if ENABLE(WEB_AUDIO)
+2016-12-09 Eric Carlson <eric.carlson@apple.com>
+
+ Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
+ https://bugs.webkit.org/show_bug.cgi?id=165251
+
+ Reviewed by Dean Jackson.
+
+ Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
+
+ * Shared/WebPreferencesDefinitions.h: Add peerConnectionEnabled.
+
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetPeerConnectionEnabled): Added.
+ (WKPreferencesGetPeerConnectionEnabled): Added.
+ * UIProcess/API/C/WKPreferencesRef.h:
+
+ * WebProcess/InjectedBundle/InjectedBundle.cpp:
+ (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Add WebKitMediaStreamEnabled
+ and WebKitPeerConnectionEnabled.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences): Initialize the peerConnection preference.
+
2016-12-09 Brady Eidson <beidson@apple.com>
Re-landing:
macro(SubpixelCSSOMElementMetricsEnabled, subpixelCSSOMElementMetricsEnabled, Bool, bool, false, "", "") \
macro(UseGiantTiles, useGiantTiles, Bool, bool, false, "", "") \
macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false, "", "") \
+ macro(PeerConnectionEnabled, peerConnectionEnabled, Bool, bool, false, "", "") \
macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false, "", "") \
macro(SpatialNavigationEnabled, spatialNavigationEnabled, Bool, bool, false, "", "") \
macro(MediaSourceEnabled, mediaSourceEnabled, Bool, bool, true, "", "") \
return toImpl(preferencesRef)->mediaStreamEnabled();
}
+void WKPreferencesSetPeerConnectionEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setPeerConnectionEnabled(enabled);
+}
+
+bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->peerConnectionEnabled();
+}
+
void WKPreferencesSetSpatialNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
toImpl(preferencesRef)->setSpatialNavigationEnabled(enabled);
WK_EXPORT void WKPreferencesSetMediaStreamEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetMediaStreamEnabled(WKPreferencesRef preferencesRef);
+// Defaults to false
+WK_EXPORT void WKPreferencesSetPeerConnectionEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef);
+
// Defaults to false.
WK_EXPORT void WKPreferencesSetSpatialNavigationEnabled(WKPreferencesRef preferencesRef, bool enabled);
WK_EXPORT bool WKPreferencesGetSpatialNavigationEnabled(WKPreferencesRef preferencesRef);
RuntimeEnabledFeatures::sharedFeatures().setSubtleCryptoEnabled(enabled);
#endif
+#if ENABLE(MEDIA_STREAM)
+ if (preference == "WebKitMediaStreamEnabled")
+ RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled(enabled);
+#endif
+
+#if ENABLE(WEB_RTC)
+ if (preference == "WebKitPeerConnectionEnabled")
+ RuntimeEnabledFeatures::sharedFeatures().setPeerConnectionEnabled(enabled);
+#endif
+
// Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
#define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
macro(WebKitShouldRespectImageOrientation, ShouldRespectImageOrientation, shouldRespectImageOrientation) \
macro(WebKitEnableCaretBrowsing, CaretBrowsingEnabled, caretBrowsingEnabled) \
macro(WebKitDisplayImagesKey, LoadsImagesAutomatically, loadsImagesAutomatically) \
- macro(WebKitMediaStreamEnabled, MediaStreamEnabled, mediaStreamEnabled) \
macro(WebKitHTTPEquivEnabled, HttpEquivEnabled, httpEquivEnabled) \
macro(WebKitVisualViewportEnabled, VisualViewportEnabled, visualViewportEnabled) \
macro(WebKitLargeImageAsyncDecodingEnabled, LargeImageAsyncDecodingEnabled, largeImageAsyncDecodingEnabled) \
settings.setMediaStreamEnabled(store.getBoolValueForKey(WebPreferencesKey::mediaStreamEnabledKey()));
#endif
+#if ENABLE(WEB_RTC)
+ settings.setPeerConnectionEnabled(store.getBoolValueForKey(WebPreferencesKey::peerConnectionEnabledKey()));
+#endif
+
#if ENABLE(SERVICE_CONTROLS)
settings.setImageControlsEnabled(store.getBoolValueForKey(WebPreferencesKey::imageControlsEnabledKey()));
#endif
+2016-12-09 Eric Carlson <eric.carlson@apple.com>
+
+ Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
+ https://bugs.webkit.org/show_bug.cgi?id=165251
+
+ Reviewed by Dean Jackson.
+
+ Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebPreferencesToConsistentValues): Enable MediaStream and PeerConnection.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::beginTesting): Ditto.
+
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::setMediaStreamEnabled): New.
+ (WTR::TestRunner::setPeerConnectionEnabled): New.
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
2016-12-09 Brady Eidson <beidson@apple.com>
Re-landing:
[preferences setSubtleCryptoEnabled:YES];
+ [preferences setMediaStreamEnabled:YES];
+ [preferences setPeerConnectionEnabled:YES];
+
[WebPreferences _clearNetworkLoaderSession];
[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
}
m_testRunner->setSubtleCryptoEnabled(true);
+ m_testRunner->setMediaStreamEnabled(true);
+ m_testRunner->setPeerConnectionEnabled(true);
+
if (m_timeout > 0)
m_testRunner->setCustomTimeout(m_timeout);
WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
}
+void TestRunner::setMediaStreamEnabled(bool enabled)
+{
+ WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitMediaStreamEnabled"));
+ auto& injectedBundle = InjectedBundle::singleton();
+ WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
+void TestRunner::setPeerConnectionEnabled(bool enabled)
+{
+ WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitPeerConnectionEnabled"));
+ auto& injectedBundle = InjectedBundle::singleton();
+ WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
void TestRunner::setDOMIteratorEnabled(bool enabled)
{
WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitDOMIteratorEnabled"));
void setES6ModulesEnabled(bool);
void setEncryptedMediaAPIEnabled(bool);
void setSubtleCryptoEnabled(bool);
+ void setMediaStreamEnabled(bool);
+ void setPeerConnectionEnabled(bool);
// Special DOM functions.
void clearBackForwardList();