[Cocoa] Add a modern WKPreferences switch to disable WebRTC
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2017 23:35:41 +0000 (23:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2017 23:35:41 +0000 (23:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176638
<rdar://problem/34335158>

Patch by Youenn Fablet <youenn@apple.com> on 2017-09-26
Reviewed by Alex Christensen.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _peerConnectionEnabled]):
(-[WKPreferences _setPeerConnectionEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222533 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h

index e1d7c41..19255c3 100644 (file)
@@ -1,3 +1,16 @@
+2017-09-26  Youenn Fablet  <youenn@apple.com>
+
+        [Cocoa] Add a modern WKPreferences switch to disable WebRTC
+        https://bugs.webkit.org/show_bug.cgi?id=176638
+        <rdar://problem/34335158>
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _peerConnectionEnabled]):
+        (-[WKPreferences _setPeerConnectionEnabled:]):
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+
 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
 
         Harden our access to the vector of URL schemes.
index aa87128..804b468 100644 (file)
@@ -562,6 +562,16 @@ static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPo
     _preferences->setLoadsImagesAutomatically(loadsImagesAutomatically);
 }
 
+- (BOOL)_peerConnectionEnabled
+{
+    return _preferences->peerConnectionEnabled();
+}
+
+- (void)_setPeerConnectionEnabled:(BOOL)enabled
+{
+    _preferences->setPeerConnectionEnabled(enabled);
+}
+
 - (BOOL)_mediaDevicesEnabled
 {
     return _preferences->mediaDevicesEnabled();
index bb71fea..f18b006 100644 (file)
@@ -102,6 +102,7 @@ typedef NS_OPTIONS(NSUInteger, _WKJavaScriptRuntimeFlags) {
 
 @property (nonatomic, setter=_setLoadsImagesAutomatically:) BOOL _loadsImagesAutomatically WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 
+@property (nonatomic, setter=_setPeerConnectionEnabled:) BOOL _peerConnectionEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 @property (nonatomic, setter=_setMediaDevicesEnabled:) BOOL _mediaDevicesEnabled WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 @property (nonatomic, setter=_setMockCaptureDevicesEnabled:) BOOL _mockCaptureDevicesEnabled WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 @property (nonatomic, setter=_setMockCaptureDevicesPromptEnabled:) BOOL _mockCaptureDevicesPromptEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));