Title: [213283] trunk
Revision
213283
Author
commit-qu...@webkit.org
Date
2017-03-02 08:24:30 -0800 (Thu, 02 Mar 2017)

Log Message

[WebRTC] Activate ICE candidate privacy policy
https://bugs.webkit.org/show_bug.cgi?id=168975

Patch by Youenn Fablet <you...@apple.com> on 2017-03-02
Reviewed by Alex Christensen.

Source/WebCore:

Test: webrtc/datachannel/filter-ice-candidate.html

* testing/Internals.cpp:
(WebCore::Internals::Internals): Disabling ICE candidate filtering by default for rwt.
(WebCore::Internals::setICECandidateFiltering):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences enumeratingAllNetworkInterfacesEnabled]):
(-[WebPreferences setEnumeratingAllNetworkInterfacesEnabled:]):
(-[WebPreferences iceCandidateFilteringEnabled]):
(-[WebPreferences setIceCandidateFilteringEnabled:]):
* WebView/WebPreferencesPrivate.h:

Source/WebKit2:

Disabling network enumeration by default.
Enabling ICE candidate filtering by default.
Chaning ICE candidate filtering according userMediaAccess policy:
- If access is denied, filtering is on.
- If access is granted, filtering is off.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetICECandidateFilteringEnabled):
(WKPreferencesGetICECandidateFilteringEnabled):
(WKPreferencesSetEnumeratingAllNetworkInterfacesEnabled):
(WKPreferencesGetEnumeratingAllNetworkInterfacesEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::toWebCore):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::endedCaptureSession):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:

LayoutTests:

* webrtc/datachannel/filter-ice-candidate-expected.txt: Added.
* webrtc/datachannel/filter-ice-candidate.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (213282 => 213283)


--- trunk/LayoutTests/ChangeLog	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/LayoutTests/ChangeLog	2017-03-02 16:24:30 UTC (rev 213283)
@@ -1,5 +1,15 @@
 2017-03-02  Youenn Fablet  <you...@apple.com>
 
+        [WebRTC] Activate ICE candidate privacy policy
+        https://bugs.webkit.org/show_bug.cgi?id=168975
+
+        Reviewed by Alex Christensen.
+
+        * webrtc/datachannel/filter-ice-candidate-expected.txt: Added.
+        * webrtc/datachannel/filter-ice-candidate.html: Added.
+
+2017-03-02  Youenn Fablet  <you...@apple.com>
+
         Activate some new webrtc tests
         https://bugs.webkit.org/show_bug.cgi?id=168850
 

Added: trunk/LayoutTests/webrtc/datachannel/filter-ice-candidate-expected.txt (0 => 213283)


--- trunk/LayoutTests/webrtc/datachannel/filter-ice-candidate-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/webrtc/datachannel/filter-ice-candidate-expected.txt	2017-03-02 16:24:30 UTC (rev 213283)
@@ -0,0 +1,4 @@
+
+PASS Gathering ICE candidates from a data channel peer connection with ICE candidate filtering off 
+PASS Gathering ICE candidates from a data channel peer connection with ICE candidate filtering on 
+

Added: trunk/LayoutTests/webrtc/datachannel/filter-ice-candidate.html (0 => 213283)


--- trunk/LayoutTests/webrtc/datachannel/filter-ice-candidate.html	                        (rev 0)
+++ trunk/LayoutTests/webrtc/datachannel/filter-ice-candidate.html	2017-03-02 16:24:30 UTC (rev 213283)
@@ -0,0 +1,61 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Testing ICE candidate filtering when using data channel</title>
+    <script src=""
+    <script src=""
+  </head>
+  <body>
+    <script>
+promise_test(function() {
+    return new Promise((resolve, reject) => {
+        var counter = 0;
+        if (window.internals) {
+            internals.useMockRTCPeerConnectionFactory("OneRealPeerConnection");
+            internals.setICECandidateFiltering(false);
+        }
+        var pc = new RTCPeerConnection();
+        pc.createDataChannel('sendDataChannel');
+        pc._onicecandidate_ = (event) => {
+            if (event.candidate) {
+                counter++;
+                return;
+            }
+            if (counter !== 0)
+                resolve();
+            else
+                reject("Host candidates should be found");
+            if (window.internals)
+                internals.setICECandidateFiltering(true);
+            resolve();
+        };
+        pc.createOffer().then((offer) => { pc.setLocalDescription(offer); });
+    })
+}, "Gathering ICE candidates from a data channel peer connection with ICE candidate filtering off");
+
+promise_test(function() {
+    return new Promise((resolve, reject) => {
+        if (window.internals)
+            internals.useMockRTCPeerConnectionFactory("OneRealPeerConnection");
+        var counter = 0;
+        if (window.internals)
+            internals.useMockRTCPeerConnectionFactory("OneRealPeerConnection");
+        var pc = new RTCPeerConnection();
+        pc.createDataChannel('sendDataChannel');
+        pc._onicecandidate_ = (event) => {
+            if (event.candidate) {
+                counter++;
+                return;
+            }
+            if (counter === 0)
+                resolve();
+            else
+                reject("No candidate should be found");
+        };
+        pc.createOffer().then((offer) => { pc.setLocalDescription(offer); });
+    });
+}, "Gathering ICE candidates from a data channel peer connection with ICE candidate filtering on");
+    </script>
+  </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (213282 => 213283)


--- trunk/Source/WebCore/ChangeLog	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebCore/ChangeLog	2017-03-02 16:24:30 UTC (rev 213283)
@@ -1,3 +1,18 @@
+2017-03-02  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC] Activate ICE candidate privacy policy
+        https://bugs.webkit.org/show_bug.cgi?id=168975
+
+        Reviewed by Alex Christensen.
+
+        Test: webrtc/datachannel/filter-ice-candidate.html
+
+        * testing/Internals.cpp:
+        (WebCore::Internals::Internals): Disabling ICE candidate filtering by default for rwt.
+        (WebCore::Internals::setICECandidateFiltering):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2017-03-02  Eric Carlson  <eric.carl...@apple.com>
 
         [MediaStream] UIClient may not be notified of capture state change when leaving a page

Modified: trunk/Source/WebCore/testing/Internals.cpp (213282 => 213283)


--- trunk/Source/WebCore/testing/Internals.cpp	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebCore/testing/Internals.cpp	2017-03-02 16:24:30 UTC (rev 213283)
@@ -460,7 +460,13 @@
 #if ENABLE(WEB_RTC)
     enableMockMediaEndpoint();
     useMockRTCPeerConnectionFactory(String());
+#if USE(LIBWEBRTC)
+    if (document.page()) {
+        document.page()->libWebRTCProvider().enableEnumeratingAllNetworkInterfaces();
+        document.page()->rtcController().disableICECandidateFiltering();
+    }
 #endif
+#endif
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     if (document.page())
@@ -1166,6 +1172,19 @@
 #endif
 }
 
+void Internals::setICECandidateFiltering(bool enabled)
+{
+    Document* document = contextDocument();
+    auto* page = document->page();
+    if (!page)
+        return;
+    auto& rtcController = page->rtcController();
+    if (enabled)
+        rtcController.enableICECandidateFiltering();
+    else
+        rtcController.disableICECandidateFiltering();
+}
+
 #endif
 
 #if ENABLE(MEDIA_STREAM)

Modified: trunk/Source/WebCore/testing/Internals.h (213282 => 213283)


--- trunk/Source/WebCore/testing/Internals.h	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebCore/testing/Internals.h	2017-03-02 16:24:30 UTC (rev 213283)
@@ -398,6 +398,7 @@
     void enableMockMediaEndpoint();
     void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection&, const String& action);
     void useMockRTCPeerConnectionFactory(const String&);
+    void setICECandidateFiltering(bool);
 #endif
 
     String getImageSourceURL(Element&);

Modified: trunk/Source/WebCore/testing/Internals.idl (213282 => 213283)


--- trunk/Source/WebCore/testing/Internals.idl	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebCore/testing/Internals.idl	2017-03-02 16:24:30 UTC (rev 213283)
@@ -441,8 +441,10 @@
     [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
     [Conditional=WIRELESS_PLAYBACK_TARGET, MayThrowException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
     [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);
+
     [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action);
     [Conditional=WEB_RTC] void useMockRTCPeerConnectionFactory(DOMString testCase);
+    [Conditional=WEB_RTC] void setICECandidateFiltering(boolean enabled);
 
     [Conditional=VIDEO] void simulateSystemSleep();
     [Conditional=VIDEO] void simulateSystemWake();

Modified: trunk/Source/WebKit/mac/ChangeLog (213282 => 213283)


--- trunk/Source/WebKit/mac/ChangeLog	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-03-02 16:24:30 UTC (rev 213283)
@@ -1,3 +1,18 @@
+2017-03-02  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC] Activate ICE candidate privacy policy
+        https://bugs.webkit.org/show_bug.cgi?id=168975
+
+        Reviewed by Alex Christensen.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences enumeratingAllNetworkInterfacesEnabled]):
+        (-[WebPreferences setEnumeratingAllNetworkInterfacesEnabled:]):
+        (-[WebPreferences iceCandidateFilteringEnabled]):
+        (-[WebPreferences setIceCandidateFilteringEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+
 2017-03-01  Alex Christensen  <achristen...@webkit.org>
 
         Unreviewed, rolling out r213259.

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (213282 => 213283)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2017-03-02 16:24:30 UTC (rev 213283)
@@ -221,6 +221,8 @@
 #define WebKitEnableInheritURIQueryComponentPreferenceKey @"WebKitEnableInheritURIQueryComponent"
 #define WebKitMediaDataLoadsAutomaticallyPreferenceKey @"WebKitMediaDataLoadsAutomatically"
 #define WebKitMockCaptureDevicesEnabledPreferenceKey @"WebKitMockCaptureDevicesEnabled"
+#define WebKitEnumeratingAllNetworkInterfacesEnabledPreferenceKey @"WebKitEnumeratingAllNetworkInterfacesEnabled"
+#define WebKitICECandidateFilteringEnabledPreferenceKey @"WebKitICECandidateFilteringEnabled"
 #define WebKitMediaCaptureRequiresSecureConnectionPreferenceKey @"WebKitMediaCaptureRequiresSecureConnection"
 #define WebKitAttachmentElementEnabledPreferenceKey @"WebKitAttachmentElementEnabled"
 #define WebKitIntersectionObserverEnabledPreferenceKey @"WebKitIntersectionObserverEnabled"

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (213282 => 213283)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2017-03-02 16:24:30 UTC (rev 213283)
@@ -2834,6 +2834,26 @@
     [self _setBoolValue:flag forKey:WebKitMockCaptureDevicesEnabledPreferenceKey];
 }
 
+- (BOOL)enumeratingAllNetworkInterfacesEnabled
+{
+    return [self _boolValueForKey:WebKitEnumeratingAllNetworkInterfacesEnabledPreferenceKey];
+}
+
+- (void)setEnumeratingAllNetworkInterfacesEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitEnumeratingAllNetworkInterfacesEnabledPreferenceKey];
+}
+
+- (BOOL)iceCandidateFilteringEnabled
+{
+    return [self _boolValueForKey:WebKitICECandidateFilteringEnabledPreferenceKey];
+}
+
+- (void)setIceCandidateFilteringEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitICECandidateFilteringEnabledPreferenceKey];
+}
+
 - (BOOL)mediaCaptureRequiresSecureConnection
 {
     return [self _boolValueForKey:WebKitMediaCaptureRequiresSecureConnectionPreferenceKey];

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (213282 => 213283)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2017-03-02 16:24:30 UTC (rev 213283)
@@ -496,6 +496,12 @@
 - (void)setMockCaptureDevicesEnabled:(BOOL)flag;
 - (BOOL)mockCaptureDevicesEnabled;
 
+- (void)setEnumeratingAllNetworkInterfacesEnabled:(BOOL)flag;
+- (BOOL)enumeratingAllNetworkInterfacesEnabled;
+
+- (void)setIceCandidateFilteringEnabled:(BOOL)flag;
+- (BOOL)iceCandidateFilteringEnabled;
+
 - (void)setMediaCaptureRequiresSecureConnection:(BOOL)flag;
 - (BOOL)mediaCaptureRequiresSecureConnection;
 

Modified: trunk/Source/WebKit2/ChangeLog (213282 => 213283)


--- trunk/Source/WebKit2/ChangeLog	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-02 16:24:30 UTC (rev 213283)
@@ -1,3 +1,37 @@
+2017-03-02  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC] Activate ICE candidate privacy policy
+        https://bugs.webkit.org/show_bug.cgi?id=168975
+
+        Reviewed by Alex Christensen.
+
+        Disabling network enumeration by default.
+        Enabling ICE candidate filtering by default.
+        Chaning ICE candidate filtering according userMediaAccess policy:
+        - If access is denied, filtering is on.
+        - If access is granted, filtering is off.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode):
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetICECandidateFilteringEnabled):
+        (WKPreferencesGetICECandidateFilteringEnabled):
+        (WKPreferencesSetEnumeratingAllNetworkInterfacesEnabled):
+        (WKPreferencesGetEnumeratingAllNetworkInterfacesEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+        (WebKit::toWebCore):
+        (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
+        * UIProcess/UserMediaProcessManager.cpp:
+        (WebKit::UserMediaProcessManager::willCreateMediaStream):
+        (WebKit::UserMediaProcessManager::endedCaptureSession):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::creationParameters):
+        * WebProcess/WebPage/WebPage.cpp:
+
 2017-03-02  Tomas Popela  <tpop...@redhat.com>
 
         [WK2] Keyboard menu key should show context menu

Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (213282 => 213283)


--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2017-03-02 16:24:30 UTC (rev 213283)
@@ -94,9 +94,9 @@
     encoder.encodeEnum(observedLayoutMilestones);
     encoder << overrideContentSecurityPolicy;
 #if ENABLE(WEB_RTC)
-    encoder << disableICECandidateFiltering;
+    encoder << iceCandidateFilteringEnabled;
 #if USE(LIBWEBRTC)
-    encoder << enableEnumeratingAllNetworkInterfaces;
+    encoder << enumeratingAllNetworkInterfacesEnabled;
 #endif
 #endif
 }
@@ -222,10 +222,10 @@
         return false;
 
 #if ENABLE(WEB_RTC)
-    if (!decoder.decode(parameters.disableICECandidateFiltering))
+    if (!decoder.decode(parameters.iceCandidateFilteringEnabled))
         return false;
 #if USE(LIBWEBRTC)
-    if (!decoder.decode(parameters.enableEnumeratingAllNetworkInterfaces))
+    if (!decoder.decode(parameters.enumeratingAllNetworkInterfacesEnabled))
         return false;
 #endif
 #endif

Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (213282 => 213283)


--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h	2017-03-02 16:24:30 UTC (rev 213283)
@@ -147,9 +147,9 @@
     String overrideContentSecurityPolicy;
 
 #if ENABLE(WEB_RTC)
-    bool disableICECandidateFiltering { false };
+    bool iceCandidateFilteringEnabled { true };
 #if USE(LIBWEBRTC)
-    bool enableEnumeratingAllNetworkInterfaces { false };
+    bool enumeratingAllNetworkInterfacesEnabled { false };
 #endif
 #endif
 };

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (213282 => 213283)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-03-02 16:24:30 UTC (rev 213283)
@@ -225,6 +225,8 @@
     macro(HTTPEquivEnabled, httpEquivEnabled, Bool, bool, true, "", "") \
     macro(MockCaptureDevicesEnabled, mockCaptureDevicesEnabled, Bool, bool, false, "", "") \
     macro(MediaCaptureRequiresSecureConnection, mediaCaptureRequiresSecureConnection, Bool, bool, true, "", "") \
+    macro(EnumeratingAllNetworkInterfacesEnabled, enumeratingAllNetworkInterfacesEnabled, Bool, bool, false, "", "") \
+    macro(ICECandidateFilteringEnabled, iceCandidateFilteringEnabled, Bool, bool, true, "", "") \
     macro(ShadowDOMEnabled, shadowDOMEnabled, Bool, bool, true, "Shadow DOM", "HTML Shadow DOM prototype") \
     macro(FetchAPIEnabled, fetchAPIEnabled, Bool, bool, true, "", "") \
     macro(DownloadAttributeEnabled, downloadAttributeEnabled, Bool, bool, true, "", "") \

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (213282 => 213283)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2017-03-02 16:24:30 UTC (rev 213283)
@@ -1541,6 +1541,26 @@
     return toImpl(preferencesRef)->mockCaptureDevicesEnabled();
 }
 
+void WKPreferencesSetICECandidateFilteringEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setICECandidateFilteringEnabled(enabled);
+}
+
+bool WKPreferencesGetICECandidateFilteringEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->iceCandidateFilteringEnabled();
+}
+
+void WKPreferencesSetEnumeratingAllNetworkInterfacesEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setEnumeratingAllNetworkInterfacesEnabled(enabled);
+}
+
+bool WKPreferencesGetEnumeratingAllNetworkInterfacesEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->enumeratingAllNetworkInterfacesEnabled();
+}
+
 void WKPreferencesSetMediaCaptureRequiresSecureConnection(WKPreferencesRef preferencesRef, bool enabled)
 {
     toImpl(preferencesRef)->setMediaCaptureRequiresSecureConnection(enabled);

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (213282 => 213283)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2017-03-02 16:24:30 UTC (rev 213283)
@@ -422,6 +422,14 @@
 WK_EXPORT bool WKPreferencesGetMockCaptureDevicesEnabled(WKPreferencesRef);
 
 // Defaults to true.
+WK_EXPORT void WKPreferencesSetICECandidateFilteringEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetICECandidateFilteringEnabled(WKPreferencesRef);
+
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetEnumeratingAllNetworkInterfacesEnabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetEnumeratingAllNetworkInterfacesEnabled(WKPreferencesRef);
+
+// Defaults to true.
 WK_EXPORT void WKPreferencesSetMediaCaptureRequiresSecureConnection(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetMediaCaptureRequiresSecureConnection(WKPreferencesRef);
 

Modified: trunk/Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp (213282 => 213283)


--- trunk/Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp	2017-03-02 16:24:30 UTC (rev 213283)
@@ -157,7 +157,7 @@
         return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::OtherFailure);
         break;
     }
-    
+
     ASSERT_NOT_REACHED();
     return static_cast<uint64_t>(UserMediaRequest::MediaAccessDenialReason::OtherFailure);
 }

Modified: trunk/Source/WebKit2/UIProcess/UserMediaProcessManager.cpp (213282 => 213283)


--- trunk/Source/WebKit2/UIProcess/UserMediaProcessManager.cpp	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/UIProcess/UserMediaProcessManager.cpp	2017-03-02 16:24:30 UTC (rev 213283)
@@ -128,6 +128,12 @@
     }
 
     unsigned currentExtensions = state.sandboxExtensionsGranted();
+
+#if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
+    if (currentExtensions == ProcessState::SandboxExtensionsGranted::None && (withAudio || withVideo))
+        proxy.page().process().send(Messages::WebPage::DisableICECandidateFiltering(), proxy.page().pageID());
+#endif
+
     if (!(requiredExtensions & currentExtensions)) {
         SandboxExtension::HandleArray handles;
         handles.allocate(extensionCount);
@@ -192,6 +198,11 @@
     if (params.isEmpty())
         return;
 
+#if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
+    if (currentExtensions == ProcessState::SandboxExtensionsGranted::None && proxy.page().preferences().iceCandidateFilteringEnabled())
+        proxy.page().process().send(Messages::WebPage::EnableICECandidateFiltering(), proxy.page().pageID());
+#endif
+
     state.setSandboxExtensionsGranted(currentExtensions);
     proxy.page().process().send(Messages::WebPage::RevokeUserMediaDeviceSandboxExtensions(params), proxy.page().pageID());
 #endif

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (213282 => 213283)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-03-02 16:24:30 UTC (rev 213283)
@@ -5571,11 +5571,9 @@
     parameters.overrideContentSecurityPolicy = m_overrideContentSecurityPolicy;
 
 #if ENABLE(WEB_RTC)
-    // FIXME: We should tie ICE filtering with getUserMedia permission.
-    parameters.disableICECandidateFiltering = true;
+    parameters.iceCandidateFilteringEnabled = m_preferences->iceCandidateFilteringEnabled();
 #if USE(LIBWEBRTC)
-    // FIXME: Turn down network interface enumeration by default.
-    parameters.enableEnumeratingAllNetworkInterfaces = true;
+    parameters.enumeratingAllNetworkInterfacesEnabled = m_preferences->enumeratingAllNetworkInterfacesEnabled();
 #endif
 #endif
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (213282 => 213283)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-03-02 16:05:53 UTC (rev 213282)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-03-02 16:24:30 UTC (rev 213283)
@@ -553,10 +553,10 @@
 #endif
 
 #if ENABLE(WEB_RTC)
-    if (parameters.disableICECandidateFiltering)
+    if (!parameters.iceCandidateFilteringEnabled)
         disableICECandidateFiltering();
 #if USE(LIBWEBRTC)
-    if (parameters.enableEnumeratingAllNetworkInterfaces)
+    if (parameters.enumeratingAllNetworkInterfacesEnabled)
         enableEnumeratingAllNetworkInterfaces();
 #endif
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to