Diff
Modified: trunk/LayoutTests/ChangeLog (193999 => 194000)
--- trunk/LayoutTests/ChangeLog 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/LayoutTests/ChangeLog 2015-12-12 01:52:43 UTC (rev 194000)
@@ -1,3 +1,13 @@
+2015-12-11 Eric Carlson <eric.carl...@apple.com>
+
+ [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
+ https://bugs.webkit.org/show_bug.cgi?id=152197
+
+ Reviewed by Dean Jackson.
+
+ * fast/mediastream/mock-media-source-expected.txt: Added.
+ * fast/mediastream/mock-media-source.html: Added.
+
2015-12-11 Beth Dakin <bda...@apple.com>
_touchEventRegions should return regions in the view's coordinates
Added: trunk/LayoutTests/fast/mediastream/mock-media-source-expected.txt (0 => 194000)
--- trunk/LayoutTests/fast/mediastream/mock-media-source-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/mediastream/mock-media-source-expected.txt 2015-12-12 01:52:43 UTC (rev 194000)
@@ -0,0 +1,22 @@
+Test enabling/disabling mock media capture devices
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+*** Mock capture devices should be enabled by default
+PASS mediaStream is an instance of Object
+PASS mediaStream.getTracks().length is 2
+
+*** Disable mock capture devices
+internals.setMockMediaCaptureDevicesEnabled(false)
+PASS mediaDevices.getUserMedia() failed with PermissionDeniedError
+
+*** Enable mock capture devices
+internals.setMockMediaCaptureDevicesEnabled(true)
+PASS mediaStream is an instance of Object
+PASS mediaStream.getTracks().length is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/mediastream/mock-media-source.html (0 => 194000)
--- trunk/LayoutTests/fast/mediastream/mock-media-source.html (rev 0)
+++ trunk/LayoutTests/fast/mediastream/mock-media-source.html 2015-12-12 01:52:43 UTC (rev 194000)
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <script src=""
+ <script>
+ var mediaStream;
+
+ function testWhenDisabled()
+ {
+ debug(`<br>*** Disable mock capture devices`);
+ if (window.internals)
+ evalAndLog(`internals.setMockMediaCaptureDevicesEnabled(false)`);
+ navigator.mediaDevices
+ .getUserMedia({audio:{}, video:{}})
+ .then(function(stream) {
+ mediaStream = stream;
+ testFailed(`mediaDevices.getUserMedia() succeeded when no devices should be available`);
+ finishJSTest();
+ })
+ .catch(function(err) {
+ testPassed(`mediaDevices.getUserMedia() failed with ${err.name}`);
+ debug(`<br>*** Enable mock capture devices`);
+ if (window.internals)
+ evalAndLog(`internals.setMockMediaCaptureDevicesEnabled(true)`);
+ testWhenEnabled(null);
+ });
+ }
+
+ function testWhenEnabled(nextTest)
+ {
+ navigator.mediaDevices
+ .getUserMedia({audio:{}, video:{}})
+ .then(function(stream) {
+ mediaStream = stream;
+ shouldBeType("mediaStream", "Object");
+ shouldBe("mediaStream.getTracks().length", "2");
+
+ if (nextTest)
+ nextTest();
+ else
+ finishJSTest();
+ })
+ .catch(function(err) {
+ testFailed(`mediaDevices.getUserMedia() failed with ${err.name}`);
+ finishJSTest();
+ });
+ }
+
+ function start()
+ {
+ debug(`<br>*** Mock capture devices should be enabled by default`);
+ if (window.testRunner)
+ testRunner.setUserMediaPermission(true);
+
+ testWhenEnabled(testWhenDisabled);
+ }
+
+ </script>
+ </head>
+
+ <body _onload_="start()">
+ <p id="description"></p>
+ <div id="console"></div>
+ <script>
+ description("Test enabling/disabling mock media capture devices");
+ window.jsTestIsAsync = true;
+
+ window.successfullyParsed = true;
+ </script>
+ <script src=""
+ </body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (193999 => 194000)
--- trunk/Source/WebCore/ChangeLog 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/ChangeLog 2015-12-12 01:52:43 UTC (rev 194000)
@@ -1,3 +1,34 @@
+2015-12-11 Eric Carlson <eric.carl...@apple.com>
+
+ [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
+ https://bugs.webkit.org/show_bug.cgi?id=152197
+
+ Reviewed by Dean Jackson.
+
+ Test: fast/mediastream/mock-media-source.html
+
+ * page/Settings.cpp:
+ (WebCore::Settings::mockCaptureDevicesEnabled):
+ (WebCore::Settings::setMockCaptureDevicesEnabled):
+ * page/Settings.h:
+
+ * platform/mediastream/RealtimeMediaSourceCenter.cpp:
+ (WebCore::RealtimeMediaSourceCenter::setSharedStreamCenterOverride): Renamed.
+ (WebCore::RealtimeMediaSourceCenter::setSharedStreamCenter): Deleted.
+ * platform/mediastream/RealtimeMediaSourceCenter.h:
+
+ * platform/mock/MockRealtimeMediaSourceCenter.cpp:
+ (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): Renamed. Allow
+ it to be enabled and disabled.
+ (WebCore::MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter): Deleted.
+ * platform/mock/MockRealtimeMediaSourceCenter.h:
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::Internals):
+ (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
2015-12-11 Jer Noble <jer.no...@apple.com>
[EME] Do not pass in the initialization data to AVContentKeyRequest as the contentIdentifier.
Modified: trunk/Source/WebCore/page/Settings.cpp (193999 => 194000)
--- trunk/Source/WebCore/page/Settings.cpp 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/page/Settings.cpp 2015-12-12 01:52:43 UTC (rev 194000)
@@ -49,6 +49,10 @@
#include <wtf/NeverDestroyed.h>
#include <wtf/StdLibExtras.h>
+#if ENABLE(MEDIA_STREAM)
+#include "MockRealtimeMediaSourceCenter.h"
+#endif
+
namespace WebCore {
static void setImageLoadingSettings(Page* page)
@@ -80,6 +84,10 @@
bool Settings::gMockScrollbarsEnabled = false;
bool Settings::gUsesOverlayScrollbars = false;
+#if ENABLE(MEDIA_STREAM)
+bool Settings::gMockCaptureDevicesEnabled = false;
+#endif
+
#if PLATFORM(WIN)
bool Settings::gShouldUseHighResolutionTimers = true;
#endif
@@ -594,6 +602,19 @@
}
#endif
+#if ENABLE(MEDIA_STREAM)
+bool Settings::mockCaptureDevicesEnabled()
+{
+ return gMockCaptureDevicesEnabled;
+}
+
+void Settings::setMockCaptureDevicesEnabled(bool enabled)
+{
+ gMockCaptureDevicesEnabled = enabled;
+ MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled(enabled);
+}
+#endif
+
void Settings::setScrollingPerformanceLoggingEnabled(bool enabled)
{
m_scrollingPerformanceLoggingEnabled = enabled;
Modified: trunk/Source/WebCore/page/Settings.h (193999 => 194000)
--- trunk/Source/WebCore/page/Settings.h 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/page/Settings.h 2015-12-12 01:52:43 UTC (rev 194000)
@@ -281,6 +281,9 @@
#if ENABLE(MEDIA_STREAM)
void setMediaDeviceIdentifierStorageDirectory(const String& directory) { m_mediaDeviceIdentifierStorageDirectory = directory; }
const String& mediaDeviceIdentifierStorageDirectory() const { return m_mediaDeviceIdentifierStorageDirectory; }
+
+ static bool mockCaptureDevicesEnabled();
+ WEBCORE_EXPORT static void setMockCaptureDevicesEnabled(bool);
#endif
WEBCORE_EXPORT void setForcePendingWebGLPolicy(bool);
@@ -356,7 +359,7 @@
#if PLATFORM(COCOA)
WEBCORE_EXPORT static bool gQTKitEnabled;
#endif
-
+
static bool gMockScrollbarsEnabled;
static bool gUsesOverlayScrollbars;
@@ -378,6 +381,7 @@
#if ENABLE(MEDIA_STREAM)
String m_mediaDeviceIdentifierStorageDirectory;
+ static bool gMockCaptureDevicesEnabled;
#endif
static bool gLowPowerVideoAudioBufferSizeEnabled;
Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp (193999 => 194000)
--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp 2015-12-12 01:52:43 UTC (rev 194000)
@@ -53,7 +53,7 @@
return RealtimeMediaSourceCenter::platformCenter();
}
-void RealtimeMediaSourceCenter::setSharedStreamCenter(RealtimeMediaSourceCenter* center)
+void RealtimeMediaSourceCenter::setSharedStreamCenterOverride(RealtimeMediaSourceCenter* center)
{
mediaStreamCenterOverride() = center;
}
Modified: trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h (193999 => 194000)
--- trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h 2015-12-12 01:52:43 UTC (rev 194000)
@@ -53,7 +53,7 @@
virtual ~RealtimeMediaSourceCenter();
WEBCORE_EXPORT static RealtimeMediaSourceCenter& singleton();
- static void setSharedStreamCenter(RealtimeMediaSourceCenter*);
+ static void setSharedStreamCenterOverride(RealtimeMediaSourceCenter*);
virtual void validateRequestConstraints(MediaStreamCreationClient*, RefPtr<MediaConstraints>& audioConstraints, RefPtr<MediaConstraints>& videoConstraints) = 0;
Modified: trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp (193999 => 194000)
--- trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp 2015-12-12 01:52:43 UTC (rev 194000)
@@ -46,13 +46,13 @@
namespace WebCore {
-void MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter()
+void MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled(bool enabled)
{
- DEPRECATED_DEFINE_STATIC_LOCAL(MockRealtimeMediaSourceCenter, center, ());
- static bool registered = false;
- if (!registered) {
- registered = true;
- RealtimeMediaSourceCenter::setSharedStreamCenter(¢er);
+ static NeverDestroyed<MockRealtimeMediaSourceCenter> center;
+ static bool active = false;
+ if (active != enabled) {
+ active = enabled;
+ RealtimeMediaSourceCenter::setSharedStreamCenterOverride(enabled ? ¢er.get() : nullptr);
}
}
Modified: trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h (193999 => 194000)
--- trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.h 2015-12-12 01:52:43 UTC (rev 194000)
@@ -35,9 +35,10 @@
class MockRealtimeMediaSourceCenter final : public RealtimeMediaSourceCenter {
public:
- WEBCORE_EXPORT static void registerMockRealtimeMediaSourceCenter();
+ WEBCORE_EXPORT static void setMockRealtimeMediaSourceCenterEnabled(bool);
private:
+ friend NeverDestroyed<MockRealtimeMediaSourceCenter>;
MockRealtimeMediaSourceCenter();
void validateRequestConstraints(MediaStreamCreationClient*, RefPtr<MediaConstraints>& audioConstraints, RefPtr<MediaConstraints>& videoConstraints) override;
Modified: trunk/Source/WebCore/testing/Internals.cpp (193999 => 194000)
--- trunk/Source/WebCore/testing/Internals.cpp 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/testing/Internals.cpp 2015-12-12 01:52:43 UTC (rev 194000)
@@ -407,7 +407,7 @@
#endif
#if ENABLE(MEDIA_STREAM)
- MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter();
+ setMockMediaCaptureDevicesEnabled(true);
enableMockRTCPeerConnectionHandler();
#endif
@@ -959,6 +959,11 @@
{
RTCPeerConnectionHandler::create = RTCPeerConnectionHandlerMock::create;
}
+
+void Internals::setMockMediaCaptureDevicesEnabled(bool enabled)
+{
+ WebCore::Settings::setMockCaptureDevicesEnabled(enabled);
+}
#endif
Ref<ClientRect> Internals::absoluteCaretBounds(ExceptionCode& ec)
Modified: trunk/Source/WebCore/testing/Internals.h (193999 => 194000)
--- trunk/Source/WebCore/testing/Internals.h 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/testing/Internals.h 2015-12-12 01:52:43 UTC (rev 194000)
@@ -349,6 +349,7 @@
#if ENABLE(MEDIA_STREAM)
void enableMockRTCPeerConnectionHandler();
+ void setMockMediaCaptureDevicesEnabled(bool);
#endif
String getImageSourceURL(Element*, ExceptionCode&);
Modified: trunk/Source/WebCore/testing/Internals.idl (193999 => 194000)
--- trunk/Source/WebCore/testing/Internals.idl 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebCore/testing/Internals.idl 2015-12-12 01:52:43 UTC (rev 194000)
@@ -379,6 +379,7 @@
[Conditional=VIDEO, RaisesException] void postRemoteControlCommand(DOMString command);
[Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
[Conditional=WIRELESS_PLAYBACK_TARGET, RaisesException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
+ [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
[Conditional=VIDEO] void simulateSystemSleep();
[Conditional=VIDEO] void simulateSystemWake();
Modified: trunk/Source/WebKit/mac/ChangeLog (193999 => 194000)
--- trunk/Source/WebKit/mac/ChangeLog 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit/mac/ChangeLog 2015-12-12 01:52:43 UTC (rev 194000)
@@ -1,3 +1,19 @@
+2015-12-11 Eric Carlson <eric.carl...@apple.com>
+
+ [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
+ https://bugs.webkit.org/show_bug.cgi?id=152197
+
+ Reviewed by Dean Jackson.
+
+ * WebView/WebPreferenceKeysPrivate.h:
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+ (-[WebPreferences mockCaptureDevicesEnabled]):
+ (-[WebPreferences setMockCaptureDevicesEnabled:]):
+ * WebView/WebPreferencesPrivate.h:
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]):
+
2015-12-11 Beth Dakin <bda...@apple.com>
_touchEventRegions should return regions in the view's coordinates
Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (193999 => 194000)
--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h 2015-12-12 01:52:43 UTC (rev 194000)
@@ -196,3 +196,5 @@
#define WebKitEnableInheritURIQueryComponentPreferenceKey @"WebKitEnableInheritURIQueryComponent"
#define WebKitMediaDataLoadsAutomaticallyPreferenceKey @"WebKitMediaDataLoadsAutomatically"
+#define WebKitMockCaptureDevicesEnabledPreferenceKey @"WebKitMockCaptureDevicesEnabled"
+
Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (193999 => 194000)
--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm 2015-12-12 01:52:43 UTC (rev 194000)
@@ -600,6 +600,9 @@
#if ENABLE(ENCRYPTED_MEDIA_V2)
@"~/Library/WebKit/MediaKeys", WebKitMediaKeysStorageDirectoryKey,
#endif
+#if ENABLE(MEDIA_STREAM)
+ [NSNumber numberWithBool:NO], WebKitMockCaptureDevicesEnabledPreferenceKey,
+#endif
nil];
#if !PLATFORM(IOS)
@@ -2607,6 +2610,16 @@
[self _setBoolValue:flag forKey:WebKitMediaDataLoadsAutomaticallyPreferenceKey];
}
+- (BOOL)mockCaptureDevicesEnabled
+{
+ return [self _boolValueForKey:WebKitMockCaptureDevicesEnabledPreferenceKey];
+}
+
+- (void)setMockCaptureDevicesEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitMockCaptureDevicesEnabledPreferenceKey];
+}
+
@end
@implementation WebPreferences (WebInternal)
Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (193999 => 194000)
--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h 2015-12-12 01:52:43 UTC (rev 194000)
@@ -458,6 +458,9 @@
- (void)setHTTPEquivEnabled:(BOOL)flag;
- (BOOL)httpEquivEnabled;
+- (void)setMockCaptureDevicesEnabled:(BOOL)flag;
+- (BOOL)mockCaptureDevicesEnabled;
+
@property (nonatomic) BOOL _javascript_MarkupEnabled;
@property (nonatomic) BOOL mediaDataLoadsAutomatically;
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (193999 => 194000)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2015-12-12 01:52:43 UTC (rev 194000)
@@ -2427,6 +2427,10 @@
settings.setAVFoundationEnabled([preferences isAVFoundationEnabled]);
#endif
+#if ENABLE(MEDIA_STREAM)
+ settings.setMockCaptureDevicesEnabled([preferences mockCaptureDevicesEnabled]);
+#endif
+
#if ENABLE(WEB_AUDIO)
settings.setWebAudioEnabled([preferences webAudioEnabled]);
#endif
Modified: trunk/Source/WebKit2/ChangeLog (193999 => 194000)
--- trunk/Source/WebKit2/ChangeLog 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit2/ChangeLog 2015-12-12 01:52:43 UTC (rev 194000)
@@ -1,3 +1,21 @@
+2015-12-11 Eric Carlson <eric.carl...@apple.com>
+
+ [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
+ https://bugs.webkit.org/show_bug.cgi?id=152197
+
+ Reviewed by Dean Jackson.
+
+ * Shared/WebPreferencesDefinitions.h:
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetMockCaptureDevicesEnabled):
+ (WKPreferencesGetMockCaptureDevicesEnabled):
+ * UIProcess/API/C/WKPreferencesRefPrivate.h:
+ * UIProcess/API/Cocoa/WKPreferences.mm:
+ (-[WKPreferences _mockCaptureDevicesEnabled]):
+ (-[WKPreferences _setMockCaptureDevicesEnabled:]):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+
2015-12-11 Joseph Pecoraro <pecor...@apple.com>
check-for-inappropriate-objc-class-names should check all class names, not just externally visible ones
Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (193999 => 194000)
--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2015-12-12 01:52:43 UTC (rev 194000)
@@ -214,6 +214,7 @@
macro(NewBlockInsideInlineModelEnabled, newBlockInsideInlineModelEnabled, Bool, bool, false) \
macro(AntialiasedFontDilationEnabled, antialiasedFontDilationEnabled, Bool, bool, false) \
macro(HTTPEquivEnabled, httpEquivEnabled, Bool, bool, true) \
+ macro(MockCaptureDevicesEnabled, mockCaptureDevicesEnabled, Bool, bool, false) \
#define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
macro(IncrementalRenderingSuppressionTimeout, incrementalRenderingSuppressionTimeout, Double, double, 5) \
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (193999 => 194000)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2015-12-12 01:52:43 UTC (rev 194000)
@@ -1427,9 +1427,9 @@
return toImpl(preferencesRef)->allowsAirPlayForMediaPlayback();
}
-void WKPreferencesSetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef, bool javaEnabled)
+void WKPreferencesSetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef, bool enabled)
{
- toImpl(preferencesRef)->setResourceUsageOverlayVisible(javaEnabled);
+ toImpl(preferencesRef)->setResourceUsageOverlayVisible(enabled);
}
bool WKPreferencesGetResourceUsageOverlayVisible(WKPreferencesRef preferencesRef)
@@ -1437,3 +1437,12 @@
return toImpl(preferencesRef)->resourceUsageOverlayVisible();
}
+void WKPreferencesSetMockCaptureDevicesEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+ toImpl(preferencesRef)->setMockCaptureDevicesEnabled(enabled);
+}
+
+bool WKPreferencesGetMockCaptureDevicesEnabled(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->mockCaptureDevicesEnabled();
+}
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (193999 => 194000)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h 2015-12-12 01:52:43 UTC (rev 194000)
@@ -395,6 +395,10 @@
WK_EXPORT void WKPreferencesSetResourceUsageOverlayVisible(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetResourceUsageOverlayVisible(WKPreferencesRef);
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetMockCaptureDevicesEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetMockCaptureDevicesEnabled(WKPreferencesRef);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm (193999 => 194000)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm 2015-12-12 01:52:43 UTC (rev 194000)
@@ -377,6 +377,16 @@
_preferences->setFixedFontFamily(fixedPitchFontFamily);
}
+- (BOOL)_mockCaptureDevicesEnabled
+{
+ return _preferences->mockCaptureDevicesEnabled();
+}
+
+- (void)_setMockCaptureDevicesEnabled:(BOOL)mockCaptureDevicesEnabled
+{
+ _preferences->setMockCaptureDevicesEnabled(mockCaptureDevicesEnabled);
+}
+
@end
#endif // WK_API_ENABLED
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (193999 => 194000)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-12-12 01:46:55 UTC (rev 193999)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-12-12 01:52:43 UTC (rev 194000)
@@ -2902,6 +2902,10 @@
settings.setMediaSourceEnabled(store.getBoolValueForKey(WebPreferencesKey::mediaSourceEnabledKey()));
#endif
+#if ENABLE(MEDIA_STREAM)
+ settings.setMockCaptureDevicesEnabled(store.getBoolValueForKey(WebPreferencesKey::mockCaptureDevicesEnabledKey()));
+#endif
+
settings.setShouldConvertPositionStyleOnCopy(store.getBoolValueForKey(WebPreferencesKey::shouldConvertPositionStyleOnCopyKey()));
settings.setStandalone(store.getBoolValueForKey(WebPreferencesKey::standaloneKey()));