Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (237777 => 237778)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-11-04 07:55:02 UTC (rev 237778)
@@ -1,3 +1,13 @@
+2018-11-04 Youenn Fablet <[email protected]>
+
+ Add support for RTCMuxPolicy
+ https://bugs.webkit.org/show_bug.cgi?id=191188
+
+ Reviewed by Eric Carlson.
+
+ * web-platform-tests/webrtc/RTCConfiguration-rtcpMuxPolicy-expected.txt:
+ * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:
+
2018-11-03 Youenn Fablet <[email protected]>
Refresh WPT webrtc tests
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-rtcpMuxPolicy-expected.txt (237777 => 237778)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-rtcpMuxPolicy-expected.txt 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-rtcpMuxPolicy-expected.txt 2018-11-04 07:55:02 UTC (rev 237778)
@@ -1,22 +1,15 @@
-FAIL new RTCPeerConnection() should have default rtcpMuxPolicy require assert_equals: expected (string) "require" but got (undefined) undefined
-FAIL new RTCPeerConnection({ rtcpMuxPolicy: undefined }) should have default rtcpMuxPolicy require assert_equals: expected (string) "require" but got (undefined) undefined
-FAIL new RTCPeerConnection({ rtcpMuxPolicy: 'require' }) should succeed assert_equals: expected (string) "require" but got (undefined) undefined
-FAIL new RTCPeerConnection({ rtcpMuxPolicy: 'negotiate' }) may succeed or throw NotSupportedError assert_equals: expected (string) "negotiate" but got (undefined) undefined
-FAIL new RTCPeerConnection(config) - with { rtcpMuxPolicy: null } should throw TypeError assert_throws: function "() =>
- makePc({ rtcpMuxPolicy: null })" did not throw
-FAIL setConfiguration(config) - with { rtcpMuxPolicy: null } should throw TypeError assert_throws: function "() =>
- makePc({ rtcpMuxPolicy: null })" did not throw
-FAIL new RTCPeerConnection(config) - with { rtcpMuxPolicy: 'invalid' } should throw TypeError assert_throws: function "() =>
- makePc({ rtcpMuxPolicy: 'invalid' })" did not throw
-FAIL setConfiguration(config) - with { rtcpMuxPolicy: 'invalid' } should throw TypeError assert_throws: function "() =>
- makePc({ rtcpMuxPolicy: 'invalid' })" did not throw
-FAIL setConfiguration({ rtcpMuxPolicy: 'negotiate' }) with initial rtcpMuxPolicy require should throw InvalidModificationError assert_throws: function "() =>
- pc.setConfiguration({ rtcpMuxPolicy: 'negotiate' })" did not throw
-FAIL setConfiguration({ rtcpMuxPolicy: 'require' }) with initial rtcpMuxPolicy negotiate should throw InvalidModificationError assert_throws: function "() =>
- pc.setConfiguration({ rtcpMuxPolicy: 'require' })" did not throw
-FAIL setConfiguration({}) with initial rtcpMuxPolicy negotiate should throw InvalidModificationError assert_throws: function "() =>
- pc.setConfiguration({})" did not throw
+PASS new RTCPeerConnection() should have default rtcpMuxPolicy require
+PASS new RTCPeerConnection({ rtcpMuxPolicy: undefined }) should have default rtcpMuxPolicy require
+PASS new RTCPeerConnection({ rtcpMuxPolicy: 'require' }) should succeed
+PASS new RTCPeerConnection({ rtcpMuxPolicy: 'negotiate' }) may succeed or throw NotSupportedError
+PASS new RTCPeerConnection(config) - with { rtcpMuxPolicy: null } should throw TypeError
+PASS setConfiguration(config) - with { rtcpMuxPolicy: null } should throw TypeError
+PASS new RTCPeerConnection(config) - with { rtcpMuxPolicy: 'invalid' } should throw TypeError
+PASS setConfiguration(config) - with { rtcpMuxPolicy: 'invalid' } should throw TypeError
+PASS setConfiguration({ rtcpMuxPolicy: 'negotiate' }) with initial rtcpMuxPolicy require should throw InvalidModificationError
+PASS setConfiguration({ rtcpMuxPolicy: 'require' }) with initial rtcpMuxPolicy negotiate should throw InvalidModificationError
+PASS setConfiguration({}) with initial rtcpMuxPolicy negotiate should throw InvalidModificationError
FAIL setRemoteDescription throws InvalidAccessError when called with an offer without rtcp-mux and rtcpMuxPolicy is set to require assert_throws: function "function () { throw e }" threw object "OperationError: Failed to set remote offer sdp: The m= section:audio1 is invalid. RTCP-MUX is not enabled when it is required." that is not a DOMException InvalidAccessError: property "code" is equal to 0, expected 15
FAIL setRemoteDescription throws InvalidAccessError when called with an answer without rtcp-mux and rtcpMuxPolicy is set to require assert_throws: function "function () { throw e }" threw object "OperationError: Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer. Rejecting answer." that is not a DOMException InvalidAccessError: property "code" is equal to 0, expected 15
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt (237777 => 237778)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt 2018-11-04 07:55:02 UTC (rev 237778)
@@ -53,15 +53,11 @@
PASS new RTCPeerConnection({ bundlePolicy: "max-compat" })
PASS new RTCPeerConnection({ bundlePolicy: "max-bundle" })
PASS new RTCPeerConnection({ bundlePolicy: "invalid" })
-FAIL new RTCPeerConnection({ rtcpMuxPolicy: null }) assert_throws: function "function () {
- eval(expr);
- }" did not throw
+PASS new RTCPeerConnection({ rtcpMuxPolicy: null })
PASS new RTCPeerConnection({ rtcpMuxPolicy: undefined })
PASS new RTCPeerConnection({ rtcpMuxPolicy: "negotiate" })
PASS new RTCPeerConnection({ rtcpMuxPolicy: "require" })
-FAIL new RTCPeerConnection({ rtcpMuxPolicy: "invalid" }) assert_throws: function "function () {
- eval(expr);
- }" did not throw
+PASS new RTCPeerConnection({ rtcpMuxPolicy: "invalid" })
FAIL new RTCPeerConnection({ peerIdentity: toStringThrows }) assert_throws: function "function () {
eval(expr);
}" did not throw
Modified: trunk/Source/WebCore/ChangeLog (237777 => 237778)
--- trunk/Source/WebCore/ChangeLog 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/Source/WebCore/ChangeLog 2018-11-04 07:55:02 UTC (rev 237778)
@@ -1,3 +1,30 @@
+2018-11-04 Youenn Fablet <[email protected]>
+
+ Add support for RTCMuxPolicy
+ https://bugs.webkit.org/show_bug.cgi?id=191188
+
+ Reviewed by Eric Carlson.
+
+ Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration.
+ Make sure setConfiguration throws if trying to change this policy.
+ Pipe this parameter up to libwebrtc.
+ Covered by rebased test.
+
+ * Modules/mediastream/RTCConfiguration.h:
+ * Modules/mediastream/RTCConfiguration.idl:
+ * Modules/mediastream/RTCPeerConnection.cpp:
+ (WebCore::iceServersFromConfiguration):
+ (WebCore::RTCPeerConnection::initializeConfiguration):
+ (WebCore::RTCPeerConnection::setConfiguration):
+ * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+ (WebCore::rtcpMuxPolicyfromConfiguration):
+ (WebCore::configurationFromMediaEndpointConfiguration):
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/mediastream/MediaEndpointConfiguration.cpp:
+ (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
+ * platform/mediastream/MediaEndpointConfiguration.h:
+ * platform/mediastream/RTCPMuxPolicy.h: Added.
+
2018-11-03 Devin Rousso <[email protected]>
Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
Modified: trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h (237777 => 237778)
--- trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.h 2018-11-04 07:55:02 UTC (rev 237778)
@@ -37,6 +37,7 @@
#include "RTCCertificate.h"
#include "RTCIceServer.h"
#include "RTCIceTransportPolicy.h"
+#include "RTCPMuxPolicy.h"
namespace WebCore {
@@ -44,6 +45,7 @@
std::optional<Vector<RTCIceServer>> iceServers;
RTCIceTransportPolicy iceTransportPolicy;
RTCBundlePolicy bundlePolicy;
+ RTCPMuxPolicy rtcpMuxPolicy;
unsigned short iceCandidatePoolSize;
Vector<RefPtr<RTCCertificate>> certificates;
};
Modified: trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.idl (237777 => 237778)
--- trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.idl 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/Source/WebCore/Modules/mediastream/RTCConfiguration.idl 2018-11-04 07:55:02 UTC (rev 237778)
@@ -45,12 +45,21 @@
[
Conditional=WEB_RTC,
EnabledAtRuntime=PeerConnection,
+ ImplementedAs=RTCPMuxPolicy
+] enum RTCPMuxPolicy {
+ "negotiate",
+ "require"
+};
+
+[
+ Conditional=WEB_RTC,
+ EnabledAtRuntime=PeerConnection,
JSGenerateToJSObject,
] dictionary RTCConfiguration {
sequence<RTCIceServer> iceServers;
RTCIceTransportPolicy iceTransportPolicy = "all";
RTCBundlePolicy bundlePolicy = "balanced";
- // FIXME 169662: missing rtcpMuxPolicy
+ RTCPMuxPolicy rtcpMuxPolicy = "require";
// FIXME 169662: missing peerIdentity
sequence<RTCCertificate> certificates;
[EnforceRange] octet iceCandidatePoolSize = 0;
Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (237777 => 237778)
--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp 2018-11-04 07:55:02 UTC (rev 237778)
@@ -260,8 +260,11 @@
static inline ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& newConfiguration, const RTCConfiguration* existingConfiguration, bool isLocalDescriptionSet)
{
if (existingConfiguration && newConfiguration.bundlePolicy != existingConfiguration->bundlePolicy)
- return Exception { InvalidModificationError, "IceTransportPolicy does not match existing policy" };
+ return Exception { InvalidModificationError, "BundlePolicy does not match existing policy" };
+ if (existingConfiguration && newConfiguration.rtcpMuxPolicy != existingConfiguration->rtcpMuxPolicy)
+ return Exception { InvalidModificationError, "RTCPMuxPolicy does not match existing policy" };
+
if (existingConfiguration && newConfiguration.iceCandidatePoolSize != existingConfiguration->iceCandidatePoolSize && isLocalDescriptionSet)
return Exception { InvalidModificationError, "IceTransportPolicy pool size does not match existing pool size" };
@@ -320,7 +323,7 @@
if (certificates.hasException())
return certificates.releaseException();
- if (!m_backend->setConfiguration({ servers.releaseReturnValue(), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.iceCandidatePoolSize, certificates.releaseReturnValue() }))
+ if (!m_backend->setConfiguration({ servers.releaseReturnValue(), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.rtcpMuxPolicy, configuration.iceCandidatePoolSize, certificates.releaseReturnValue() }))
return Exception { InvalidAccessError, "Bad Configuration Parameters" };
m_configuration = WTFMove(configuration);
@@ -351,7 +354,7 @@
}
}
- if (!m_backend->setConfiguration({ servers.releaseReturnValue(), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.iceCandidatePoolSize, { } }))
+ if (!m_backend->setConfiguration({ servers.releaseReturnValue(), configuration.iceTransportPolicy, configuration.bundlePolicy, configuration.rtcpMuxPolicy, configuration.iceCandidatePoolSize, { } }))
return Exception { InvalidAccessError, "Bad Configuration Parameters" };
m_configuration = WTFMove(configuration);
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp (237777 => 237778)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp 2018-11-04 07:55:02 UTC (rev 237778)
@@ -88,6 +88,19 @@
return webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat;
}
+static inline webrtc::PeerConnectionInterface::RtcpMuxPolicy rtcpMuxPolicyfromConfiguration(const MediaEndpointConfiguration& configuration)
+{
+ switch (configuration.rtcpMuxPolicy) {
+ case RTCPMuxPolicy::Negotiate:
+ return webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate;
+ case RTCPMuxPolicy::Require:
+ return webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire;
+ }
+
+ ASSERT_NOT_REACHED();
+ return webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire;
+}
+
static inline webrtc::PeerConnectionInterface::IceTransportsType iceTransportPolicyfromConfiguration(const MediaEndpointConfiguration& configuration)
{
switch (configuration.iceTransportPolicy) {
@@ -107,6 +120,7 @@
rtcConfiguration.type = iceTransportPolicyfromConfiguration(configuration);
rtcConfiguration.bundle_policy = bundlePolicyfromConfiguration(configuration);
+ rtcConfiguration.rtcp_mux_policy = rtcpMuxPolicyfromConfiguration(configuration);
for (auto& server : configuration.iceServers) {
webrtc::PeerConnectionInterface::IceServer iceServer;
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (237777 => 237778)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-11-04 07:55:02 UTC (rev 237778)
@@ -7261,6 +7261,7 @@
4129C9871F58662D009D7403 /* ReadableStreamSink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamSink.cpp; sourceTree = "<group>"; };
4129DF831BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamPrivateConstructors.cpp; sourceTree = "<group>"; };
4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamPrivateConstructors.h; sourceTree = "<group>"; };
+ 412BA5FE218C651800365474 /* RTCPMuxPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPMuxPolicy.h; sourceTree = "<group>"; };
413015D51C7B570400091C6E /* FetchResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchResponse.cpp; sourceTree = "<group>"; };
413015D51C7B570400091C6F /* FetchBodySource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchBodySource.cpp; sourceTree = "<group>"; };
413015D61C7B570400091C6E /* FetchResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchResponse.h; sourceTree = "<group>"; };
@@ -15570,6 +15571,7 @@
313591011E7DDC6000F30630 /* RTCIceGatheringState.h */,
313591021E7DDC6000F30630 /* RTCIceTransportPolicy.h */,
313591031E7DDC6000F30630 /* RTCIceTransportState.h */,
+ 412BA5FE218C651800365474 /* RTCPMuxPolicy.h */,
07221BAA17CF0AD400848E51 /* RTCPeerConnectionHandlerClient.h */,
41A48A9D1E8312EB00D2AC2D /* RTCPeerConnectionState.h */,
31EB54DD1E7DC74400C1623B /* RTCRtpTransceiverDirection.h */,
Modified: trunk/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.cpp (237777 => 237778)
--- trunk/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.cpp 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.cpp 2018-11-04 07:55:02 UTC (rev 237778)
@@ -36,10 +36,11 @@
namespace WebCore {
-MediaEndpointConfiguration::MediaEndpointConfiguration(Vector<IceServerInfo>&& iceServers, RTCIceTransportPolicy iceTransportPolicy, RTCBundlePolicy bundlePolicy, unsigned short iceCandidatePoolSize, Vector<CertificatePEM>&& certificates)
+MediaEndpointConfiguration::MediaEndpointConfiguration(Vector<IceServerInfo>&& iceServers, RTCIceTransportPolicy iceTransportPolicy, RTCBundlePolicy bundlePolicy, RTCPMuxPolicy rtcpMuxPolicy, unsigned short iceCandidatePoolSize, Vector<CertificatePEM>&& certificates)
: iceServers(WTFMove(iceServers))
, iceTransportPolicy(iceTransportPolicy)
, bundlePolicy(bundlePolicy)
+ , rtcpMuxPolicy(rtcpMuxPolicy)
, iceCandidatePoolSize(iceCandidatePoolSize)
, certificates(WTFMove(certificates))
{
Modified: trunk/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h (237777 => 237778)
--- trunk/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h 2018-11-03 23:24:35 UTC (rev 237777)
+++ trunk/Source/WebCore/platform/mediastream/MediaEndpointConfiguration.h 2018-11-04 07:55:02 UTC (rev 237778)
@@ -35,6 +35,7 @@
#include "RTCBundlePolicy.h"
#include "RTCIceTransportPolicy.h"
+#include "RTCPMuxPolicy.h"
#include "URL.h"
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
@@ -55,11 +56,12 @@
String privateKey;
};
- MediaEndpointConfiguration(Vector<IceServerInfo>&&, RTCIceTransportPolicy, RTCBundlePolicy, unsigned short, Vector<CertificatePEM>&&);
+ MediaEndpointConfiguration(Vector<IceServerInfo>&&, RTCIceTransportPolicy, RTCBundlePolicy, RTCPMuxPolicy, unsigned short, Vector<CertificatePEM>&&);
Vector<IceServerInfo> iceServers;
RTCIceTransportPolicy iceTransportPolicy;
RTCBundlePolicy bundlePolicy;
+ RTCPMuxPolicy rtcpMuxPolicy;
unsigned short iceCandidatePoolSize;
Vector<CertificatePEM> certificates;
};
Added: trunk/Source/WebCore/platform/mediastream/RTCPMuxPolicy.h (0 => 237778)
--- trunk/Source/WebCore/platform/mediastream/RTCPMuxPolicy.h (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/RTCPMuxPolicy.h 2018-11-04 07:55:02 UTC (rev 237778)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_RTC)
+
+namespace WebCore {
+
+enum class RTCPMuxPolicy {
+ Negotiate,
+ Require
+};
+
+}; // namespace WebCore
+
+#endif