WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-165736-20161211060607.patch (text/plain), 127.21 KB, created by
Darin Adler
on 2016-12-11 06:06:52 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2016-12-11 06:06:52 PST
Size:
127.21 KB
patch
obsolete
>Subversion Revision: 209681 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 83396cc1893dfb2e0438812f0214f6b7325d9ddd..bd425b53bdfe284471b33e38bb11645d79e5e4eb 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,99 @@ >+2016-12-11 Darin Adler <darin@apple.com> >+ >+ Remove uses of Dictionary in WebRTC IDL files >+ https://bugs.webkit.org/show_bug.cgi?id=165736 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Also removed quite a bit of unused code. There were some mocks that were out of date and >+ no longer matched the types used in the real code, that also were no longer hooked up, >+ and other types of dead code. We will have to implement anew when we want to restore tests >+ like the ones these were intended to enable. >+ >+ * CMakeLists.txt: Updated for all the removed files. >+ >+ * Modules/mediastream/MediaEndpointPeerConnection.cpp: Moved some types in here >+ that don't need to be in the header. >+ (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): Use make_unique. >+ (WebCore::MediaEndpointPeerConnection::setConfiguration): Changed argument type, >+ obviating the need for most of the code that was here. >+ * Modules/mediastream/MediaEndpointPeerConnection.h: Updated for the above. Made more >+ things private and final. Marked the constructor explicit. Removed unneeded includes. >+ >+ * Modules/mediastream/PeerConnectionBackend.h: Removed unneeded includes and forward >+ declarations. Changed the argument type for setConfiguration (see above). >+ >+ * Modules/mediastream/RTCConfiguration.cpp: Removed. >+ None of the code here was needed except for the ICE server validation, and that was >+ moved into RTCPeerConnection::setConfiguration. >+ * Modules/mediastream/RTCConfiguration.h: Changed this from a class to a struct since >+ this is now a dictionary rather than an interface. >+ * Modules/mediastream/RTCConfiguration.idl: Changed this from an interface to a dictionary. >+ >+ * Modules/mediastream/RTCDTMFSender.cpp: Removed some of the code from this file. This >+ class currently isn't implemented, but was depending on RTCPeerConnectionHandler. I removed >+ some of the dead code. Someone will have to straighten this out so we can turn it back on. >+ * Modules/mediastream/RTCDTMFSender.h: Ditto. >+ >+ * Modules/mediastream/RTCDataChannel.cpp: Updated includes. >+ >+ * Modules/mediastream/RTCIceCandidate.cpp: >+ (WebCore::RTCIceCandidate::create): Removed most of the code, since this now takes >+ a structure rather than a WebCore::Dictionary, and so the bindings take care of the work. >+ * Modules/mediastream/RTCIceCandidate.h: Updated for the above. >+ * Modules/mediastream/RTCIceCandidate.idl: Changed the constructor to take a >+ RTCIceCandidateInit instead of a Dictionary. >+ >+ * Modules/mediastream/RTCIceServer.h: Changed this from a class to a struct since >+ this is now a dictionary rather than an interface. >+ * Modules/mediastream/RTCIceServer.idl: Changed this from an interface to a dictionary. >+ >+ * Modules/mediastream/RTCPeerConnection.cpp: >+ (WebCore::RTCPeerConnection::initializeWith): Take an RTCConfiguration rather than >+ a Dictionary. >+ (WebCore::RTCPeerConnection::getConfiguration): Moved to header, now an inline. >+ (WebCore::RTCPeerConnection::setConfiguration): Use the configuration dictionary now instead >+ of the configuration class. Also moved validation of server URLs here, formerly in the >+ RTCConfiguration RTCConfiguration::initialize function. Also moved code to convert from >+ RTCConfiguration to MediaEndpointConfiguration here, formerly in >+ MediaEndpointPeerConnection::setConfiguration. >+ * Modules/mediastream/RTCPeerConnection.h: Updated for the above. >+ * Modules/mediastream/RTCPeerConnection.idl: Changed argument to initializeWith and >+ setConfiguration from Dictionary to RTCConfiguration. >+ >+ * Modules/mediastream/RTCSessionDescription.cpp: >+ (WebCore::parseTypeString): Deleted. >+ (WebCore::RTCSessionDescription::create): Changed to take struct instead of Dictionary. >+ * Modules/mediastream/RTCSessionDescription.h: Added Init struct and changed create to >+ take it. >+ * Modules/mediastream/RTCSessionDescription.idl: Changed constructor argument to take >+ RTCSessionDescriptionInit dictionary instead of Dictionary. >+ >+ * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Updated includes. >+ >+ * WebCore.xcodeproj/project.pbxproj: Updated for all the removed files. >+ >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateDictionaryImplementationContent): Improved the generation of convertDictionaryToJS >+ so that in additional to RefPtr, it works with optional members that use std::optional and >+ WTF::String. Longer term this can be done in a more elegant way that covers more types. >+ >+ * platform/mediastream/RTCConfigurationPrivate.h: Removed. >+ * platform/mediastream/RTCIceServerPrivate.h: Removed. >+ * platform/mediastream/RTCPeerConnectionHandler.cpp: Removed. >+ * platform/mediastream/RTCPeerConnectionHandler.h: Removed. >+ * platform/mock/RTCDTMFSenderHandlerMock.cpp: Removed. >+ * platform/mock/RTCDTMFSenderHandlerMock.h: Removed. >+ >+ * platform/mock/RTCDataChannelHandlerMock.h: Updated includes, made more things private and final. >+ >+ * platform/mock/RTCPeerConnectionHandlerMock.cpp: Removed. >+ * platform/mock/RTCPeerConnectionHandlerMock.h: Removed. >+ >+ * testing/Internals.cpp: >+ (WebCore::Internals::Internals): Removed call to enableMockRTCPeerConnectionHandler. >+ (WebCore::Internals::enableMockRTCPeerConnectionHandler): Deleted. >+ > 2016-12-11 Konstantin Tokarev <annulen@yandex.ru> > > Unreviewed, add KHR include dir to fix ANGLE build after r209665 >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 0a07e9ac5361189a4ed1d7ee44e3609e92624457..5b3ff9d4f309394976e91dadde2ca5dfe80b3c33 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -910,7 +910,6 @@ set(WebCore_SOURCES > Modules/mediastream/MediaStreamTrackEvent.cpp > Modules/mediastream/NavigatorMediaDevices.cpp > Modules/mediastream/PeerConnectionBackend.cpp >- Modules/mediastream/RTCConfiguration.cpp > Modules/mediastream/RTCDTMFSender.cpp > Modules/mediastream/RTCDTMFToneChangeEvent.cpp > Modules/mediastream/RTCDataChannel.cpp >@@ -2334,7 +2333,6 @@ set(WebCore_SOURCES > platform/mediastream/MediaStreamTrackPrivate.cpp > platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp > platform/mediastream/RTCIceCandidateDescriptor.cpp >- platform/mediastream/RTCPeerConnectionHandler.cpp > platform/mediastream/RTCSessionDescriptionDescriptor.cpp > platform/mediastream/RealtimeMediaSource.cpp > platform/mediastream/RealtimeMediaSourceCenter.cpp >@@ -2349,10 +2347,8 @@ set(WebCore_SOURCES > platform/mock/MockRealtimeMediaSource.cpp > platform/mock/MockRealtimeMediaSourceCenter.cpp > platform/mock/MockRealtimeVideoSource.cpp >- platform/mock/RTCDTMFSenderHandlerMock.cpp > platform/mock/RTCDataChannelHandlerMock.cpp > platform/mock/RTCNotifiersMock.cpp >- platform/mock/RTCPeerConnectionHandlerMock.cpp > platform/mock/ScrollAnimatorMock.cpp > platform/mock/ScrollbarThemeMock.cpp > >diff --git a/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp b/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp >index b17ff33967a29a78964ec0669411a63d771e15ef..714562036c157e20a740ae772c1008eef06a129f 100644 >--- a/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp >@@ -36,6 +36,7 @@ > #include "EventNames.h" > #include "JSRTCSessionDescription.h" > #include "MediaEndpointSessionConfiguration.h" >+#include "MediaEndpointSessionDescription.h" > #include "MediaStream.h" > #include "MediaStreamEvent.h" > #include "MediaStreamTrack.h" >@@ -57,6 +58,9 @@ namespace WebCore { > using namespace PeerConnection; > using namespace PeerConnectionStates; > >+using MediaDescriptionVector = Vector<PeerMediaDescription>; >+using RtpTransceiverVector = Vector<RefPtr<RTCRtpTransceiver>>; >+ > // We use base64 to generate the random strings so we need a size that avoids padding to get ice-chars. > static const size_t cnameSize = 18; > // Size range from 4 to 256 ice-chars defined in RFC 5245. >@@ -81,7 +85,7 @@ static String randomString(size_t size) > MediaEndpointPeerConnection::MediaEndpointPeerConnection(RTCPeerConnection& peerConnection) > : PeerConnectionBackend(peerConnection) > , m_mediaEndpoint(MediaEndpoint::create(*this)) >- , m_sdpProcessor(std::unique_ptr<SDPProcessor>(new SDPProcessor(m_peerConnection.scriptExecutionContext()))) >+ , m_sdpProcessor(std::make_unique<SDPProcessor>(m_peerConnection.scriptExecutionContext())) > , m_cname(randomString(cnameSize)) > , m_iceUfrag(randomString(iceUfragSize)) > , m_icePassword(randomString(icePasswordSize)) >@@ -594,21 +598,9 @@ RefPtr<RTCSessionDescription> MediaEndpointPeerConnection::pendingRemoteDescript > return createRTCSessionDescription(m_pendingRemoteDescription.get()); > } > >-void MediaEndpointPeerConnection::setConfiguration(RTCConfiguration& configuration) >+void MediaEndpointPeerConnection::setConfiguration(MediaEndpointConfiguration&& configuration) > { >- Vector<MediaEndpointConfiguration::IceServerInfo> iceServers; >- if (configuration.iceServers().size()) { >- iceServers.reserveInitialCapacity(configuration.iceServers().size()); >- for (auto& server : configuration.iceServers()) { >- Vector<URL> urls; >- urls.reserveInitialCapacity(server->urls().size()); >- for (auto& url : server->urls()) >- urls.uncheckedAppend(URL(URL(), url)); >- iceServers.uncheckedAppend(MediaEndpointConfiguration::IceServerInfo { WTFMove(urls), server->credential(), server->username() }); >- } >- } >- >- m_mediaEndpoint->setConfiguration({ WTFMove(iceServers), configuration.iceTransportPolicy(), configuration.bundlePolicy() }); >+ m_mediaEndpoint->setConfiguration(WTFMove(configuration)); > } > > void MediaEndpointPeerConnection::doAddIceCandidate(RTCIceCandidate& rtcCandidate) >diff --git a/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h b/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h >index c546c793f8315c79aa28c6d1178924f9988799da..7a625a89d3465c4611b8efa7da9627af6e6740f9 100644 >--- a/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h >+++ b/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h >@@ -33,51 +33,43 @@ > #if ENABLE(WEB_RTC) > > #include "MediaEndpoint.h" >-#include "MediaEndpointSessionDescription.h" > #include "PeerConnectionBackend.h" >+#include "RTCSessionDescription.h" > #include <wtf/Function.h> >-#include <wtf/RefPtr.h> > > namespace WebCore { > >-class MediaStream; >-class MediaStreamTrack; >+class MediaEndpointSessionDescription; > class SDPProcessor; > >-struct PeerMediaDescription; >- >-using MediaDescriptionVector = Vector<PeerMediaDescription>; >-using RtpSenderVector = Vector<RefPtr<RTCRtpSender>>; >-using RtpTransceiverVector = Vector<RefPtr<RTCRtpTransceiver>>; >- > class MediaEndpointPeerConnection final : public PeerConnectionBackend, public MediaEndpointClient { > public: >- MediaEndpointPeerConnection(RTCPeerConnection&); >+ explicit MediaEndpointPeerConnection(RTCPeerConnection&); > >- RefPtr<RTCSessionDescription> localDescription() const override; >- RefPtr<RTCSessionDescription> currentLocalDescription() const override; >- RefPtr<RTCSessionDescription> pendingLocalDescription() const override; >+private: >+ RefPtr<RTCSessionDescription> localDescription() const final; >+ RefPtr<RTCSessionDescription> currentLocalDescription() const final; >+ RefPtr<RTCSessionDescription> pendingLocalDescription() const final; > >- RefPtr<RTCSessionDescription> remoteDescription() const override; >- RefPtr<RTCSessionDescription> currentRemoteDescription() const override; >- RefPtr<RTCSessionDescription> pendingRemoteDescription() const override; >+ RefPtr<RTCSessionDescription> remoteDescription() const final; >+ RefPtr<RTCSessionDescription> currentRemoteDescription() const final; >+ RefPtr<RTCSessionDescription> pendingRemoteDescription() const final; > >- void setConfiguration(RTCConfiguration&) override; >+ void setConfiguration(MediaEndpointConfiguration&&) final; > >- void getStats(MediaStreamTrack*, PeerConnection::StatsPromise&&) override; >+ void getStats(MediaStreamTrack*, PeerConnection::StatsPromise&&) final; > >- Vector<RefPtr<MediaStream>> getRemoteStreams() const override; >+ Vector<RefPtr<MediaStream>> getRemoteStreams() const final; > >- Ref<RTCRtpReceiver> createReceiver(const String& transceiverMid, const String& trackKind, const String& trackId) override; >- void replaceTrack(RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromise<void>&&) override; >+ Ref<RTCRtpReceiver> createReceiver(const String& transceiverMid, const String& trackKind, const String& trackId) final; >+ void replaceTrack(RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromise<void>&&) final; > >- bool isNegotiationNeeded() const override { return m_negotiationNeeded; }; >- void markAsNeedingNegotiation() override; >- void clearNegotiationNeededState() override { m_negotiationNeeded = false; }; >+ bool isNegotiationNeeded() const final { return m_negotiationNeeded; }; >+ void markAsNeedingNegotiation() final; >+ void clearNegotiationNeededState() final { m_negotiationNeeded = false; }; > >- void emulatePlatformEvent(const String& action) override; >+ void emulatePlatformEvent(const String& action) final; > >-private: > void runTask(Function<void ()>&&); > void startRunningTasks(); > >@@ -106,10 +98,10 @@ private: > RefPtr<RTCSessionDescription> createRTCSessionDescription(MediaEndpointSessionDescription*) const; > > // MediaEndpointClient >- void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) override; >- void gotIceCandidate(const String& mid, IceCandidate&&) override; >- void doneGatheringCandidates(const String& mid) override; >- void iceTransportStateChanged(const String& mid, MediaEndpoint::IceTransportState) override; >+ void gotDtlsFingerprint(const String& fingerprint, const String& fingerprintFunction) final; >+ void gotIceCandidate(const String& mid, IceCandidate&&) final; >+ void doneGatheringCandidates(const String& mid) final; >+ void iceTransportStateChanged(const String& mid, MediaEndpoint::IceTransportState) final; > > std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) final; > >diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >index f7ce1476b4234c1b658f79c68906721ec34f5d7c..e588302908d07881c0111ef44c3d64e94116edb9 100644 >--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h >@@ -34,28 +34,23 @@ > > #include "JSDOMPromise.h" > #include "PeerConnectionStates.h" >-#include "RTCDataChannel.h" > > namespace WebCore { > >-class DOMError; >-class Event; > class MediaStream; > class MediaStreamTrack; > class PeerConnectionBackend; >-class RTCConfiguration; > class RTCDataChannelHandler; > class RTCIceCandidate; > class RTCPeerConnection; > class RTCRtpReceiver; > class RTCRtpSender; >-class RTCRtpSenderClient; >-class RTCRtpTransceiver; > class RTCSessionDescription; > class RTCStatsResponse; >-class ScriptExecutionContext; > >+struct MediaEndpointConfiguration; > struct RTCAnswerOptions; >+struct RTCDataChannelInit; > struct RTCOfferOptions; > > namespace PeerConnection { >@@ -63,8 +58,9 @@ using SessionDescriptionPromise = DOMPromise<IDLInterface<RTCSessionDescription> > using StatsPromise = DOMPromise<IDLInterface<RTCStatsResponse>>; > } > >-typedef std::unique_ptr<PeerConnectionBackend> (*CreatePeerConnectionBackend)(RTCPeerConnection&); >+using CreatePeerConnectionBackend = std::unique_ptr<PeerConnectionBackend> (*)(RTCPeerConnection&); > >+// FIXME: What is the value of this abstract class? There is only one concrete class derived from it. > class PeerConnectionBackend { > public: > WEBCORE_EXPORT static CreatePeerConnectionBackend create; >@@ -90,7 +86,7 @@ public: > virtual RefPtr<RTCSessionDescription> currentRemoteDescription() const = 0; > virtual RefPtr<RTCSessionDescription> pendingRemoteDescription() const = 0; > >- virtual void setConfiguration(RTCConfiguration&) = 0; >+ virtual void setConfiguration(MediaEndpointConfiguration&&) = 0; > > virtual void getStats(MediaStreamTrack*, PeerConnection::StatsPromise&&) = 0; > >diff --git a/Source/WebCore/Modules/mediastream/RTCConfiguration.cpp b/Source/WebCore/Modules/mediastream/RTCConfiguration.cpp >deleted file mode 100644 >index 3a91c172c27068f5bd096b29da9e6cfac940992c..0000000000000000000000000000000000000000 >--- a/Source/WebCore/Modules/mediastream/RTCConfiguration.cpp >+++ /dev/null >@@ -1,158 +0,0 @@ >-/* >- * Copyright (C) 2012 Google Inc. All rights reserved. >- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >- * Copyright (C) 2015 Ericsson AB. 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. >- * 3. Neither the name of Ericsson nor the names of its contributors >- * may be used to endorse or promote products derived from this >- * software without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >- * OWNER OR 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. >- */ >- >-#include "config.h" >-#include "RTCConfiguration.h" >- >-#if ENABLE(WEB_RTC) >- >-#include "ArrayValue.h" >-#include "Dictionary.h" >-#include "ExceptionCode.h" >-#include "URL.h" >- >-namespace WebCore { >- >-static bool validateIceServerURL(const String& iceURL) >-{ >- URL url(URL(), iceURL); >- if (url.isEmpty() || !url.isValid() || !(url.protocolIs("turn") || url.protocolIs("turns") || url.protocolIs("stun"))) >- return false; >- >- return true; >-} >- >-static ExceptionOr<Ref<RTCIceServer>> parseIceServer(const Dictionary& iceServer) >-{ >- String credential, username; >- iceServer.get("credential", credential); >- iceServer.get("username", username); >- >- // Spec says that "urls" can be either a string or a sequence, so we must check for both. >- Vector<String> urlsList; >- String urlString; >- iceServer.get("urls", urlString); >- // This is the only way to check if "urls" is a sequence or a string. If we try to convert >- // to a sequence and it fails (in case it is a string), an exception will be set and the >- // RTCPeerConnection will fail. >- // So we convert to a string always, which converts a sequence to a string in the format: "foo, bar, ..", >- // then checking for a comma in the string assures that a string was a sequence and then we convert >- // it to a sequence safely. >- if (urlString.isEmpty()) >- return Exception { INVALID_ACCESS_ERR }; >- >- if (urlString.find(',') != notFound && iceServer.get("urls", urlsList) && urlsList.size()) { >- for (auto iter = urlsList.begin(); iter != urlsList.end(); ++iter) { >- if (!validateIceServerURL(*iter)) >- return Exception { INVALID_ACCESS_ERR }; >- } >- } else { >- if (!validateIceServerURL(urlString)) >- return Exception { INVALID_ACCESS_ERR }; >- urlsList.append(urlString); >- } >- >- return RTCIceServer::create(urlsList, credential, username); >-} >- >-ExceptionOr<RefPtr<RTCConfiguration>> RTCConfiguration::create(const Dictionary& configuration) >-{ >- if (configuration.isUndefinedOrNull()) >- return nullptr; >- >- auto result = adoptRef(*new RTCConfiguration); >- auto initializeResult = result->initialize(configuration); >- if (initializeResult.hasException()) >- return initializeResult.releaseException(); >- >- return RefPtr<RTCConfiguration> { WTFMove(result) }; >-} >- >-RTCConfiguration::RTCConfiguration() >-{ >-} >- >-ExceptionOr<void> RTCConfiguration::initialize(const Dictionary& configuration) >-{ >- ArrayValue iceServers; >- bool ok = configuration.get("iceServers", iceServers); >- if (!ok || iceServers.isUndefinedOrNull()) >- return Exception { TYPE_MISMATCH_ERR }; >- >- size_t numberOfServers; >- ok = iceServers.length(numberOfServers); >- if (!ok) >- return Exception { TYPE_MISMATCH_ERR }; >- if (!numberOfServers) >- return Exception { INVALID_ACCESS_ERR }; >- >- for (size_t i = 0; i < numberOfServers; ++i) { >- Dictionary iceServerDict; >- ok = iceServers.get(i, iceServerDict); >- if (!ok) >- return Exception { TYPE_MISMATCH_ERR }; >- >- auto server = parseIceServer(iceServerDict); >- if (server.hasException()) >- return server.releaseException(); >- >- m_iceServers.append(server.releaseReturnValue()); >- } >- >- String iceTransportPolicy; >- if (configuration.get("iceTransportPolicy", iceTransportPolicy)) { >- if (iceTransportPolicy == "relay") >- m_iceTransportPolicy = IceTransportPolicy::Relay; >- else if (iceTransportPolicy == "all") >- m_iceTransportPolicy = IceTransportPolicy::All; >- else >- return Exception { TypeError }; >- } >- >- String bundlePolicy; >- if (configuration.get("bundlePolicy", bundlePolicy)) { >- if (bundlePolicy == "balanced") >- m_bundlePolicy = BundlePolicy::Balanced; >- else if (bundlePolicy == "max-compat") >- m_bundlePolicy = BundlePolicy::MaxCompat; >- else if (bundlePolicy == "max-bundle") >- m_bundlePolicy = BundlePolicy::MaxBundle; >- else >- return Exception { TypeError }; >- } >- >- return { }; >-} >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >diff --git a/Source/WebCore/Modules/mediastream/RTCConfiguration.h b/Source/WebCore/Modules/mediastream/RTCConfiguration.h >index 2dcfc5f7a4b4192327652f7feaca94016fa9f6dd..2f06ea25a70aca5e7ade5370767894920a79dee0 100644 >--- a/Source/WebCore/Modules/mediastream/RTCConfiguration.h >+++ b/Source/WebCore/Modules/mediastream/RTCConfiguration.h >@@ -32,36 +32,21 @@ > > #if ENABLE(WEB_RTC) > >-#include "ExceptionOr.h" > #include "PeerConnectionStates.h" > #include "RTCIceServer.h" >-#include <wtf/Vector.h> > > namespace WebCore { > >-class Dictionary; >+using RTCIceTransportPolicy = PeerConnectionStates::IceTransportPolicy; >+using RTCBundlePolicy = PeerConnectionStates::BundlePolicy; > >-// FIXME: Why reference count this? >-class RTCConfiguration : public RefCounted<RTCConfiguration> { >-public: >- static ExceptionOr<RefPtr<RTCConfiguration>> create(const Dictionary& configuration); >+struct RTCConfiguration { >+ using IceTransportPolicy = RTCIceTransportPolicy; >+ using BundlePolicy = RTCBundlePolicy; > >- using IceTransportPolicy = PeerConnectionStates::IceTransportPolicy; >- IceTransportPolicy iceTransportPolicy() const { return m_iceTransportPolicy; } >- >- using BundlePolicy = PeerConnectionStates::BundlePolicy; >- BundlePolicy bundlePolicy() const { return m_bundlePolicy; } >- >- Vector<RefPtr<RTCIceServer>> iceServers() const { return m_iceServers; } >- >-private: >- RTCConfiguration(); >- >- ExceptionOr<void> initialize(const Dictionary& configuration); >- >- Vector<RefPtr<RTCIceServer>> m_iceServers; >- IceTransportPolicy m_iceTransportPolicy { IceTransportPolicy::All }; >- BundlePolicy m_bundlePolicy { BundlePolicy::Balanced }; >+ std::optional<Vector<RTCIceServer>> iceServers; >+ IceTransportPolicy iceTransportPolicy; >+ BundlePolicy bundlePolicy; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/mediastream/RTCConfiguration.idl b/Source/WebCore/Modules/mediastream/RTCConfiguration.idl >index 234a22587bd650f7f2d0786d9ee7b66a58a21fb6..3d2664dbc1e3f186433e061bd44cf51cbfdcdd6e 100644 >--- a/Source/WebCore/Modules/mediastream/RTCConfiguration.idl >+++ b/Source/WebCore/Modules/mediastream/RTCConfiguration.idl >@@ -28,10 +28,9 @@ enum RTCBundlePolicy { "balanced", "max-compat", "max-bundle" }; > > [ > Conditional=WEB_RTC, >- ImplementationLacksVTable, >- NoInterfaceObject, >-] interface RTCConfiguration { >- readonly attribute sequence<RTCIceServer> iceServers; >- readonly attribute RTCIceTransportPolicy iceTransportPolicy; >- readonly attribute RTCBundlePolicy bundlePolicy; >+ JSGenerateToJSObject, >+] dictionary RTCConfiguration { >+ sequence<RTCIceServer> iceServers; >+ RTCIceTransportPolicy iceTransportPolicy = "all"; >+ RTCBundlePolicy bundlePolicy = "balanced"; > }; >diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >index 5dd2f1e41cf512296d74d20c1bd7c48bb2b22d79..08eae7b7092cfa98c45c0a234c0fcf8f3edae8ba 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >@@ -24,15 +24,13 @@ > */ > > #include "config.h" >+#include "RTCDTMFSender.h" > > #if ENABLE(WEB_RTC) > >-#include "RTCDTMFSender.h" >- > #include "MediaStreamTrack.h" > #include "RTCDTMFSenderHandler.h" > #include "RTCDTMFToneChangeEvent.h" >-#include "RTCPeerConnectionHandler.h" > #include "ScriptExecutionContext.h" > > namespace WebCore { >@@ -43,27 +41,14 @@ static const long maxToneDurationMs = 6000; > static const long minInterToneGapMs = 30; > static const long defaultInterToneGapMs = 70; > >-ExceptionOr<Ref<RTCDTMFSender>> RTCDTMFSender::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, RefPtr<MediaStreamTrack>&& track) >-{ >- auto handler = peerConnectionHandler->createDTMFSender(&track->source()); >- if (!handler) >- return Exception { NOT_SUPPORTED_ERR }; >- >- auto sender = adoptRef(*new RTCDTMFSender(*context, WTFMove(track), WTFMove(handler))); >- sender->suspendIfNeeded(); >- return WTFMove(sender); >-} >- >-RTCDTMFSender::RTCDTMFSender(ScriptExecutionContext& context, RefPtr<MediaStreamTrack>&& track, std::unique_ptr<RTCDTMFSenderHandler> handler) >+RTCDTMFSender::RTCDTMFSender(ScriptExecutionContext& context, RefPtr<MediaStreamTrack>&& track) > : ActiveDOMObject(&context) > , m_track(WTFMove(track)) > , m_duration(defaultToneDurationMs) > , m_interToneGap(defaultInterToneGapMs) >- , m_handler(WTFMove(handler)) > , m_stopped(false) > , m_scheduledEventTimer(*this, &RTCDTMFSender::scheduledEventTimerFired) > { >- m_handler->setClient(this); > } > > RTCDTMFSender::~RTCDTMFSender() >@@ -72,7 +57,7 @@ RTCDTMFSender::~RTCDTMFSender() > > bool RTCDTMFSender::canInsertDTMF() const > { >- return m_handler->canInsertDTMF(); >+ return false; > } > > MediaStreamTrack* RTCDTMFSender::track() const >@@ -82,10 +67,10 @@ MediaStreamTrack* RTCDTMFSender::track() const > > String RTCDTMFSender::toneBuffer() const > { >- return m_handler->currentToneBuffer(); >+ return { }; > } > >-ExceptionOr<void> RTCDTMFSender::insertDTMF(const String& tones, std::optional<int> duration, std::optional<int> interToneGap) >+ExceptionOr<void> RTCDTMFSender::insertDTMF(const String&, std::optional<int> duration, std::optional<int> interToneGap) > { > if (!canInsertDTMF()) > return Exception { NOT_SUPPORTED_ERR }; >@@ -99,10 +84,7 @@ ExceptionOr<void> RTCDTMFSender::insertDTMF(const String& tones, std::optional<i > m_duration = duration.value_or(defaultToneDurationMs); > m_interToneGap = interToneGap.value_or(defaultInterToneGapMs); > >- if (!m_handler->insertDTMF(tones, m_duration, m_interToneGap)) >- return Exception { SYNTAX_ERR }; >- >- return { }; >+ return Exception { SYNTAX_ERR }; > } > > void RTCDTMFSender::didPlayTone(const String& tone) >@@ -113,7 +95,6 @@ void RTCDTMFSender::didPlayTone(const String& tone) > void RTCDTMFSender::stop() > { > m_stopped = true; >- m_handler->setClient(nullptr); > } > > const char* RTCDTMFSender::activeDOMObjectName() const >diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >index c722871910f96f86b207ab3a81d51cc308ac788f..c67b3a164d349baf56d668faf0bbee1279bfed12 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >@@ -30,26 +30,22 @@ > #include "ActiveDOMObject.h" > #include "EventTarget.h" > #include "ExceptionOr.h" >-#include "RTCDTMFSenderHandlerClient.h" > #include "ScriptWrappable.h" > #include "Timer.h" > > namespace WebCore { > > class MediaStreamTrack; >-class RTCPeerConnectionHandler; >-class RTCDTMFSenderHandler; > >-class RTCDTMFSender final : public RefCounted<RTCDTMFSender>, public EventTargetWithInlineData, private RTCDTMFSenderHandlerClient, public ActiveDOMObject { >+class RTCDTMFSender final : public RefCounted<RTCDTMFSender>, public EventTargetWithInlineData, public ActiveDOMObject { > public: >- static ExceptionOr<Ref<RTCDTMFSender>> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, RefPtr<MediaStreamTrack>&&); > virtual ~RTCDTMFSender(); > > bool canInsertDTMF() const; > MediaStreamTrack* track() const; > String toneBuffer() const; >- long duration() const { return m_duration; } >- long interToneGap() const { return m_interToneGap; } >+ int duration() const { return m_duration; } >+ int interToneGap() const { return m_interToneGap; } > > ExceptionOr<void> insertDTMF(const String& tones, std::optional<int> duration, std::optional<int> interToneGap); > >@@ -57,7 +53,7 @@ public: > using RefCounted::deref; > > private: >- RTCDTMFSender(ScriptExecutionContext&, RefPtr<MediaStreamTrack>&&, std::unique_ptr<RTCDTMFSenderHandler>); >+ RTCDTMFSender(ScriptExecutionContext&, RefPtr<MediaStreamTrack>&&); > > void stop() final; > const char* activeDOMObjectName() const final; >@@ -69,16 +65,14 @@ private: > void refEventTarget() final { ref(); } > void derefEventTarget() final { deref(); } > >- void didPlayTone(const String&) final; >+ void didPlayTone(const String&); > > void scheduleDispatchEvent(Ref<Event>&&); > void scheduledEventTimerFired(); > > RefPtr<MediaStreamTrack> m_track; >- long m_duration; >- long m_interToneGap; >- >- std::unique_ptr<RTCDTMFSenderHandler> m_handler; >+ int m_duration; >+ int m_interToneGap; > > bool m_stopped; > >diff --git a/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp b/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp >index 6eeb003acfa9f644dabd9c33b073c97cfea31516..edd679331e052fad6c619e1d2b39948e65e48ad8 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp >@@ -23,17 +23,16 @@ > */ > > #include "config.h" >+#include "RTCDataChannel.h" > > #if ENABLE(WEB_RTC) > >-#include "RTCDataChannel.h" >- > #include "Blob.h" > #include "Event.h" > #include "EventNames.h" >+#include "ExceptionCode.h" > #include "MessageEvent.h" > #include "RTCDataChannelHandler.h" >-#include "RTCPeerConnectionHandler.h" > #include "ScriptExecutionContext.h" > #include <runtime/ArrayBuffer.h> > #include <runtime/ArrayBufferView.h> >diff --git a/Source/WebCore/Modules/mediastream/RTCDataChannel.h b/Source/WebCore/Modules/mediastream/RTCDataChannel.h >index b6855707c43868985d78b70e1f1d986fb72da2bf..284ec9ad91e17fdd9b8cbb8e04c63c014e3afd7e 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDataChannel.h >+++ b/Source/WebCore/Modules/mediastream/RTCDataChannel.h >@@ -42,7 +42,6 @@ namespace JSC { > namespace WebCore { > > class Blob; >-class Dictionary; > class RTCPeerConnectionHandler; > > class RTCDataChannel final : public RefCounted<RTCDataChannel>, public EventTargetWithInlineData, public RTCDataChannelHandlerClient { >diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp b/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp >index 85ee7c124ae1a2ce111dfe553441f374720d6f0b..9b7a8fbf316a05736ab990930fd126d540d2bb0c 100644 >--- a/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp >@@ -35,47 +35,23 @@ > > #if ENABLE(WEB_RTC) > >-#include "Dictionary.h" >-#include "ExceptionCode.h" >- > namespace WebCore { > >-ExceptionOr<Ref<RTCIceCandidate>> RTCIceCandidate::create(const Dictionary& dictionary) >+inline RTCIceCandidate::RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex) >+ : m_candidate(candidate) >+ , m_sdpMid(sdpMid) >+ , m_sdpMLineIndex(sdpMLineIndex) > { >- String candidate; >- if (!dictionary.get("candidate", candidate)) >- return Exception { TypeError }; >- >- String sdpMid; >- dictionary.getWithUndefinedOrNullCheck("sdpMid", sdpMid); >- >- std::optional<unsigned short> sdpMLineIndex; >- String sdpMLineIndexString; >- >- if (dictionary.getWithUndefinedOrNullCheck("sdpMLineIndex", sdpMLineIndexString)) { >- bool intConversionOk; >- unsigned result = sdpMLineIndexString.toUIntStrict(&intConversionOk); >- if (!intConversionOk || result > USHRT_MAX) >- return Exception { TypeError }; >- sdpMLineIndex = result; >- } >- >- if (sdpMid.isNull() && !sdpMLineIndex) >- return Exception { TypeError }; >- >- return adoptRef(*new RTCIceCandidate(candidate, sdpMid, sdpMLineIndex)); > } > >-Ref<RTCIceCandidate> RTCIceCandidate::create(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex) >+Ref<RTCIceCandidate> RTCIceCandidate::create(const Init& dictionary) > { >- return adoptRef(*new RTCIceCandidate(candidate, sdpMid, sdpMLineIndex)); >+ return create(dictionary.candidate, dictionary.sdpMid, dictionary.sdpMLineIndex); > } > >-RTCIceCandidate::RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex) >- : m_candidate(candidate) >- , m_sdpMid(sdpMid) >- , m_sdpMLineIndex(sdpMLineIndex) >+Ref<RTCIceCandidate> RTCIceCandidate::create(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex) > { >+ return adoptRef(*new RTCIceCandidate(candidate, sdpMid, sdpMLineIndex)); > } > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h >index 9a870ff1d7e152f24d2d1a30d2769c405d70a293..063b9d12194bfa0381fdf016ad5538db6d56133c 100644 >--- a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h >+++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h >@@ -32,18 +32,21 @@ > > #if ENABLE(WEB_RTC) > >-#include "ExceptionOr.h" > #include "ScriptWrappable.h" > #include <wtf/Optional.h> >+#include <wtf/text/WTFString.h> > > namespace WebCore { > >-class Dictionary; >-class RTCIceCandidateDescriptor; >- > class RTCIceCandidate : public RefCounted<RTCIceCandidate>, public ScriptWrappable { > public: >- static ExceptionOr<Ref<RTCIceCandidate>> create(const Dictionary&); >+ struct Init { >+ String candidate; >+ String sdpMid; >+ std::optional<unsigned short> sdpMLineIndex; >+ }; >+ >+ static Ref<RTCIceCandidate> create(const Init&); > static Ref<RTCIceCandidate> create(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex); > > const String& candidate() const { return m_candidate; } >@@ -51,7 +54,7 @@ public: > std::optional<unsigned short> sdpMLineIndex() const { return m_sdpMLineIndex; } > > private: >- explicit RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex); >+ RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex); > > String m_candidate; > String m_sdpMid; >diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl b/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl >index ef182a5fc922b655c532f01fd38011182558c374..c1bf1318159f89e8d5f88948f82c7055a59d6936 100644 >--- a/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl >+++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.idl >@@ -31,8 +31,7 @@ > > [ > Conditional=WEB_RTC, >- Constructor(Dictionary dictionary), >- ConstructorMayThrowException, >+ Constructor(RTCIceCandidateInit candidateInitDict), > EnabledAtRuntime=peerConnection, > ImplementationLacksVTable, > PrivateIdentifier, >@@ -44,3 +43,9 @@ > > serializer = {candidate, sdpMid, sdpMLineIndex}; > }; >+ >+dictionary RTCIceCandidateInit { >+ required DOMString candidate; >+ DOMString? sdpMid = null; >+ unsigned short? sdpMLineIndex = null; >+}; >diff --git a/Source/WebCore/Modules/mediastream/RTCIceServer.h b/Source/WebCore/Modules/mediastream/RTCIceServer.h >index 2a3c453862315119686dcaec52a331d774034773..b0b1798ea7f7a9bac831ad3376254b59d737762f 100644 >--- a/Source/WebCore/Modules/mediastream/RTCIceServer.h >+++ b/Source/WebCore/Modules/mediastream/RTCIceServer.h >@@ -27,34 +27,16 @@ > > #if ENABLE(WEB_RTC) > >-#include <wtf/RefCounted.h> >+#include <wtf/Variant.h> > #include <wtf/Vector.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { > >-class RTCIceServer : public RefCounted<RTCIceServer> { >-public: >- static Ref<RTCIceServer> create(const Vector<String>& urls, const String& credential, const String& username) >- { >- return adoptRef(*new RTCIceServer(urls, credential, username)); >- } >- virtual ~RTCIceServer() { } >- >- const Vector<String>& urls() const { return m_urls; } >- const String& credential() const { return m_credential; } >- const String& username() const { return m_username; } >- >-private: >- RTCIceServer(const Vector<String>& urls, const String& credential, const String& username) >- : m_urls(urls) >- , m_credential(credential) >- , m_username(username) >- { } >- >- Vector<String> m_urls; >- String m_credential; >- String m_username; >+struct RTCIceServer { >+ Variant<String, Vector<String>> urls; >+ String credential; >+ String username; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/mediastream/RTCIceServer.idl b/Source/WebCore/Modules/mediastream/RTCIceServer.idl >index 532e7b9d7acbeb375c28b7267d997bd38b74f2fc..b2529c664c6b6db997ceb1dc56e417535e773919 100644 >--- a/Source/WebCore/Modules/mediastream/RTCIceServer.idl >+++ b/Source/WebCore/Modules/mediastream/RTCIceServer.idl >@@ -25,10 +25,9 @@ > > [ > Conditional=WEB_RTC, >- NoInterfaceObject, >-] interface RTCIceServer { >- readonly attribute sequence<DOMString> urls; >- readonly attribute DOMString username; >- readonly attribute DOMString credential; >+ JSGenerateToJSObject, >+] dictionary RTCIceServer { >+ required (DOMString or sequence<DOMString>) urls; >+ DOMString username; >+ DOMString credential; > }; >- >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >index 048d7980c437c4901751d608f629e5c18a342543..df110fe12a452cabdbcd9b98cf20f2aaf0ef1705 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >@@ -35,11 +35,11 @@ > > #if ENABLE(WEB_RTC) > >-#include "Dictionary.h" > #include "Document.h" > #include "Event.h" > #include "EventNames.h" > #include "Frame.h" >+#include "MediaEndpointConfiguration.h" > #include "MediaStream.h" > #include "MediaStreamTrack.h" > #include "RTCConfiguration.h" >@@ -77,7 +77,7 @@ RTCPeerConnection::~RTCPeerConnection() > stop(); > } > >-ExceptionOr<void> RTCPeerConnection::initializeWith(Document& document, const Dictionary& rtcConfiguration) >+ExceptionOr<void> RTCPeerConnection::initializeWith(Document& document, RTCConfiguration&& configuration) > { > if (!document.frame()) > return Exception { NOT_SUPPORTED_ERR }; >@@ -85,7 +85,7 @@ ExceptionOr<void> RTCPeerConnection::initializeWith(Document& document, const Di > if (!m_backend) > return Exception { NOT_SUPPORTED_ERR }; > >- return setConfiguration(rtcConfiguration); >+ return setConfiguration(WTFMove(configuration)); > } > > ExceptionOr<Ref<RTCRtpSender>> RTCPeerConnection::addTrack(Ref<MediaStreamTrack>&& track, const Vector<std::reference_wrapper<MediaStream>>& streams) >@@ -348,25 +348,37 @@ String RTCPeerConnection::iceConnectionState() const > return String(); > } > >-RTCConfiguration* RTCPeerConnection::getConfiguration() const >+ExceptionOr<void> RTCPeerConnection::setConfiguration(RTCConfiguration&& configuration) > { >- return m_configuration.get(); >-} >- >-ExceptionOr<void> RTCPeerConnection::setConfiguration(const Dictionary& configuration) >-{ >- if (configuration.isUndefinedOrNull()) >- return Exception { TypeError }; >- > if (m_signalingState == SignalingState::Closed) > return Exception { INVALID_STATE_ERR }; > >- auto newConfiguration = RTCConfiguration::create(configuration); >- if (newConfiguration.hasException()) >- return newConfiguration.releaseException(); >+ Vector<MediaEndpointConfiguration::IceServerInfo> servers; >+ if (configuration.iceServers) { >+ servers.reserveInitialCapacity(configuration.iceServers->size()); >+ for (auto& server : configuration.iceServers.value()) { >+ Vector<URL> serverURLs; >+ WTF::switchOn(server.urls, >+ [&serverURLs] (const String& string) { >+ serverURLs.reserveInitialCapacity(1); >+ serverURLs.uncheckedAppend(URL { URL { }, string }); >+ }, >+ [&serverURLs] (const Vector<String>& vector) { >+ serverURLs.reserveInitialCapacity(vector.size()); >+ for (auto& string : vector) >+ serverURLs.uncheckedAppend(URL { URL { }, string }); >+ } >+ ); >+ for (auto& serverURL : serverURLs) { >+ if (!(serverURL.protocolIs("turn") || serverURL.protocolIs("turns") || serverURL.protocolIs("stun"))) >+ return Exception { INVALID_ACCESS_ERR }; >+ } >+ servers.uncheckedAppend({ WTFMove(serverURLs), server.credential, server.username }); >+ } >+ } > >- m_configuration = newConfiguration.releaseReturnValue(); >- m_backend->setConfiguration(*m_configuration); >+ m_backend->setConfiguration({ WTFMove(servers), configuration.iceTransportPolicy, configuration.bundlePolicy }); >+ m_configuration = WTFMove(configuration); > return { }; > } > >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >index 93fb8ab25c80e866d66cd955b784e505b3a5b208..ddcc9ca1f52f7af6122e62725bd6653f27582a95 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >@@ -37,19 +37,15 @@ > #include "ActiveDOMObject.h" > #include "EventTarget.h" > #include "MediaStream.h" >+#include "RTCConfiguration.h" > #include "RTCDataChannel.h" > #include "RTCOfferAnswerOptions.h" > #include "RTCRtpTransceiver.h" >-#include "ScriptWrappable.h" >-#include <wtf/HashMap.h> >-#include <wtf/RefCounted.h> > > namespace WebCore { > >-class Dictionary; > class MediaStreamTrack; > class PeerConnectionBackend; >-class RTCConfiguration; > class RTCIceCandidate; > class RTCPeerConnectionErrorCallback; > class RTCSessionDescription; >@@ -58,14 +54,14 @@ class RTCStatsCallback; > class RTCPeerConnection final : public RefCounted<RTCPeerConnection>, public RTCRtpSenderClient, public EventTargetWithInlineData, public ActiveDOMObject { > public: > static Ref<RTCPeerConnection> create(ScriptExecutionContext&); >- ~RTCPeerConnection(); >+ virtual ~RTCPeerConnection(); > > using AnswerOptions = RTCAnswerOptions; > using DataChannelInit = RTCDataChannelInit; > using OfferAnswerOptions = RTCOfferAnswerOptions; > using OfferOptions = RTCOfferOptions; > >- ExceptionOr<void> initializeWith(Document&, const Dictionary&); >+ ExceptionOr<void> initializeWith(Document&, RTCConfiguration&&); > > const Vector<std::reference_wrapper<RTCRtpSender>>& getSenders() const { return m_transceiverSet->senders(); } > const Vector<std::reference_wrapper<RTCRtpReceiver>>& getReceivers() const { return m_transceiverSet->receivers(); } >@@ -107,8 +103,8 @@ public: > String iceGatheringState() const; > String iceConnectionState() const; > >- RTCConfiguration* getConfiguration() const; >- ExceptionOr<void> setConfiguration(const Dictionary&); >+ const RTCConfiguration& getConfiguration() const { return m_configuration; } >+ ExceptionOr<void> setConfiguration(RTCConfiguration&&); > > void privateGetStats(MediaStreamTrack*, PeerConnection::StatsPromise&&); > >@@ -120,8 +116,8 @@ public: > EventTargetInterface eventTargetInterface() const final { return RTCPeerConnectionEventTargetInterfaceType; } > ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); } > >- using RefCounted<RTCPeerConnection>::ref; >- using RefCounted<RTCPeerConnection>::deref; >+ using RefCounted::ref; >+ using RefCounted::deref; > > // Used for testing with a mock > WEBCORE_EXPORT void emulatePlatformEvent(const String& action); >@@ -167,7 +163,7 @@ private: > > std::unique_ptr<PeerConnectionBackend> m_backend; > >- RefPtr<RTCConfiguration> m_configuration; >+ RTCConfiguration m_configuration; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl b/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl >index 8dc35918cee8d6fd4fdd9088e416778788cc7075..940be12f58ee173d44ebe0dc087f0b5a2514f9de 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl >@@ -59,7 +59,7 @@ dictionary RTCDataChannelInit { > JSBuiltinConstructor, > ] interface RTCPeerConnection : EventTarget { > // Private initializer >- [PrivateIdentifier, CallWith=Document, MayThrowException] void initializeWith(Dictionary parameters); >+ [PrivateIdentifier, CallWith=Document, MayThrowException] void initializeWith(RTCConfiguration configuration); > > // RTP Media API extensions > [PrivateIdentifier, PublicIdentifier] sequence<RTCRtpSender> getSenders(); >@@ -119,7 +119,7 @@ dictionary RTCDataChannelInit { > readonly attribute DOMString iceConnectionState; > > RTCConfiguration getConfiguration(); >- [MayThrowException] void setConfiguration(Dictionary configuration); >+ [MayThrowException] void setConfiguration(RTCConfiguration configuration); > > [JSBuiltin] Promise<RTCStatsReport> getStats(optional MediaStreamTrack? selector = null); > // Legacy signature: Promise<void> getStats(MediaStreamTrack? selector >diff --git a/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp b/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp >index 07f2d8e5d52c090a0db7552ae4aed139c3b5f755..4dab0632b90c75ae6ea8f947430d0d62fe1fb132 100644 >--- a/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp >@@ -34,42 +34,17 @@ > > #if ENABLE(WEB_RTC) > >-#include "Dictionary.h" >-#include "ExceptionCode.h" >- > namespace WebCore { > >-static bool parseTypeString(const String& string, RTCSessionDescription::SdpType& outType) >+inline RTCSessionDescription::RTCSessionDescription(SdpType type, const String& sdp) >+ : m_type(type) >+ , m_sdp(sdp) > { >- if (string == "offer") >- outType = RTCSessionDescription::SdpType::Offer; >- else if (string == "pranswer") >- outType = RTCSessionDescription::SdpType::Pranswer; >- else if (string == "answer") >- outType = RTCSessionDescription::SdpType::Answer; >- else if (string == "rollback") >- outType = RTCSessionDescription::SdpType::Rollback; >- else >- return false; >- >- return true; > } > >-ExceptionOr<Ref<RTCSessionDescription>> RTCSessionDescription::create(const Dictionary& dictionary) >+Ref<RTCSessionDescription> RTCSessionDescription::create(const Init& dictionary) > { >- String typeString; >- // Dictionary member type is required. >- if (!dictionary.get("type", typeString)) >- return Exception { TypeError }; >- >- SdpType type; >- if (!parseTypeString(typeString, type)) >- return Exception { TypeError }; >- >- String sdp; >- dictionary.get("sdp", sdp); >- >- return adoptRef(*new RTCSessionDescription(type, sdp)); >+ return create(dictionary.type, dictionary.sdp); > } > > Ref<RTCSessionDescription> RTCSessionDescription::create(SdpType type, const String& sdp) >@@ -77,12 +52,6 @@ Ref<RTCSessionDescription> RTCSessionDescription::create(SdpType type, const Str > return adoptRef(*new RTCSessionDescription(type, sdp)); > } > >-RTCSessionDescription::RTCSessionDescription(SdpType type, const String& sdp) >- : m_type(type) >- , m_sdp(sdp) >-{ >-} >- > } // namespace WebCore > > #endif // ENABLE(WEB_RTC) >diff --git a/Source/WebCore/Modules/mediastream/RTCSessionDescription.h b/Source/WebCore/Modules/mediastream/RTCSessionDescription.h >index aabec84f80fd8714f7cf40da2915876697183141..df3fc6b7a8945e2b87df59eac9f298909e1ae082 100644 >--- a/Source/WebCore/Modules/mediastream/RTCSessionDescription.h >+++ b/Source/WebCore/Modules/mediastream/RTCSessionDescription.h >@@ -37,18 +37,15 @@ > > namespace WebCore { > >-class Dictionary; >- > class RTCSessionDescription : public RefCounted<RTCSessionDescription>, public ScriptWrappable { > public: >- enum class SdpType { >- Offer, >- Pranswer, >- Answer, >- Rollback >- }; >+ enum class SdpType { Offer, Pranswer, Answer, Rollback }; > >- static ExceptionOr<Ref<RTCSessionDescription>> create(const Dictionary&); >+ struct Init { >+ SdpType type; >+ String sdp; >+ }; >+ static Ref<RTCSessionDescription> create(const Init&); > static Ref<RTCSessionDescription> create(SdpType, const String& sdp); > > SdpType type() const { return m_type; } >diff --git a/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl b/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl >index d4da695badc4b3646664e36cbbc00c17336ed47a..a6a68d324436c8024468b7e1fdd956213a208b89 100644 >--- a/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl >+++ b/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl >@@ -31,8 +31,7 @@ > > [ > Conditional=WEB_RTC, >- Constructor(Dictionary dictionary), >- ConstructorMayThrowException, >+ Constructor(RTCSessionDescriptionInit descriptionInitDict), > EnabledAtRuntime=peerConnection, > ImplementationLacksVTable, > PrivateIdentifier, >@@ -44,9 +43,9 @@ > serializer = {type, sdp}; > }; > >-enum RTCSdpType { >- "offer", >- "pranswer", >- "answer", >- "rollback" >+enum RTCSdpType { "offer", "pranswer", "answer", "rollback" }; >+ >+dictionary RTCSessionDescriptionInit { >+ required RTCSdpType type; >+ DOMString sdp = ""; > }; >diff --git a/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp b/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp >index 808db3867826aa2c59e6473bc18b20721d19a91b..1b9072ae2273683fd40b11ce9218fd7727d9ae53 100644 >--- a/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp >+++ b/Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp >@@ -23,16 +23,14 @@ > */ > > #include "config.h" >+#include "MediaStreamAudioDestinationNode.h" > > #if ENABLE(WEB_AUDIO) && ENABLE(MEDIA_STREAM) > >-#include "MediaStreamAudioDestinationNode.h" >- > #include "AudioContext.h" > #include "AudioNodeInput.h" > #include "MediaStream.h" > #include "MediaStreamAudioSource.h" >-#include "RTCPeerConnectionHandler.h" > #include <wtf/Locker.h> > > namespace WebCore { >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index a581b0bd43785e085d86928ff3caaa40184c4f72..9495f6d045213e5d1acaf3b3424486655412879f 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -138,12 +138,8 @@ > 073794E619EE2FF200E5A045 /* JSRTCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794E419EE2FF200E5A045 /* JSRTCConfiguration.h */; }; > 073794EB19EE341E00E5A045 /* JSRTCIceServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794E919EE341E00E5A045 /* JSRTCIceServer.cpp */; }; > 073794EC19EE341E00E5A045 /* JSRTCIceServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794EA19EE341E00E5A045 /* JSRTCIceServer.h */; }; >- 073794F119EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794EF19EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.cpp */; }; >- 073794F219EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794F019EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.h */; }; > 073794F919F5864E00E5A045 /* RTCDataChannelHandlerMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794F319F5864E00E5A045 /* RTCDataChannelHandlerMock.cpp */; }; > 073794FA19F5864E00E5A045 /* RTCDataChannelHandlerMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794F419F5864E00E5A045 /* RTCDataChannelHandlerMock.h */; }; >- 073794FB19F5864E00E5A045 /* RTCDTMFSenderHandlerMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794F519F5864E00E5A045 /* RTCDTMFSenderHandlerMock.cpp */; }; >- 073794FC19F5864E00E5A045 /* RTCDTMFSenderHandlerMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794F619F5864E00E5A045 /* RTCDTMFSenderHandlerMock.h */; }; > 073794FD19F5864E00E5A045 /* RTCNotifiersMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073794F719F5864E00E5A045 /* RTCNotifiersMock.cpp */; }; > 073794FE19F5864E00E5A045 /* RTCNotifiersMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 073794F819F5864E00E5A045 /* RTCNotifiersMock.h */; }; > 07394EC81BAB2CCD00BE99CD /* MediaDevicesRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07394EC71BAB2CCD00BE99CD /* MediaDevicesRequest.cpp */; }; >@@ -152,7 +148,6 @@ > 073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE33F17D17E01002BD431 /* JSNavigatorUserMedia.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 073BE34E17D180B2002BD431 /* RTCSessionDescriptionDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */; }; > 073BE34F17D18183002BD431 /* RTCIceCandidateDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA617CF0AD400848E51 /* RTCIceCandidateDescriptor.cpp */; }; >- 073BE35017D181A6002BD431 /* RTCPeerConnectionHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA817CF0AD400848E51 /* RTCPeerConnectionHandler.cpp */; }; > 074E82BA18A69F0E007EF54C /* PlatformTimeRanges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */; }; > 074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */ = {isa = PBXBuildFile; fileRef = 074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0753860014489E9800B78452 /* CachedTextTrack.cpp */; }; >@@ -224,7 +219,6 @@ > 078E093E17D16E1C00420AA1 /* RTCDTMFSenderHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221BA417CF0AD400848E51 /* RTCDTMFSenderHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 078E093F17D16E1C00420AA1 /* RTCDTMFSenderHandlerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221BA517CF0AD400848E51 /* RTCDTMFSenderHandlerClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 078E094017D16E1C00420AA1 /* RTCIceCandidateDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221BA717CF0AD400848E51 /* RTCIceCandidateDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 078E094117D16E1C00420AA1 /* RTCPeerConnectionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221BA917CF0AD400848E51 /* RTCPeerConnectionHandler.h */; }; > 078E094217D16E1C00420AA1 /* RTCPeerConnectionHandlerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221BAA17CF0AD400848E51 /* RTCPeerConnectionHandlerClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 078E094317D16E1C00420AA1 /* RTCSessionDescriptionDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221BAC17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 078E094417D16E1C00420AA1 /* RTCSessionDescriptionRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221BAD17CF0AD400848E51 /* RTCSessionDescriptionRequest.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -270,8 +264,6 @@ > 07AA6B6C166D2C1300D45671 /* InbandTextTrackPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AA6B69166D019500D45671 /* InbandTextTrackPrivateAVFObjC.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 07AB996918DA3C010018771E /* RTCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AB996518DA3C010018771E /* RTCConfiguration.h */; }; > 07AB996B18DA3C010018771E /* RTCIceServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AB996718DA3C010018771E /* RTCIceServer.h */; }; >- 07AB996F18DA3C740018771E /* RTCConfigurationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AB996D18DA3C740018771E /* RTCConfigurationPrivate.h */; }; >- 07AB997018DA3C740018771E /* RTCIceServerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AB996E18DA3C740018771E /* RTCIceServerPrivate.h */; }; > 07ABEF6C1D8A1C5800F21972 /* MediaDevicesEnumerationRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07ABEF6B1D8A1C5800F21972 /* MediaDevicesEnumerationRequest.cpp */; }; > 07ABEF6E1D8A1C7600F21972 /* MediaDevicesEnumerationRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 07ABEF6D1D8A1C7600F21972 /* MediaDevicesEnumerationRequest.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 07AC47011952102100EE9723 /* ISOVTTCue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07AC46FF1952102100EE9723 /* ISOVTTCue.cpp */; }; >@@ -2492,7 +2484,6 @@ > 5E16A2E41BFA650B0029A21E /* MediaEndpointPeerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E16A2E31BFA64FB0029A21E /* MediaEndpointPeerConnection.h */; }; > 5E16A2E51BFA650F0029A21E /* MediaEndpointPeerConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E16A2E21BFA64FB0029A21E /* MediaEndpointPeerConnection.cpp */; }; > 5E2C43511BCEE2F60001E2BC /* PeerConnectionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C434D1BCEE2E50001E2BC /* PeerConnectionBackend.h */; }; >- 5E2C43531BCEE2F60001E2BC /* RTCConfiguration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E2C434F1BCEE2E50001E2BC /* RTCConfiguration.cpp */; }; > 5E2C435F1BCEE31E0001E2BC /* RTCRtpSenderReceiverBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C435D1BCEE30D0001E2BC /* RTCRtpSenderReceiverBase.h */; }; > 5E2C43601BCEE3230001E2BC /* RTCRtpSender.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E2C43591BCEE30D0001E2BC /* RTCRtpSender.cpp */; }; > 5E2C43611BCEE3230001E2BC /* RTCRtpSender.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E2C435A1BCEE30D0001E2BC /* RTCRtpSender.h */; }; >@@ -7114,8 +7105,6 @@ > 07221BA517CF0AD400848E51 /* RTCDTMFSenderHandlerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDTMFSenderHandlerClient.h; sourceTree = "<group>"; }; > 07221BA617CF0AD400848E51 /* RTCIceCandidateDescriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCIceCandidateDescriptor.cpp; sourceTree = "<group>"; }; > 07221BA717CF0AD400848E51 /* RTCIceCandidateDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCIceCandidateDescriptor.h; sourceTree = "<group>"; }; >- 07221BA817CF0AD400848E51 /* RTCPeerConnectionHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCPeerConnectionHandler.cpp; sourceTree = "<group>"; }; >- 07221BA917CF0AD400848E51 /* RTCPeerConnectionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionHandler.h; sourceTree = "<group>"; }; > 07221BAA17CF0AD400848E51 /* RTCPeerConnectionHandlerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionHandlerClient.h; sourceTree = "<group>"; }; > 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCSessionDescriptionDescriptor.cpp; sourceTree = "<group>"; }; > 07221BAC17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCSessionDescriptionDescriptor.h; sourceTree = "<group>"; }; >@@ -7153,12 +7142,8 @@ > 073794EA19EE341E00E5A045 /* JSRTCIceServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCIceServer.h; sourceTree = "<group>"; }; > 073794ED19EE364200E5A045 /* DOMURLMediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMURLMediaStream.cpp; sourceTree = "<group>"; }; > 073794EE19EE364200E5A045 /* DOMURLMediaStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMURLMediaStream.idl; sourceTree = "<group>"; }; >- 073794EF19EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCPeerConnectionHandlerMock.cpp; sourceTree = "<group>"; }; >- 073794F019EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPeerConnectionHandlerMock.h; sourceTree = "<group>"; }; > 073794F319F5864E00E5A045 /* RTCDataChannelHandlerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCDataChannelHandlerMock.cpp; sourceTree = "<group>"; }; > 073794F419F5864E00E5A045 /* RTCDataChannelHandlerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDataChannelHandlerMock.h; sourceTree = "<group>"; }; >- 073794F519F5864E00E5A045 /* RTCDTMFSenderHandlerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCDTMFSenderHandlerMock.cpp; sourceTree = "<group>"; }; >- 073794F619F5864E00E5A045 /* RTCDTMFSenderHandlerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDTMFSenderHandlerMock.h; sourceTree = "<group>"; }; > 073794F719F5864E00E5A045 /* RTCNotifiersMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCNotifiersMock.cpp; sourceTree = "<group>"; }; > 073794F819F5864E00E5A045 /* RTCNotifiersMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCNotifiersMock.h; sourceTree = "<group>"; }; > 07394EC71BAB2CCD00BE99CD /* MediaDevicesRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDevicesRequest.cpp; sourceTree = "<group>"; }; >@@ -7237,8 +7222,6 @@ > 07AB996618DA3C010018771E /* RTCConfiguration.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCConfiguration.idl; sourceTree = "<group>"; }; > 07AB996718DA3C010018771E /* RTCIceServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCIceServer.h; sourceTree = "<group>"; }; > 07AB996818DA3C010018771E /* RTCIceServer.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCIceServer.idl; sourceTree = "<group>"; }; >- 07AB996D18DA3C740018771E /* RTCConfigurationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCConfigurationPrivate.h; sourceTree = "<group>"; }; >- 07AB996E18DA3C740018771E /* RTCIceServerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCIceServerPrivate.h; sourceTree = "<group>"; }; > 07ABEF6B1D8A1C5800F21972 /* MediaDevicesEnumerationRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaDevicesEnumerationRequest.cpp; sourceTree = "<group>"; }; > 07ABEF6D1D8A1C7600F21972 /* MediaDevicesEnumerationRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaDevicesEnumerationRequest.h; sourceTree = "<group>"; }; > 07AC46FF1952102100EE9723 /* ISOVTTCue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ISOVTTCue.cpp; sourceTree = "<group>"; }; >@@ -9758,7 +9741,6 @@ > 5E16A2E21BFA64FB0029A21E /* MediaEndpointPeerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = MediaEndpointPeerConnection.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; > 5E16A2E31BFA64FB0029A21E /* MediaEndpointPeerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = MediaEndpointPeerConnection.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; > 5E2C434D1BCEE2E50001E2BC /* PeerConnectionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerConnectionBackend.h; sourceTree = "<group>"; }; >- 5E2C434F1BCEE2E50001E2BC /* RTCConfiguration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCConfiguration.cpp; sourceTree = "<group>"; }; > 5E2C43541BCEE30D0001E2BC /* RTCPeerConnection.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = RTCPeerConnection.js; sourceTree = "<group>"; }; > 5E2C43551BCEE30D0001E2BC /* RTCPeerConnectionInternals.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = RTCPeerConnectionInternals.js; sourceTree = "<group>"; }; > 5E2C43561BCEE30D0001E2BC /* RTCRtpReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RTCRtpReceiver.cpp; sourceTree = "<group>"; }; >@@ -15080,7 +15062,6 @@ > 072A703F1D6E8F6200DF0AFC /* OverconstrainedErrorEvent.idl */, > 41E408381DCB747900EFCE19 /* PeerConnectionBackend.cpp */, > 5E2C434D1BCEE2E50001E2BC /* PeerConnectionBackend.h */, >- 5E2C434F1BCEE2E50001E2BC /* RTCConfiguration.cpp */, > 07AB996518DA3C010018771E /* RTCConfiguration.h */, > 07AB996618DA3C010018771E /* RTCConfiguration.idl */, > 07221B6317CEC32700848E51 /* RTCDataChannel.cpp */, >@@ -15177,16 +15158,12 @@ > 4A4F656F1AA997F100E38CDD /* RealtimeMediaSourceSettings.h */, > 2EC41DE21C0410A300D294FE /* RealtimeMediaSourceSupportedConstraints.cpp */, > 07C1C0E41BFB60ED00BD2256 /* RealtimeMediaSourceSupportedConstraints.h */, >- 07AB996D18DA3C740018771E /* RTCConfigurationPrivate.h */, > 07221BA217CF0AD400848E51 /* RTCDataChannelHandler.h */, > 07221BA317CF0AD400848E51 /* RTCDataChannelHandlerClient.h */, > 07221BA417CF0AD400848E51 /* RTCDTMFSenderHandler.h */, > 07221BA517CF0AD400848E51 /* RTCDTMFSenderHandlerClient.h */, > 07221BA617CF0AD400848E51 /* RTCIceCandidateDescriptor.cpp */, > 07221BA717CF0AD400848E51 /* RTCIceCandidateDescriptor.h */, >- 07AB996E18DA3C740018771E /* RTCIceServerPrivate.h */, >- 07221BA817CF0AD400848E51 /* RTCPeerConnectionHandler.cpp */, >- 07221BA917CF0AD400848E51 /* RTCPeerConnectionHandler.h */, > 07221BAA17CF0AD400848E51 /* RTCPeerConnectionHandlerClient.h */, > 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */, > 07221BAC17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.h */, >@@ -17328,12 +17305,8 @@ > AAE27B7516CBFC0D00623043 /* PlatformSpeechSynthesizerMock.h */, > 073794F319F5864E00E5A045 /* RTCDataChannelHandlerMock.cpp */, > 073794F419F5864E00E5A045 /* RTCDataChannelHandlerMock.h */, >- 073794F519F5864E00E5A045 /* RTCDTMFSenderHandlerMock.cpp */, >- 073794F619F5864E00E5A045 /* RTCDTMFSenderHandlerMock.h */, > 073794F719F5864E00E5A045 /* RTCNotifiersMock.cpp */, > 073794F819F5864E00E5A045 /* RTCNotifiersMock.h */, >- 073794EF19EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.cpp */, >- 073794F019EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.h */, > 5CB37FFC1C62D27800F20188 /* ScrollAnimatorMock.cpp */, > 5CB37FFD1C62D27800F20188 /* ScrollAnimatorMock.h */, > 0FE71403142170B800DB33BA /* ScrollbarThemeMock.cpp */, >@@ -27365,7 +27338,6 @@ > A73F95FF12C97BFE0031AAF9 /* RoundedRect.h in Headers */, > 57E233631DC7DA2400F28D01 /* RsaOtherPrimesInfo.h in Headers */, > 07AB996918DA3C010018771E /* RTCConfiguration.h in Headers */, >- 07AB996F18DA3C740018771E /* RTCConfigurationPrivate.h in Headers */, > 5351D4B11DF916B4008010CD /* FileHandle.h in Headers */, > 078E091E17D14D1C00420AA1 /* RTCDataChannel.h in Headers */, > 078E091F17D14D1C00420AA1 /* RTCDataChannelEvent.h in Headers */, >@@ -27375,20 +27347,16 @@ > 078E092017D14D1C00420AA1 /* RTCDTMFSender.h in Headers */, > 078E093E17D16E1C00420AA1 /* RTCDTMFSenderHandler.h in Headers */, > 078E093F17D16E1C00420AA1 /* RTCDTMFSenderHandlerClient.h in Headers */, >- 073794FC19F5864E00E5A045 /* RTCDTMFSenderHandlerMock.h in Headers */, > 078E092117D14D1C00420AA1 /* RTCDTMFToneChangeEvent.h in Headers */, > 078E092317D14D1C00420AA1 /* RTCIceCandidate.h in Headers */, > 078E094017D16E1C00420AA1 /* RTCIceCandidateDescriptor.h in Headers */, > 078E092417D14D1C00420AA1 /* RTCIceCandidateEvent.h in Headers */, > 07AB996B18DA3C010018771E /* RTCIceServer.h in Headers */, >- 07AB997018DA3C740018771E /* RTCIceServerPrivate.h in Headers */, > 073794FE19F5864E00E5A045 /* RTCNotifiersMock.h in Headers */, > 073794DE19EE2C5200E5A045 /* RTCOfferAnswerOptions.h in Headers */, > 078E092517D14D1C00420AA1 /* RTCPeerConnection.h in Headers */, > 5E2C437B1BCF9A570001E2BC /* RTCPeerConnectionBuiltins.h in Headers */, >- 078E094117D16E1C00420AA1 /* RTCPeerConnectionHandler.h in Headers */, > 078E094217D16E1C00420AA1 /* RTCPeerConnectionHandlerClient.h in Headers */, >- 073794F219EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.h in Headers */, > 5E2C437C1BCF9A840001E2BC /* RTCPeerConnectionInternalsBuiltins.h in Headers */, > 5E2C43631BCEE32B0001E2BC /* RTCRtpReceiver.h in Headers */, > 5E2C43611BCEE3230001E2BC /* RTCRtpSender.h in Headers */, >@@ -31036,20 +31004,16 @@ > A8CFF5E70A155A05000A4234 /* RootInlineBox.cpp in Sources */, > 49E911C80EF86D47009D0CAF /* RotateTransformOperation.cpp in Sources */, > A73F95FE12C97BFE0031AAF9 /* RoundedRect.cpp in Sources */, >- 5E2C43531BCEE2F60001E2BC /* RTCConfiguration.cpp in Sources */, > 078E090517D14CEE00420AA1 /* RTCDataChannel.cpp in Sources */, > 078E090617D14CEE00420AA1 /* RTCDataChannelEvent.cpp in Sources */, > 073794F919F5864E00E5A045 /* RTCDataChannelHandlerMock.cpp in Sources */, > 078E090717D14CEE00420AA1 /* RTCDTMFSender.cpp in Sources */, >- 073794FB19F5864E00E5A045 /* RTCDTMFSenderHandlerMock.cpp in Sources */, > 078E090817D14CEE00420AA1 /* RTCDTMFToneChangeEvent.cpp in Sources */, > 078E090917D14CEE00420AA1 /* RTCIceCandidate.cpp in Sources */, > 073BE34F17D18183002BD431 /* RTCIceCandidateDescriptor.cpp in Sources */, > 078E090A17D14CEE00420AA1 /* RTCIceCandidateEvent.cpp in Sources */, > 073794FD19F5864E00E5A045 /* RTCNotifiersMock.cpp in Sources */, > 078E090B17D14CEE00420AA1 /* RTCPeerConnection.cpp in Sources */, >- 073BE35017D181A6002BD431 /* RTCPeerConnectionHandler.cpp in Sources */, >- 073794F119EE37BB00E5A045 /* RTCPeerConnectionHandlerMock.cpp in Sources */, > 5E2C43621BCEE32B0001E2BC /* RTCRtpReceiver.cpp in Sources */, > 5E2C43601BCEE3230001E2BC /* RTCRtpSender.cpp in Sources */, > 5E5E2B131CFC3E70000C0D85 /* RTCRtpTransceiver.cpp in Sources */, >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 162e6841bc1e4753b1db28b7fea34a76f10bfae1..97a41606f27b38c89e0225f45fd91373aae12798 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -1353,8 +1353,15 @@ sub GenerateDictionaryImplementationContent > # 2. Let value be the result of converting idlValue to an ECMAScript value. > # 3. Perform ! CreateDataProperty(O, key, value). > if (!$member->isRequired && not defined $member->default) { >- $result .= " if (dictionary.${key}) {\n"; >- $result .= " auto ${key}Value = toJS<$IDLType>(state, globalObject, dictionary.${key});\n"; >+ # FIXME: Replace with a more general solution, presumably using C++ code in JSDOMConvert rather than more special cases here. >+ my $nullCheck = "dictionary.${key}"; >+ my $value = "*dictionary.${key}"; >+ if ($codeGenerator->IsStringType($member->type)) { >+ $nullCheck = "!dictionary.${key}.isNull()"; >+ $value = "dictionary.${key}"; >+ } >+ $result .= " if ($nullCheck) {\n"; >+ $result .= " auto ${key}Value = toJS<$IDLType>(state, globalObject, $value);\n"; > $result .= " result->putDirect(vm, JSC::Identifier::fromString(&vm, \"${key}\"), ${key}Value);\n"; > $result .= " }\n"; > } else { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >index cdee4db47503707c565a87ec22df7285fdbb7ce2..42b4943a1832850a0d671ab30d43210232a488cd 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >@@ -697,15 +697,15 @@ JSC::JSObject* convertDictionaryToJS(JSC::ExecState& state, JSDOMGlobalObject& g > auto booleanWithDefaultValue = toJS<IDLBoolean>(state, globalObject, dictionary.booleanWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "booleanWithDefault"), booleanWithDefaultValue); > if (dictionary.booleanWithoutDefault) { >- auto booleanWithoutDefaultValue = toJS<IDLBoolean>(state, globalObject, dictionary.booleanWithoutDefault); >+ auto booleanWithoutDefaultValue = toJS<IDLBoolean>(state, globalObject, *dictionary.booleanWithoutDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "booleanWithoutDefault"), booleanWithoutDefaultValue); > } > if (dictionary.bufferSourceValue) { >- auto bufferSourceValueValue = toJS<IDLBufferSource>(state, globalObject, dictionary.bufferSourceValue); >+ auto bufferSourceValueValue = toJS<IDLBufferSource>(state, globalObject, *dictionary.bufferSourceValue); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "bufferSourceValue"), bufferSourceValueValue); > } > if (dictionary.dictionaryMember) { >- auto dictionaryMemberValue = toJS<IDLDictionary<TestObj::DictionaryThatShouldTolerateNull>>(state, globalObject, dictionary.dictionaryMember); >+ auto dictionaryMemberValue = toJS<IDLDictionary<TestObj::DictionaryThatShouldTolerateNull>>(state, globalObject, *dictionary.dictionaryMember); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "dictionaryMember"), dictionaryMemberValue); > } > auto enumerationValueWithDefaultValue = toJS<IDLEnumeration<TestObj::EnumType>>(state, globalObject, dictionary.enumerationValueWithDefault); >@@ -713,17 +713,17 @@ JSC::JSObject* convertDictionaryToJS(JSC::ExecState& state, JSDOMGlobalObject& g > auto enumerationValueWithEmptyStringDefaultValue = toJS<IDLEnumeration<TestObj::EnumType>>(state, globalObject, dictionary.enumerationValueWithEmptyStringDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "enumerationValueWithEmptyStringDefault"), enumerationValueWithEmptyStringDefaultValue); > if (dictionary.enumerationValueWithoutDefault) { >- auto enumerationValueWithoutDefaultValue = toJS<IDLEnumeration<TestObj::EnumType>>(state, globalObject, dictionary.enumerationValueWithoutDefault); >+ auto enumerationValueWithoutDefaultValue = toJS<IDLEnumeration<TestObj::EnumType>>(state, globalObject, *dictionary.enumerationValueWithoutDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "enumerationValueWithoutDefault"), enumerationValueWithoutDefaultValue); > } > if (dictionary.integer) { >- auto integerValue = toJS<IDLLong>(state, globalObject, dictionary.integer); >+ auto integerValue = toJS<IDLLong>(state, globalObject, *dictionary.integer); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "integer"), integerValue); > } > auto integerWithDefaultValue = toJS<IDLLong>(state, globalObject, dictionary.integerWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "integerWithDefault"), integerWithDefaultValue); > if (dictionary.largeInteger) { >- auto largeIntegerValue = toJS<IDLLongLong>(state, globalObject, dictionary.largeInteger); >+ auto largeIntegerValue = toJS<IDLLongLong>(state, globalObject, *dictionary.largeInteger); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "largeInteger"), largeIntegerValue); > } > auto largeIntegerWithDefaultValue = toJS<IDLLongLong>(state, globalObject, dictionary.largeIntegerWithDefault); >@@ -737,65 +737,65 @@ JSC::JSObject* convertDictionaryToJS(JSC::ExecState& state, JSDOMGlobalObject& g > auto nullableUnionMemberValue = toJS<IDLNullable<IDLUnion<IDLLong, IDLInterface<Node>>>>(state, globalObject, dictionary.nullableUnionMember); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "nullableUnionMember"), nullableUnionMemberValue); > if (dictionary.restrictedDouble) { >- auto restrictedDoubleValue = toJS<IDLDouble>(state, globalObject, dictionary.restrictedDouble); >+ auto restrictedDoubleValue = toJS<IDLDouble>(state, globalObject, *dictionary.restrictedDouble); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "restrictedDouble"), restrictedDoubleValue); > } > auto restrictedDoubleWithDefaultValue = toJS<IDLDouble>(state, globalObject, dictionary.restrictedDoubleWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "restrictedDoubleWithDefault"), restrictedDoubleWithDefaultValue); > if (dictionary.restrictedFloat) { >- auto restrictedFloatValue = toJS<IDLFloat>(state, globalObject, dictionary.restrictedFloat); >+ auto restrictedFloatValue = toJS<IDLFloat>(state, globalObject, *dictionary.restrictedFloat); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "restrictedFloat"), restrictedFloatValue); > } > auto restrictedFloatWithDefaultValue = toJS<IDLFloat>(state, globalObject, dictionary.restrictedFloatWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "restrictedFloatWithDefault"), restrictedFloatWithDefaultValue); > if (dictionary.sequenceOfStrings) { >- auto sequenceOfStringsValue = toJS<IDLSequence<IDLDOMString>>(state, globalObject, dictionary.sequenceOfStrings); >+ auto sequenceOfStringsValue = toJS<IDLSequence<IDLDOMString>>(state, globalObject, *dictionary.sequenceOfStrings); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "sequenceOfStrings"), sequenceOfStringsValue); > } > if (dictionary.smallIntegerClamped) { >- auto smallIntegerClampedValue = toJS<IDLByte>(state, globalObject, dictionary.smallIntegerClamped); >+ auto smallIntegerClampedValue = toJS<IDLByte>(state, globalObject, *dictionary.smallIntegerClamped); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "smallIntegerClamped"), smallIntegerClampedValue); > } > if (dictionary.smallIntegerWithDefault) { >- auto smallIntegerWithDefaultValue = toJS<IDLByte>(state, globalObject, dictionary.smallIntegerWithDefault); >+ auto smallIntegerWithDefaultValue = toJS<IDLByte>(state, globalObject, *dictionary.smallIntegerWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "smallIntegerWithDefault"), smallIntegerWithDefaultValue); > } > if (dictionary.smallUnsignedIntegerEnforcedRange) { >- auto smallUnsignedIntegerEnforcedRangeValue = toJS<IDLOctet>(state, globalObject, dictionary.smallUnsignedIntegerEnforcedRange); >+ auto smallUnsignedIntegerEnforcedRangeValue = toJS<IDLOctet>(state, globalObject, *dictionary.smallUnsignedIntegerEnforcedRange); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "smallUnsignedIntegerEnforcedRange"), smallUnsignedIntegerEnforcedRangeValue); > } > auto smallUnsignedIntegerWithDefaultValue = toJS<IDLOctet>(state, globalObject, dictionary.smallUnsignedIntegerWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "smallUnsignedIntegerWithDefault"), smallUnsignedIntegerWithDefaultValue); > auto stringWithDefaultValue = toJS<IDLDOMString>(state, globalObject, dictionary.stringWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "stringWithDefault"), stringWithDefaultValue); >- if (dictionary.stringWithoutDefault) { >+ if (!dictionary.stringWithoutDefault.isNull()) { > auto stringWithoutDefaultValue = toJS<IDLDOMString>(state, globalObject, dictionary.stringWithoutDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "stringWithoutDefault"), stringWithoutDefaultValue); > } > if (dictionary.unionMember) { >- auto unionMemberValue = toJS<IDLUnion<IDLLong, IDLInterface<Node>>>(state, globalObject, dictionary.unionMember); >+ auto unionMemberValue = toJS<IDLUnion<IDLLong, IDLInterface<Node>>>(state, globalObject, *dictionary.unionMember); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "unionMember"), unionMemberValue); > } > if (dictionary.unrestrictedDouble) { >- auto unrestrictedDoubleValue = toJS<IDLUnrestrictedDouble>(state, globalObject, dictionary.unrestrictedDouble); >+ auto unrestrictedDoubleValue = toJS<IDLUnrestrictedDouble>(state, globalObject, *dictionary.unrestrictedDouble); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "unrestrictedDouble"), unrestrictedDoubleValue); > } > auto unrestrictedDoubleWithDefaultValue = toJS<IDLUnrestrictedDouble>(state, globalObject, dictionary.unrestrictedDoubleWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "unrestrictedDoubleWithDefault"), unrestrictedDoubleWithDefaultValue); > if (dictionary.unrestrictedFloat) { >- auto unrestrictedFloatValue = toJS<IDLUnrestrictedFloat>(state, globalObject, dictionary.unrestrictedFloat); >+ auto unrestrictedFloatValue = toJS<IDLUnrestrictedFloat>(state, globalObject, *dictionary.unrestrictedFloat); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "unrestrictedFloat"), unrestrictedFloatValue); > } > auto unrestrictedFloatWithDefaultValue = toJS<IDLUnrestrictedFloat>(state, globalObject, dictionary.unrestrictedFloatWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "unrestrictedFloatWithDefault"), unrestrictedFloatWithDefaultValue); > if (dictionary.unsignedInteger) { >- auto unsignedIntegerValue = toJS<IDLUnsignedLong>(state, globalObject, dictionary.unsignedInteger); >+ auto unsignedIntegerValue = toJS<IDLUnsignedLong>(state, globalObject, *dictionary.unsignedInteger); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "unsignedInteger"), unsignedIntegerValue); > } > auto unsignedIntegerWithDefaultValue = toJS<IDLUnsignedLong>(state, globalObject, dictionary.unsignedIntegerWithDefault); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "unsignedIntegerWithDefault"), unsignedIntegerWithDefaultValue); > if (dictionary.unsignedLargeInteger) { >- auto unsignedLargeIntegerValue = toJS<IDLUnsignedLongLong>(state, globalObject, dictionary.unsignedLargeInteger); >+ auto unsignedLargeIntegerValue = toJS<IDLUnsignedLongLong>(state, globalObject, *dictionary.unsignedLargeInteger); > result->putDirect(vm, JSC::Identifier::fromString(&vm, "unsignedLargeInteger"), unsignedLargeIntegerValue); > } > auto unsignedLargeIntegerWithDefaultValue = toJS<IDLUnsignedLongLong>(state, globalObject, dictionary.unsignedLargeIntegerWithDefault); >diff --git a/Source/WebCore/platform/mediastream/RTCConfigurationPrivate.h b/Source/WebCore/platform/mediastream/RTCConfigurationPrivate.h >deleted file mode 100644 >index 9b5c8dec8e1dbb023ce927724b067dc847fc30a5..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mediastream/RTCConfigurationPrivate.h >+++ /dev/null >@@ -1,80 +0,0 @@ >-/* >- * Copyright (C) 2014 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. ``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 >- * 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. >- */ >- >-#ifndef RTCConfigurationPrivate_h >-#define RTCConfigurationPrivate_h >- >-#if ENABLE(WEB_RTC) >- >-#include "RTCIceServerPrivate.h" >-#include <wtf/PassRefPtr.h> >-#include <wtf/RefCounted.h> >-#include <wtf/Vector.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >-class RTCConfigurationPrivate : public RefCounted<RTCConfigurationPrivate> { >-public: >- static PassRefPtr<RTCConfigurationPrivate> create() { return adoptRef(new RTCConfigurationPrivate()); } >- virtual ~RTCConfigurationPrivate() { } >- >- void appendServer(PassRefPtr<RTCIceServerPrivate> server) { m_privateServers.append(server); } >- size_t numberOfServers() { return m_privateServers.size(); } >- RTCIceServerPrivate* server(size_t index) { return m_privateServers[index].get(); } >- >- const String& iceTransports() const { return m_iceTransports; } >- void setIceTransports(const String& iceTransports) >- { >- if (iceTransports == "none" || iceTransports == "relay" || iceTransports == "all") >- m_iceTransports = iceTransports; >- } >- >- const String& requestIdentity() const { return m_requestIdentity; } >- void setRequestIdentity(const String& requestIdentity) >- { >- if (requestIdentity == "yes" || requestIdentity == "no" || requestIdentity == "ifconfigured") >- m_requestIdentity = requestIdentity; >- } >- >- Vector<RefPtr<RTCIceServerPrivate>> iceServers() const { return m_privateServers; } >- >-private: >- RTCConfigurationPrivate() >- : m_iceTransports("all") >- , m_requestIdentity("ifconfigured") >- { >- } >- >- Vector<RefPtr<RTCIceServerPrivate>> m_privateServers; >- String m_iceTransports; >- String m_requestIdentity; >-}; >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >- >-#endif // RTCConfigurationPrivate_h >diff --git a/Source/WebCore/platform/mediastream/RTCIceServerPrivate.h b/Source/WebCore/platform/mediastream/RTCIceServerPrivate.h >deleted file mode 100644 >index 27cb9a59236d620307367f0b6b6fdb87516bcfd6..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mediastream/RTCIceServerPrivate.h >+++ /dev/null >@@ -1,67 +0,0 @@ >-/* >- * Copyright (C) 2014 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. ``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 >- * 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. >- */ >- >-#ifndef RTCIceServerPrivate_h >-#define RTCIceServerPrivate_h >- >-#if ENABLE(WEB_RTC) >- >-#include <wtf/PassRefPtr.h> >-#include <wtf/RefCounted.h> >-#include <wtf/Vector.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >-class RTCIceServerPrivate : public RefCounted<RTCIceServerPrivate> { >-public: >- static PassRefPtr<RTCIceServerPrivate> create(const Vector<String>& urls, const String& credential, const String& username) >- { >- return adoptRef(new RTCIceServerPrivate(urls, credential, username)); >- } >- virtual ~RTCIceServerPrivate() { } >- >- const Vector<String>& urls() { return m_urls; } >- const String& credential() { return m_credential; } >- const String& username() { return m_username; } >- >-private: >- RTCIceServerPrivate(const Vector<String>& urls, const String& credential, const String& username) >- : m_urls(urls) >- , m_credential(credential) >- , m_username(username) >- { >- } >- >- Vector<String> m_urls; >- String m_credential; >- String m_username; >-}; >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >- >-#endif // RTCIceServerPrivate_h >diff --git a/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp b/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp >deleted file mode 100644 >index 0239e0b5d917af09fda6459fb05ccbc0ff183569..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp >+++ /dev/null >@@ -1,76 +0,0 @@ >-/* >- * Copyright (C) 2012 Google Inc. All rights reserved. >- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions are >- * met: >- * >- * * Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * * 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. >- * * Neither the name of Google Inc. nor the names of its >- * contributors may be used to endorse or promote products derived from >- * this software without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >- * OWNER OR 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. >- */ >- >-#include "config.h" >- >-#if ENABLE(WEB_RTC) >- >-#include "RTCPeerConnectionHandler.h" >- >-#include <wtf/NeverDestroyed.h> >- >-namespace WebCore { >-class RTCPeerConnectionHandlerClient; >- >-static std::unique_ptr<RTCPeerConnectionHandler> createHandler(RTCPeerConnectionHandlerClient*) >-{ >- return nullptr; >-} >- >-CreatePeerConnectionHandler RTCPeerConnectionHandler::create = createHandler; >- >-const AtomicString& RTCPeerConnectionHandler::incompatibleConstraintsErrorName() >-{ >- static NeverDestroyed<AtomicString> incompatibleConstraints("IncompatibleConstraintsError", AtomicString::ConstructFromLiteral); >- return incompatibleConstraints; >-} >- >-const AtomicString& RTCPeerConnectionHandler::invalidSessionDescriptionErrorName() >-{ >- static NeverDestroyed<AtomicString> invalidSessionDescription("InvalidSessionDescriptionError", AtomicString::ConstructFromLiteral); >- return invalidSessionDescription; >-} >- >-const AtomicString& RTCPeerConnectionHandler::incompatibleSessionDescriptionErrorName() >-{ >- static NeverDestroyed<AtomicString> incompatibleSessionDescription("IncompatibleSessionDescriptionError", AtomicString::ConstructFromLiteral); >- return incompatibleSessionDescription; >-} >- >-const AtomicString& RTCPeerConnectionHandler::internalErrorName() >-{ >- static NeverDestroyed<AtomicString> internal("InternalError", AtomicString::ConstructFromLiteral); >- return internal; >-} >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >diff --git a/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h b/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h >deleted file mode 100644 >index 9ac770d98f2031f41e7a5cb510be18b552182733..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h >+++ /dev/null >@@ -1,92 +0,0 @@ >-/* >- * Copyright (C) 2012 Google Inc. All rights reserved. >- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >- * >- * 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. >- * 3. Neither the name of Google Inc. nor the names of its contributors >- * may be used to endorse or promote products derived from this >- * software without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >- * OWNER OR 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. >- */ >- >-#ifndef RTCPeerConnectionHandler_h >-#define RTCPeerConnectionHandler_h >- >-#if ENABLE(WEB_RTC) >- >-#include "MediaStreamPrivate.h" >-#include <wtf/PassRefPtr.h> >- >-namespace WebCore { >- >-class RealtimeMediaSource; >-class RTCConfigurationPrivate; >-class RTCDTMFSenderHandler; >-class RTCDataChannelHandler; >-class RTCIceCandidateDescriptor; >-class RTCOfferOptionsPrivate; >-class RTCOfferAnswerOptionsPrivate; >-class RTCPeerConnectionHandler; >-class RTCPeerConnectionHandlerClient; >-class RTCSessionDescriptionDescriptor; >-class RTCSessionDescriptionRequest; >-class RTCStatsRequest; >-class RTCVoidRequest; >- >-struct RTCDataChannelInit; >- >-typedef std::unique_ptr<RTCPeerConnectionHandler> (*CreatePeerConnectionHandler)(RTCPeerConnectionHandlerClient*); >- >-class RTCPeerConnectionHandler { >-public: >- WEBCORE_EXPORT static CreatePeerConnectionHandler create; >- virtual ~RTCPeerConnectionHandler() { } >- >- static const AtomicString& incompatibleConstraintsErrorName(); >- static const AtomicString& invalidSessionDescriptionErrorName(); >- static const AtomicString& incompatibleSessionDescriptionErrorName(); >- static const AtomicString& internalErrorName(); >- >- virtual bool initialize(PassRefPtr<RTCConfigurationPrivate>) = 0; >- >- virtual void createOffer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCOfferOptionsPrivate>) = 0; >- virtual void createAnswer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCOfferAnswerOptionsPrivate>) = 0; >- virtual void setLocalDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) = 0; >- virtual void setRemoteDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) = 0; >- virtual PassRefPtr<RTCSessionDescriptionDescriptor> localDescription() = 0; >- virtual PassRefPtr<RTCSessionDescriptionDescriptor> remoteDescription() = 0; >- virtual bool updateIce(PassRefPtr<RTCConfigurationPrivate>) = 0; >- virtual bool addIceCandidate(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCIceCandidateDescriptor>) = 0; >- virtual bool addStream(PassRefPtr<MediaStreamPrivate>) = 0; >- virtual void removeStream(PassRefPtr<MediaStreamPrivate>) = 0; >- virtual void getStats(PassRefPtr<RTCStatsRequest>) = 0; >- virtual std::unique_ptr<RTCDataChannelHandler> createDataChannel(const String& label, const RTCDataChannelInit&) = 0; >- virtual std::unique_ptr<RTCDTMFSenderHandler> createDTMFSender(PassRefPtr<RealtimeMediaSource>) = 0; >- virtual void stop() = 0; >-}; >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >- >-#endif // RTCPeerConnectionHandler_h >diff --git a/Source/WebCore/platform/mock/RTCDTMFSenderHandlerMock.cpp b/Source/WebCore/platform/mock/RTCDTMFSenderHandlerMock.cpp >deleted file mode 100644 >index 26d099e3ff28d3cd3fe97b0794d8d21dee1021cb..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mock/RTCDTMFSenderHandlerMock.cpp >+++ /dev/null >@@ -1,62 +0,0 @@ >-/* >- * Copyright (C) 2014 Samsung Electornics and/or its subsidiary(-ies). >- * >- * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >- * OWNER OR 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. >- */ >- >-#include "config.h" >- >-#if ENABLE(WEB_RTC) >-#include "RTCDTMFSenderHandlerMock.h" >- >-#include "RTCDTMFSenderHandlerClient.h" >- >-namespace WebCore { >- >-RTCDTMFSenderHandlerMock::RTCDTMFSenderHandlerMock() >- : m_duration(0) >- , m_interToneGap(0) >-{ >-} >- >-void RTCDTMFSenderHandlerMock::setClient(RTCDTMFSenderHandlerClient* client) >-{ >- m_client = client; >-} >- >-bool RTCDTMFSenderHandlerMock::insertDTMF(const String& tones, long duration, long interToneGap) >-{ >- m_duration = duration; >- m_interToneGap = interToneGap; >- m_toneBuffer.append(tones); >- if (m_client) { >- for (size_t i = 0; i < m_toneBuffer.length(); ++i) >- m_client->didPlayTone(m_toneBuffer.substring(i, 1)); >- m_toneBuffer = emptyString(); >- m_client->didPlayTone(emptyString()); >- } >- return true; >-} >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >diff --git a/Source/WebCore/platform/mock/RTCDTMFSenderHandlerMock.h b/Source/WebCore/platform/mock/RTCDTMFSenderHandlerMock.h >deleted file mode 100644 >index 5615094db3b2c03ec08051191d22f7b5fdd7b50b..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mock/RTCDTMFSenderHandlerMock.h >+++ /dev/null >@@ -1,58 +0,0 @@ >-/* >- * Copyright (C) 2014 Samsung Electornics and/or its subsidiary(-ies). >- * >- * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >- * OWNER OR 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. >- */ >- >-#ifndef RTCDTMFSenderHandlerMock_h >-#define RTCDTMFSenderHandlerMock_h >- >-#if ENABLE(WEB_RTC) >- >-#include "RTCDTMFSenderHandler.h" >-#include "RTCPeerConnectionHandler.h" >- >-namespace WebCore { >- >-class RTCDTMFSenderHandlerMock final : public RTCDTMFSenderHandler { >-public: >- RTCDTMFSenderHandlerMock(); >- virtual ~RTCDTMFSenderHandlerMock() { } >- >- void setClient(RTCDTMFSenderHandlerClient*) override; >- String currentToneBuffer() override { return m_toneBuffer; } >- bool canInsertDTMF() override { return true; } >- bool insertDTMF(const String& tones, long duration, long interToneGap) override; >- >-private: >- RTCDTMFSenderHandlerClient* m_client; >- >- String m_toneBuffer; >- long m_duration; >- long m_interToneGap; >-}; >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >- >-#endif // RTCDataChannelHandlerMock_h >diff --git a/Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h b/Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h >index ebd835fc9b2ec26ccf8f18014549c866aee1eb7f..1562f58a89689091b69357bbecd8fd37586e26d9 100644 >--- a/Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h >+++ b/Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h >@@ -23,13 +23,11 @@ > * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#ifndef RTCDataChannelHandlerMock_h >-#define RTCDataChannelHandlerMock_h >+#pragma once > > #if ENABLE(WEB_RTC) > > #include "RTCDataChannelHandler.h" >-#include "RTCPeerConnectionHandler.h" > #include "TimerEventBasedMock.h" > > namespace WebCore { >@@ -37,15 +35,14 @@ namespace WebCore { > class RTCDataChannelHandlerMock final : public RTCDataChannelHandler, public TimerEventBasedMock { > public: > RTCDataChannelHandlerMock(const String&, const RTCDataChannelInit&); >- virtual ~RTCDataChannelHandlerMock() { } > >- void setClient(RTCDataChannelHandlerClient*) override; >+private: >+ void setClient(RTCDataChannelHandlerClient*) final; > >- bool sendStringData(const String&) override; >- bool sendRawData(const char*, size_t) override; >- void close() override; >+ bool sendStringData(const String&) final; >+ bool sendRawData(const char*, size_t) final; >+ void close() final; > >-private: > RTCDataChannelHandlerClient* m_client; > > String m_label; >@@ -55,5 +52,3 @@ private: > } // namespace WebCore > > #endif // ENABLE(WEB_RTC) >- >-#endif // RTCDataChannelHandlerMock_h >diff --git a/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp b/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp >deleted file mode 100644 >index 91be0fa5d3542e0b78a1f89a4a810b72859f1d00..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.cpp >+++ /dev/null >@@ -1,179 +0,0 @@ >-/* >- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >- * >- * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >- * OWNER OR 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. >- */ >- >-#include "config.h" >- >-#if ENABLE(WEB_RTC) >- >-#include "RTCPeerConnectionHandlerMock.h" >- >-#include "NotImplemented.h" >-#include "RTCDTMFSenderHandler.h" >-#include "RTCDTMFSenderHandlerMock.h" >-#include "RTCDataChannelHandler.h" >-#include "RTCDataChannelHandlerMock.h" >-#include "RTCNotifiersMock.h" >-#include "RTCSessionDescriptionRequest.h" >-#include "RTCVoidRequest.h" >-#include <wtf/text/CString.h> >- >-namespace WebCore { >- >-std::unique_ptr<RTCPeerConnectionHandler> RTCPeerConnectionHandlerMock::create(RTCPeerConnectionHandlerClient* client) >-{ >- return std::make_unique<RTCPeerConnectionHandlerMock>(client); >-} >- >-RTCPeerConnectionHandlerMock::RTCPeerConnectionHandlerMock(RTCPeerConnectionHandlerClient* client) >- : m_client(client) >-{ >-} >- >-bool RTCPeerConnectionHandlerMock::initialize(PassRefPtr<RTCConfigurationPrivate>) >-{ >- RefPtr<IceConnectionNotifier> notifier = adoptRef(new IceConnectionNotifier(m_client, RTCPeerConnectionHandlerClient::IceConnectionStateCompleted, RTCPeerConnectionHandlerClient::IceGatheringStateComplete)); >- m_timerEvents.append(adoptRef(new TimerEvent(this, notifier))); >- return true; >-} >- >-void RTCPeerConnectionHandlerMock::createOffer(PassRefPtr<RTCSessionDescriptionRequest> request, PassRefPtr<RTCOfferOptionsPrivate>) >-{ >- RefPtr<SessionRequestNotifier> notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create("offer", "local"))); >- m_timerEvents.append(adoptRef(new TimerEvent(this, notifier))); >-} >- >-void RTCPeerConnectionHandlerMock::createAnswer(PassRefPtr<RTCSessionDescriptionRequest> request, PassRefPtr<RTCOfferAnswerOptionsPrivate>) >-{ >- RefPtr<SessionRequestNotifier> notifier = adoptRef(new SessionRequestNotifier(request, RTCSessionDescriptionDescriptor::create("answer", "local"))); >- m_timerEvents.append(adoptRef(new TimerEvent(this, notifier))); >-} >- >-RTCPeerConnectionHandlerClient::SignalingState RTCPeerConnectionHandlerMock::signalingStateFromSDP(RTCSessionDescriptionDescriptor* descriptor) >-{ >- if (descriptor->type() == "offer" && descriptor->sdp() == "local") >- return RTCPeerConnectionHandlerClient::SignalingStateHaveLocalOffer; >- if (descriptor->type() == "offer" && descriptor->sdp() == "remote") >- return RTCPeerConnectionHandlerClient::SignalingStateHaveRemoteOffer; >- if (descriptor->type() == "pranswer" && descriptor->sdp() == "local") >- return RTCPeerConnectionHandlerClient::SignalingStateHaveLocalPrAnswer; >- if (descriptor->type() == "pranswer" && descriptor->sdp() == "remote") >- return RTCPeerConnectionHandlerClient::SignalingStateHaveRemotePrAnswer; >- >- return RTCPeerConnectionHandlerClient::SignalingStateStable; >-} >- >-void RTCPeerConnectionHandlerMock::setLocalDescription(PassRefPtr<RTCVoidRequest> request, PassRefPtr<RTCSessionDescriptionDescriptor> descriptor) >-{ >- RefPtr<VoidRequestNotifier> voidNotifier; >- RefPtr<SignalingStateNotifier> signalingNotifier; >- if (!descriptor.get() || descriptor->sdp() != "local") >- voidNotifier = adoptRef(new VoidRequestNotifier(request, false, RTCPeerConnectionHandler::internalErrorName())); >- else { >- m_localSessionDescription = descriptor; >- signalingNotifier = adoptRef(new SignalingStateNotifier(m_client, signalingStateFromSDP(m_localSessionDescription.get()))); >- voidNotifier = adoptRef(new VoidRequestNotifier(request, true)); >- m_timerEvents.append(adoptRef(new TimerEvent(this, signalingNotifier))); >- } >- >- m_timerEvents.append(adoptRef(new TimerEvent(this, voidNotifier))); >-} >- >-void RTCPeerConnectionHandlerMock::setRemoteDescription(PassRefPtr<RTCVoidRequest> request, PassRefPtr<RTCSessionDescriptionDescriptor> descriptor) >-{ >- RefPtr<VoidRequestNotifier> voidNotifier; >- RefPtr<SignalingStateNotifier> signalingNotifier; >- if (!descriptor.get() || descriptor->sdp() != "remote") >- voidNotifier = adoptRef(new VoidRequestNotifier(request, false, RTCPeerConnectionHandler::internalErrorName())); >- else { >- m_remoteSessionDescription = descriptor; >- signalingNotifier = adoptRef(new SignalingStateNotifier(m_client, signalingStateFromSDP(m_remoteSessionDescription.get()))); >- voidNotifier = adoptRef(new VoidRequestNotifier(request, true)); >- m_timerEvents.append(adoptRef(new TimerEvent(this, signalingNotifier))); >- } >- >- m_timerEvents.append(adoptRef(new TimerEvent(this, voidNotifier))); >-} >- >-PassRefPtr<RTCSessionDescriptionDescriptor> RTCPeerConnectionHandlerMock::localDescription() >-{ >- return m_localSessionDescription; >-} >- >-PassRefPtr<RTCSessionDescriptionDescriptor> RTCPeerConnectionHandlerMock::remoteDescription() >-{ >- return m_remoteSessionDescription; >-} >- >-bool RTCPeerConnectionHandlerMock::updateIce(PassRefPtr<RTCConfigurationPrivate>) >-{ >- return true; >-} >- >-bool RTCPeerConnectionHandlerMock::addIceCandidate(PassRefPtr<RTCVoidRequest> request, PassRefPtr<RTCIceCandidateDescriptor>) >-{ >- RefPtr<VoidRequestNotifier> notifier = adoptRef(new VoidRequestNotifier(request, true)); >- m_timerEvents.append(adoptRef(new TimerEvent(this, notifier))); >- return true; >-} >- >-bool RTCPeerConnectionHandlerMock::addStream(PassRefPtr<MediaStreamPrivate>) >-{ >- // Spec states that every time a stream is added, a negotiationneeded event must be fired. >- m_client->negotiationNeeded(); >- return true; >-} >- >-void RTCPeerConnectionHandlerMock::removeStream(PassRefPtr<MediaStreamPrivate>) >-{ >- // Spec states that every time a stream is removed, a negotiationneeded event must be fired. >- m_client->negotiationNeeded(); >-} >- >-void RTCPeerConnectionHandlerMock::getStats(PassRefPtr<RTCStatsRequest>) >-{ >- // Current tests does not support getUserMedia and this function requires it. >- // Once WebKit has test support to getUserMedia, this must be fixed. >- notImplemented(); >-} >- >-std::unique_ptr<RTCDataChannelHandler> RTCPeerConnectionHandlerMock::createDataChannel(const String& label, const RTCDataChannelInit& init) >-{ >- RefPtr<RemoteDataChannelNotifier> notifier = adoptRef(new RemoteDataChannelNotifier(m_client)); >- m_timerEvents.append(adoptRef(new TimerEvent(this, notifier))); >- return std::make_unique<RTCDataChannelHandlerMock>(label, init); >-} >- >-std::unique_ptr<RTCDTMFSenderHandler> RTCPeerConnectionHandlerMock::createDTMFSender(PassRefPtr<RealtimeMediaSource>) >-{ >- return std::make_unique<RTCDTMFSenderHandlerMock>(); >-} >- >-void RTCPeerConnectionHandlerMock::stop() >-{ >-} >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >diff --git a/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.h b/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.h >deleted file mode 100644 >index 055238be1becc968a538317c8069f8373ab8139a..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/mock/RTCPeerConnectionHandlerMock.h >+++ /dev/null >@@ -1,75 +0,0 @@ >-/* >- * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >- * >- * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT >- * OWNER OR 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. >- */ >- >-#ifndef RTCPeerConnectionHandlerMock_h >-#define RTCPeerConnectionHandlerMock_h >- >-#if ENABLE(WEB_RTC) >- >-#include "RTCPeerConnectionHandler.h" >-#include "RTCPeerConnectionHandlerClient.h" >-#include "RTCSessionDescriptionDescriptor.h" >-#include "TimerEventBasedMock.h" >- >-namespace WebCore { >- >-class RTCPeerConnectionHandlerMock final : public RTCPeerConnectionHandler, public TimerEventBasedMock { >-public: >- WEBCORE_EXPORT static std::unique_ptr<RTCPeerConnectionHandler> create(RTCPeerConnectionHandlerClient*); >- >- virtual ~RTCPeerConnectionHandlerMock() { } >- >- bool initialize(PassRefPtr<RTCConfigurationPrivate>) override; >- >- void createOffer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCOfferOptionsPrivate>) override; >- void createAnswer(PassRefPtr<RTCSessionDescriptionRequest>, PassRefPtr<RTCOfferAnswerOptionsPrivate>) override; >- void setLocalDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) override; >- void setRemoteDescription(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCSessionDescriptionDescriptor>) override; >- PassRefPtr<RTCSessionDescriptionDescriptor> localDescription() override; >- PassRefPtr<RTCSessionDescriptionDescriptor> remoteDescription() override; >- bool updateIce(PassRefPtr<RTCConfigurationPrivate>) override; >- bool addIceCandidate(PassRefPtr<RTCVoidRequest>, PassRefPtr<RTCIceCandidateDescriptor>) override; >- bool addStream(PassRefPtr<MediaStreamPrivate>) override; >- void removeStream(PassRefPtr<MediaStreamPrivate>) override; >- void getStats(PassRefPtr<RTCStatsRequest>) override; >- std::unique_ptr<RTCDataChannelHandler> createDataChannel(const String& label, const RTCDataChannelInit&) override; >- std::unique_ptr<RTCDTMFSenderHandler> createDTMFSender(PassRefPtr<RealtimeMediaSource>) override; >- void stop() override; >- >- explicit RTCPeerConnectionHandlerMock(RTCPeerConnectionHandlerClient*); >- >-private: >- RTCPeerConnectionHandlerClient::SignalingState signalingStateFromSDP(RTCSessionDescriptionDescriptor*); >- RTCPeerConnectionHandlerClient* m_client; >- >- RefPtr<RTCSessionDescriptionDescriptor> m_localSessionDescription; >- RefPtr<RTCSessionDescriptionDescriptor> m_remoteSessionDescription; >-}; >- >-} // namespace WebCore >- >-#endif // ENABLE(WEB_RTC) >- >-#endif // RTCPeerConnectionHandlerMock_h >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 28c1223acc44eae5d16b04ca8e4917ed7a3f0910..2863c7dbe0b350a933157784fa62a755d290ee56 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -184,7 +184,6 @@ > #if ENABLE(WEB_RTC) > #include "MockMediaEndpoint.h" > #include "RTCPeerConnection.h" >-#include "RTCPeerConnectionHandlerMock.h" > #endif > > #if ENABLE(MEDIA_SOURCE) >@@ -433,7 +432,6 @@ Internals::Internals(Document& document) > > #if ENABLE(WEB_RTC) > enableMockMediaEndpoint(); >- enableMockRTCPeerConnectionHandler(); > #endif > > #if ENABLE(WIRELESS_PLAYBACK_TARGET) >@@ -980,11 +978,6 @@ void Internals::enableMockMediaEndpoint() > MediaEndpoint::create = MockMediaEndpoint::create; > } > >-void Internals::enableMockRTCPeerConnectionHandler() >-{ >- RTCPeerConnectionHandler::create = RTCPeerConnectionHandlerMock::create; >-} >- > void Internals::emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection& connection, const String& action) > { > connection.emulatePlatformEvent(action); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index d9eb91914e8bd59bd50f6a90b91ef755585a8a78..3fa47bfa9bbe2bc10ef7dbfd2497af9cfff6b635 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2016-12-11 Darin Adler <darin@apple.com> >+ >+ Remove uses of Dictionary in WebRTC IDL files >+ https://bugs.webkit.org/show_bug.cgi?id=165736 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt: >+ Updated expected results. The new code correctly allows callers of the RTCPeerConnection constructor >+ to omit iceServers, pass undefined, or pass an empty array, as specified. Thuis change leads to >+ a couple tests that now correctly pass instead of failing. And it also leads to some other tests >+ failing that were passing before. These were passing because they expected an exception for some >+ other reason, however the exception was actually occurring because of incorrect handling of iceServers. >+ > 2016-12-10 Simon Fraser <simon.fraser@apple.com> > > Support the deprecated dictionary constructor for DOMPointReadOnly and DOMPoint >diff --git a/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt >index 7690aa3195e5b0c52e9ae8337cac28bd8bae9b27..d82c17f714066db36c30d86c6b4bf885486438fc 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt >@@ -3,15 +3,15 @@ PASS RTCPeerConnection.length > FAIL new RTCPeerConnection() Not enough arguments > FAIL new RTCPeerConnection(null) RTCPeerConnection argument must be a valid Dictionary > FAIL new RTCPeerConnection(undefined) RTCPeerConnection argument must be a valid Dictionary >-FAIL new RTCPeerConnection({}) Invalid RTCPeerConnection constructor arguments >+PASS new RTCPeerConnection({}) > PASS new RTCPeerConnection({ iceServers: null }) >-FAIL new RTCPeerConnection({ iceServers: undefined }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ iceServers: [] }) Error creating RTCPeerConnection >+PASS new RTCPeerConnection({ iceServers: undefined }) >+PASS new RTCPeerConnection({ iceServers: [] }) > PASS new RTCPeerConnection({ iceServers: [{}] }) > PASS new RTCPeerConnection({ iceServers: [null] }) > PASS new RTCPeerConnection({ iceServers: [undefined] }) > PASS new RTCPeerConnection({ iceServers: [{ urls: "stun:stun1.example.net" }] }) >-FAIL new RTCPeerConnection({ iceServers: [{ urls: [] }] }) Error creating RTCPeerConnection >+PASS new RTCPeerConnection({ iceServers: [{ urls: [] }] }) > PASS new RTCPeerConnection({ iceServers: [{ urls: ["stun:stun1.example.net"] }] }) > PASS new RTCPeerConnection({ iceServers: [{ urls: ["stun:stun1.example.net", "stun:stun2.example.net"] }] }) > PASS new RTCPeerConnection({ iceServers: [{ urls: "turns:turn.example.org", username: "user", credential: "cred" }] }) >@@ -43,38 +43,52 @@ FAIL new RTCPeerConnection({ iceServers: [{ urls: "relative-url" }] }) assert_th > FAIL new RTCPeerConnection({ iceServers: [{ urls: "http://example.com" }] }) assert_throws: function "function () { > eval(expr); > }" threw object "TypeError: Error creating RTCPeerConnection" that is not a DOMException SyntaxError: property "code" is equal to undefined, expected 12 >-FAIL new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "password" }] }) Error creating RTCPeerConnection >-FAIL new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "token" }] }) Error creating RTCPeerConnection >-PASS new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "invalid" }] }) >+PASS new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "password" }] }) >+PASS new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "token" }] }) >+FAIL new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "invalid" }] }) assert_throws: function "function () { >+ eval(expr); >+ }" did not throw > PASS new RTCPeerConnection({ iceServers: [{ url: "stun:stun1.example.net" }] }) > PASS new RTCPeerConnection({ iceTransportPolicy: null }) >-FAIL new RTCPeerConnection({ iceTransportPolicy: undefined }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ iceTransportPolicy: "relay" }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ iceTransportPolicy: "all" }) Invalid RTCPeerConnection constructor arguments >+PASS new RTCPeerConnection({ iceTransportPolicy: undefined }) >+PASS new RTCPeerConnection({ iceTransportPolicy: "relay" }) >+PASS new RTCPeerConnection({ iceTransportPolicy: "all" }) > PASS new RTCPeerConnection({ iceTransportPolicy: "invalid" }) > PASS new RTCPeerConnection({ iceTransportPolicy: "none" }) >-FAIL new RTCPeerConnection({ iceTransports: "invalid" }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ iceTransports: "none" }) Invalid RTCPeerConnection constructor arguments >+PASS new RTCPeerConnection({ iceTransports: "invalid" }) >+PASS new RTCPeerConnection({ iceTransports: "none" }) > PASS new RTCPeerConnection({ bundlePolicy: null }) >-FAIL new RTCPeerConnection({ bundlePolicy: undefined }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ bundlePolicy: "balanced" }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ bundlePolicy: "max-compat" }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ bundlePolicy: "max-bundle" }) Invalid RTCPeerConnection constructor arguments >+PASS new RTCPeerConnection({ bundlePolicy: undefined }) >+PASS new RTCPeerConnection({ bundlePolicy: "balanced" }) >+PASS new RTCPeerConnection({ bundlePolicy: "max-compat" }) >+PASS new RTCPeerConnection({ bundlePolicy: "max-bundle" }) > PASS new RTCPeerConnection({ bundlePolicy: "invalid" }) >-PASS new RTCPeerConnection({ rtcpMuxPolicy: null }) >-FAIL new RTCPeerConnection({ rtcpMuxPolicy: undefined }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ rtcpMuxPolicy: "negotiate" }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ rtcpMuxPolicy: "require" }) Invalid RTCPeerConnection constructor arguments >-PASS new RTCPeerConnection({ rtcpMuxPolicy: "invalid" }) >+FAIL new RTCPeerConnection({ rtcpMuxPolicy: null }) assert_throws: function "function () { >+ eval(expr); >+ }" did not throw >+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 > FAIL new RTCPeerConnection({ peerIdentity: toStringThrows }) assert_throws: function "function () { > eval(expr); >- }" threw object "TypeError: Invalid RTCPeerConnection constructor arguments" ("TypeError") expected object "Error" ("Error") >-PASS new RTCPeerConnection({ certificates: null }) >-FAIL new RTCPeerConnection({ certificates: undefined }) Invalid RTCPeerConnection constructor arguments >-FAIL new RTCPeerConnection({ certificates: [] }) Invalid RTCPeerConnection constructor arguments >-PASS new RTCPeerConnection({ certificates: [null] }) >-PASS new RTCPeerConnection({ certificates: [undefined] }) >-PASS new RTCPeerConnection({ iceCandidatePoolSize: toNumberThrows }) >+ }" did not throw >+FAIL new RTCPeerConnection({ certificates: null }) assert_throws: function "function () { >+ eval(expr); >+ }" did not throw >+PASS new RTCPeerConnection({ certificates: undefined }) >+PASS new RTCPeerConnection({ certificates: [] }) >+FAIL new RTCPeerConnection({ certificates: [null] }) assert_throws: function "function () { >+ eval(expr); >+ }" did not throw >+FAIL new RTCPeerConnection({ certificates: [undefined] }) assert_throws: function "function () { >+ eval(expr); >+ }" did not throw >+FAIL new RTCPeerConnection({ iceCandidatePoolSize: toNumberThrows }) assert_throws: function "function () { >+ eval(expr); >+ }" did not throw > FAIL new RTCPeerConnection({ certificates: [certificate] }) RTCPeerConnection.generateCertificate is not a function. (In 'RTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256" })', 'RTCPeerConnection.generateCertificate' is undefined) > FAIL new RTCPeerConnection({ certificates: [expiredCertificate] }) RTCPeerConnection.generateCertificate is not a function. (In 'RTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires: 0 })', 'RTCPeerConnection.generateCertificate' is undefined) > FAIL localDescription initial value Not enough arguments
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 165736
:
296833
|
296835
|
296840
|
296841
|
296842
|
296848
|
296859
|
296862
|
296869