Title: [282525] trunk
Revision
282525
Author
[email protected]
Date
2021-09-16 03:01:25 -0700 (Thu, 16 Sep 2021)

Log Message

Support RTCPeerConnection lastCreatedOffer/lastCreatedAnswer
https://bugs.webkit.org/show_bug.cgi?id=230260

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-parameterless.https-expected.txt:

Source/WebCore:

Update WebIDL to handle optional RTCLocalSessionDescriptionInit.type value.
In case type is missing, compute its value in setLocalDescription as per
https://w3c.github.io/webrtc-pc/#dom-peerconnection-setlocaldescription step 4.1.
If sdp is empty, use local offer/answer as per steps 4.2 and 4.3.
Store local offer and answer as per spec.
Refactor code to let PeerConnectionBackend createOffer and createAnswer take a callback instead of a promise
to store the last offer/answer.

Covered by existing and rebased tests.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOffer):
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswer):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::PeerConnectionBackend::stop):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCLocalSessionDescriptionInit.h: Added.
* Modules/mediastream/RTCLocalSessionDescriptionInit.idl: Added.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::createOffer):
(WebCore::RTCPeerConnection::createAnswer):
(WebCore::typeForSetLocalDescription):
(WebCore::RTCPeerConnection::setLocalDescription):
(WebCore::RTCPeerConnection::setRemoteDescription):
(WebCore::RTCPeerConnection::updateDescriptions):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (282524 => 282525)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-09-16 10:01:25 UTC (rev 282525)
@@ -1,3 +1,15 @@
+2021-09-16  Youenn Fablet  <[email protected]>
+
+        Support RTCPeerConnection lastCreatedOffer/lastCreatedAnswer
+        https://bugs.webkit.org/show_bug.cgi?id=230260
+
+        Reviewed by Eric Carlson.
+
+        * web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt:
+        * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt:
+        * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt:
+        * web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-parameterless.https-expected.txt:
+
 2021-09-15  Alex Christensen  <[email protected]>
 
         Add IDL skeleton for SharedWorker

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt (282524 => 282525)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-operations.https-expected.txt	2021-09-16 10:01:25 UTC (rev 282525)
@@ -1,6 +1,4 @@
 
-Harness Error (TIMEOUT), message = null
-
 PASS promiseState helper works
 PASS promiseStateFinal helper works
 PASS createOffer must detect InvalidStateError synchronously when chain is empty (prerequisite)
@@ -27,6 +25,6 @@
 PASS receiver.getStats does NOT use the operations chain
 FAIL addIceCandidate chains onto SRD, fails before assert_equals: expected "InvalidStateError" but got "OperationError"
 PASS Operations queue not vulnerable to recursion by chained negotiationneeded
-FAIL Pack operations queue with implicit offer and answer promise_test: Unhandled rejection with value: object "OperationError: Expect line: v="
-TIMEOUT Negotiate solely by operations queue and signaling state Test timed out
+PASS Pack operations queue with implicit offer and answer
+PASS Negotiate solely by operations queue and signaling state
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt (282524 => 282525)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-answer-expected.txt	2021-09-16 10:01:25 UTC (rev 282525)
@@ -1,9 +1,9 @@
 
 PASS setLocalDescription() with valid answer should succeed
-FAIL setLocalDescription() with type answer and null sdp should use lastAnswer generated from createAnswer promise_test: Unhandled rejection with value: object "OperationError: Expect line: v="
-FAIL setLocalDescription() with answer not created by own createAnswer() should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local answer sdp: Failed to apply the description for m= section with mid='0': Local fingerprint does not match identity. Expected: sha-256 B0:1B:43:87:8A:C5:01:AD:5C:15:79:5B:A1:94:42:53:14:F4:3D:2A:BA:37:D1:5B:45:9C:2F:F9:3E:9D:13:0B Got: sha-256 FB:6E:CE:7C:14:FE:C1:53:6A:95:EB:0E:9F:71:79:46:F1:67:42:90:97:CD:C1:41:5E:7E:C8:BB:C7:44:30:86" that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
+PASS setLocalDescription() with type answer and null sdp should use lastAnswer generated from createAnswer
+FAIL setLocalDescription() with answer not created by own createAnswer() should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local answer sdp: Failed to apply the description for m= section with mid='0': Local fingerprint does not match identity. Expected: sha-256 E0:10:A4:25:B7:9C:C3:34:17:6B:E8:00:18:CF:06:6A:EE:69:CD:73:98:19:59:50:B0:94:82:E7:5D:1D:8A:9A Got: sha-256 8A:BB:25:66:6B:B6:12:70:27:22:6E:E1:13:A4:5D:5D:50:A9:C0:26:8E:C9:7E:31:37:93:9B:5B:E1:23:2E:8B" that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
 FAIL Calling setLocalDescription(answer) from stable state should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "InvalidStateError: Failed to set local answer sdp: no pending remote description." that is not a DOMException InvalidModificationError: property "code" is equal to 11, expected 13
 FAIL Calling setLocalDescription(answer) from have-local-offer state should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "InvalidStateError: Failed to set local answer sdp: no pending remote description." that is not a DOMException InvalidModificationError: property "code" is equal to 11, expected 13
 PASS Setting previously generated answer after a call to createOffer should work
-FAIL setLocalDescription(answer) should update internal state with a queued task, in the right order assert_equals: pendingRemoteDescription should be updated before the signalingstatechange event expected null but got object "[object RTCSessionDescription]"
+PASS setLocalDescription(answer) should update internal state with a queued task, in the right order
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt (282524 => 282525)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-offer-expected.txt	2021-09-16 10:01:25 UTC (rev 282525)
@@ -1,10 +1,10 @@
 
 PASS setLocalDescription with valid offer should succeed
-FAIL setLocalDescription with type offer and null sdp should use lastOffer generated from createOffer promise_test: Unhandled rejection with value: object "OperationError: Expect line: v="
-FAIL setLocalDescription() with offer not created by own createOffer() should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local offer sdp: Failed to apply the description for m= section with mid='0': Local fingerprint does not match identity. Expected: sha-256 88:43:B2:95:49:DE:C2:A7:77:5E:EC:22:6F:D4:3E:B6:D4:FD:96:24:2B:77:6F:18:85:4B:F8:8A:BC:32:46:2F Got: sha-256 14:DC:27:7A:00:73:83:85:21:8B:2A:81:8F:F9:04:01:D3:31:54:68:7D:35:9C:6A:A2:F9:1D:0B:4C:8E:90:2D" that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
+PASS setLocalDescription with type offer and null sdp should use lastOffer generated from createOffer
+FAIL setLocalDescription() with offer not created by own createOffer() should reject with InvalidModificationError promise_rejects_dom: function "function () { throw e }" threw object "OperationError: Failed to set local offer sdp: Failed to apply the description for m= section with mid='0': Local fingerprint does not match identity. Expected: sha-256 2E:44:69:5B:86:09:8A:4E:50:8B:E8:D4:CF:C6:38:93:78:A2:D1:0E:91:37:A6:FA:41:6F:CD:9B:94:3D:22:FD Got: sha-256 62:F4:16:A1:2F:35:30:DA:D6:B8:94:CE:1E:5A:70:A0:36:7B:5B:80:05:B3:EE:6D:95:A3:8D:BD:42:38:41:79" that is not a DOMException InvalidModificationError: property "code" is equal to 0, expected 13
 FAIL Set created offer other than last offer should reject with InvalidModificationError assert_unreached: Should have rejected: undefined Reached unreachable code
 PASS Creating and setting offer multiple times should succeed
 PASS Setting previously generated offer after a call to createAnswer should work
 PASS Negotiation works when there has been a repeated setLocalDescription(offer)
-FAIL setLocalDescription(offer) should update internal state with a queued task, in the right order assert_not_equals: pendingLocalDescription should be updated before the signalingstatechange event got disallowed value null
+PASS setLocalDescription(offer) should update internal state with a queued task, in the right order
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-parameterless.https-expected.txt (282524 => 282525)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-parameterless.https-expected.txt	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-parameterless.https-expected.txt	2021-09-16 10:01:25 UTC (rev 282525)
@@ -5,8 +5,8 @@
 PASS Parameterless SLD() in 'have-remote-offer' goes to 'stable'
 PASS Parameterless SLD() in 'have-remote-offer' sets currentLocalDescription
 PASS Parameterless SLD() in 'have-remote-offer' sets transceiver.currentDirection
-FAIL Parameterless SLD() uses [[LastCreatedOffer]] if it is still valid assert_true: offerer.pendingLocalDescription.sdp == offer.sdp expected true got false
-FAIL Parameterless SLD() uses [[LastCreatedAnswer]] if it is still valid assert_true: answerer.currentLocalDescription.sdp == answer.sdp expected true got false
+PASS Parameterless SLD() uses [[LastCreatedOffer]] if it is still valid
+PASS Parameterless SLD() uses [[LastCreatedAnswer]] if it is still valid
 PASS Parameterless SLD() rejects with InvalidStateError if already closed
 PASS Parameterless SLD() never settles if closed while pending
 PASS Parameterless SLD() in a full O/A exchange succeeds

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback-expected.txt (282524 => 282525)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback-expected.txt	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setLocalDescription-rollback-expected.txt	2021-09-16 10:01:25 UTC (rev 282525)
@@ -3,5 +3,5 @@
 PASS setLocalDescription(rollback) from stable state should reject with InvalidStateError
 PASS setLocalDescription(rollback) after setting answer description should reject with InvalidStateError
 PASS setLocalDescription(rollback) should ignore invalid sdp content and succeed
-FAIL setLocalDescription(rollback) should update internal state with a queued tassk, in the right order assert_equals: pendingLocalDescription should be updated before the signalingstatechange event expected null but got object "[object RTCSessionDescription]"
+PASS setLocalDescription(rollback) should update internal state with a queued tassk, in the right order
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer-expected.txt (282524 => 282525)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer-expected.txt	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-offer-expected.txt	2021-09-16 10:01:25 UTC (rev 282525)
@@ -4,12 +4,12 @@
 PASS setRemoteDescription multiple times with different offer should succeed
 FAIL setRemoteDescription(offer) with invalid SDP should reject with RTCError assert_equals: Expect error detail field to set to sdp-syntax-error expected (string) "sdp-syntax-error" but got (undefined) undefined
 PASS setRemoteDescription(offer) from have-local-offer should roll back and succeed
-FAIL setRemoteDescription(offer) from have-local-offer fires signalingstatechange twice assert_equals: expected null but got object "[object RTCSessionDescription]"
-FAIL setRemoteDescription(offer) in stable should update internal state with a queued task, in the right order assert_not_equals: pendingRemoteDescription should be updated before the signalingstatechange event got disallowed value null
-FAIL setRemoteDescription(offer) in have-local-offer should update internal state with a queued task, in the right order assert_equals: pendingLocalDescription should be updated before the signalingstatechange event expected null but got object "[object RTCSessionDescription]"
+PASS setRemoteDescription(offer) from have-local-offer fires signalingstatechange twice
+PASS setRemoteDescription(offer) in stable should update internal state with a queued task, in the right order
+PASS setRemoteDescription(offer) in have-local-offer should update internal state with a queued task, in the right order
 FAIL Naive rollback approach is not glare-proof (control) assert_unreached: Should have rejected: undefined Reached unreachable code
 PASS setRemoteDescription(offer) from have-local-offer is glare-proof
-FAIL setRemoteDescription(invalidOffer) from have-local-offer does not undo rollback assert_equals: expected null but got object "[object RTCSessionDescription]"
+FAIL setRemoteDescription(invalidOffer) from have-local-offer does not undo rollback Test bug: unrecognized DOMException code name or name "RTCError" passed to assert_throws_dom()
 PASS repeated sRD(offer) works
 PASS sRD(reoffer) with candidates and without trickle works
 

Modified: trunk/Source/WebCore/CMakeLists.txt (282524 => 282525)


--- trunk/Source/WebCore/CMakeLists.txt	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/CMakeLists.txt	2021-09-16 10:01:25 UTC (rev 282525)
@@ -410,6 +410,7 @@
     Modules/mediastream/RTCIceTcpCandidateType.idl
     Modules/mediastream/RTCIceTransport.idl
     Modules/mediastream/RTCIceTransportState.idl
+    Modules/mediastream/RTCLocalSessionDescriptionInit.idl
     Modules/mediastream/RTCOfferAnswerOptions.idl
     Modules/mediastream/RTCOfferOptions.idl
     Modules/mediastream/RTCPeerConnection.idl

Modified: trunk/Source/WebCore/ChangeLog (282524 => 282525)


--- trunk/Source/WebCore/ChangeLog	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/ChangeLog	2021-09-16 10:01:25 UTC (rev 282525)
@@ -1,5 +1,49 @@
 2021-09-16  Youenn Fablet  <[email protected]>
 
+        Support RTCPeerConnection lastCreatedOffer/lastCreatedAnswer
+        https://bugs.webkit.org/show_bug.cgi?id=230260
+
+        Reviewed by Eric Carlson.
+
+        Update WebIDL to handle optional RTCLocalSessionDescriptionInit.type value.
+        In case type is missing, compute its value in setLocalDescription as per
+        https://w3c.github.io/webrtc-pc/#dom-peerconnection-setlocaldescription step 4.1.
+        If sdp is empty, use local offer/answer as per steps 4.2 and 4.3.
+        Store local offer and answer as per spec.
+        Refactor code to let PeerConnectionBackend createOffer and createAnswer take a callback instead of a promise
+        to store the last offer/answer.
+
+        Covered by existing and rebased tests.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        (WebCore::PeerConnectionBackend::createOffer):
+        (WebCore::PeerConnectionBackend::createOfferSucceeded):
+        (WebCore::PeerConnectionBackend::createOfferFailed):
+        (WebCore::PeerConnectionBackend::createAnswer):
+        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
+        (WebCore::PeerConnectionBackend::createAnswerFailed):
+        (WebCore::PeerConnectionBackend::stop):
+        * Modules/mediastream/PeerConnectionBackend.h:
+        * Modules/mediastream/RTCLocalSessionDescriptionInit.h: Added.
+        * Modules/mediastream/RTCLocalSessionDescriptionInit.idl: Added.
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::createOffer):
+        (WebCore::RTCPeerConnection::createAnswer):
+        (WebCore::typeForSetLocalDescription):
+        (WebCore::RTCPeerConnection::setLocalDescription):
+        (WebCore::RTCPeerConnection::setRemoteDescription):
+        (WebCore::RTCPeerConnection::updateDescriptions):
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/RTCPeerConnection.idl:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
+2021-09-16  Youenn Fablet  <[email protected]>
+
         Enable RTCRtpScriptTransform by default
         https://bugs.webkit.org/show_bug.cgi?id=230220
 

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (282524 => 282525)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2021-09-16 10:01:25 UTC (rev 282525)
@@ -242,6 +242,7 @@
 $(PROJECT_DIR)/Modules/mediastream/RTCIceTcpCandidateType.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCIceTransport.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCIceTransportState.idl
+$(PROJECT_DIR)/Modules/mediastream/RTCLocalSessionDescriptionInit.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCOfferAnswerOptions.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCOfferOptions.idl
 $(PROJECT_DIR)/Modules/mediastream/RTCPeerConnection.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (282524 => 282525)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2021-09-16 10:01:25 UTC (rev 282525)
@@ -1725,6 +1725,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCIceTransport.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCIceTransportState.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCIceTransportState.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCLocalSessionDescriptionInit.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCLocalSessionDescriptionInit.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCOfferAnswerOptions.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCOfferAnswerOptions.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSRTCOfferOptions.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (282524 => 282525)


--- trunk/Source/WebCore/DerivedSources.make	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/DerivedSources.make	2021-09-16 10:01:25 UTC (rev 282525)
@@ -268,6 +268,7 @@
     $(WebCore)/Modules/mediastream/RTCIceTcpCandidateType.idl \
     $(WebCore)/Modules/mediastream/RTCIceTransport.idl \
     $(WebCore)/Modules/mediastream/RTCIceTransportState.idl \
+    $(WebCore)/Modules/mediastream/RTCLocalSessionDescriptionInit.idl \
     $(WebCore)/Modules/mediastream/RTCOfferAnswerOptions.idl \
     $(WebCore)/Modules/mediastream/RTCOfferOptions.idl \
     $(WebCore)/Modules/mediastream/RTCPeerConnection.idl \

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp (282524 => 282525)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2021-09-16 10:01:25 UTC (rev 282525)
@@ -35,8 +35,6 @@
 #if ENABLE(WEB_RTC)
 
 #include "EventNames.h"
-#include "JSDOMPromiseDeferred.h"
-#include "JSRTCSessionDescriptionInit.h"
 #include "LibWebRTCCertificateGenerator.h"
 #include "Logging.h"
 #include "Page.h"
@@ -92,12 +90,12 @@
 
 PeerConnectionBackend::~PeerConnectionBackend() = default;
 
-void PeerConnectionBackend::createOffer(RTCOfferOptions&& options, PeerConnection::SessionDescriptionPromise&& promise)
+void PeerConnectionBackend::createOffer(RTCOfferOptions&& options, CreateCallback&& callback)
 {
-    ASSERT(!m_offerAnswerPromise);
+    ASSERT(!m_offerAnswerCallback);
     ASSERT(!m_peerConnection.isClosed());
 
-    m_offerAnswerPromise = WTF::makeUnique<PeerConnection::SessionDescriptionPromise>(WTFMove(promise));
+    m_offerAnswerCallback = WTFMove(callback);
     doCreateOffer(WTFMove(options));
 }
 
@@ -106,13 +104,10 @@
     ASSERT(isMainThread());
     ALWAYS_LOG(LOGIDENTIFIER, "Create offer succeeded:\n", sdp);
 
-    ASSERT(m_offerAnswerPromise);
+    ASSERT(m_offerAnswerCallback);
     validateSDP(sdp);
-    m_peerConnection.queueTaskKeepingObjectAlive(m_peerConnection, TaskSource::Networking, [this, promise = WTFMove(m_offerAnswerPromise), sdp = WTFMove(sdp)]() mutable {
-        if (m_peerConnection.isClosed())
-            return;
-
-        promise->resolve(RTCSessionDescriptionInit { RTCSdpType::Offer, sdp });
+    m_peerConnection.queueTaskKeepingObjectAlive(m_peerConnection, TaskSource::Networking, [callback = WTFMove(m_offerAnswerCallback), sdp = WTFMove(sdp)]() mutable {
+        callback(RTCSessionDescriptionInit { RTCSdpType::Offer, sdp });
     });
 }
 
@@ -121,21 +116,18 @@
     ASSERT(isMainThread());
     ALWAYS_LOG(LOGIDENTIFIER, "Create offer failed:", exception.message());
 
-    ASSERT(m_offerAnswerPromise);
-    m_peerConnection.queueTaskKeepingObjectAlive(m_peerConnection, TaskSource::Networking, [this, promise = WTFMove(m_offerAnswerPromise), exception = WTFMove(exception)]() mutable {
-        if (m_peerConnection.isClosed())
-            return;
-
-        promise->reject(WTFMove(exception));
+    ASSERT(m_offerAnswerCallback);
+    m_peerConnection.queueTaskKeepingObjectAlive(m_peerConnection, TaskSource::Networking, [callback = WTFMove(m_offerAnswerCallback), exception = WTFMove(exception)]() mutable {
+        callback(WTFMove(exception));
     });
 }
 
-void PeerConnectionBackend::createAnswer(RTCAnswerOptions&& options, PeerConnection::SessionDescriptionPromise&& promise)
+void PeerConnectionBackend::createAnswer(RTCAnswerOptions&& options, CreateCallback&& callback)
 {
-    ASSERT(!m_offerAnswerPromise);
+    ASSERT(!m_offerAnswerCallback);
     ASSERT(!m_peerConnection.isClosed());
 
-    m_offerAnswerPromise = WTF::makeUnique<PeerConnection::SessionDescriptionPromise>(WTFMove(promise));
+    m_offerAnswerCallback = WTFMove(callback);
     doCreateAnswer(WTFMove(options));
 }
 
@@ -144,12 +136,9 @@
     ASSERT(isMainThread());
     ALWAYS_LOG(LOGIDENTIFIER, "Create answer succeeded:\n", sdp);
 
-    ASSERT(m_offerAnswerPromise);
-    m_peerConnection.queueTaskKeepingObjectAlive(m_peerConnection, TaskSource::Networking, [this, promise = WTFMove(m_offerAnswerPromise), sdp = WTFMove(sdp)]() mutable {
-        if (m_peerConnection.isClosed())
-            return;
-
-        promise->resolve(RTCSessionDescriptionInit { RTCSdpType::Answer, sdp });
+    ASSERT(m_offerAnswerCallback);
+    m_peerConnection.queueTaskKeepingObjectAlive(m_peerConnection, TaskSource::Networking, [callback = WTFMove(m_offerAnswerCallback), sdp = WTFMove(sdp)]() mutable {
+        callback(RTCSessionDescriptionInit { RTCSdpType::Answer, sdp });
     });
 }
 
@@ -158,12 +147,9 @@
     ASSERT(isMainThread());
     ALWAYS_LOG(LOGIDENTIFIER, "Create answer failed:", exception.message());
 
-    ASSERT(m_offerAnswerPromise);
-    m_peerConnection.queueTaskKeepingObjectAlive(m_peerConnection, TaskSource::Networking, [this, promise = WTFMove(m_offerAnswerPromise), exception = WTFMove(exception)]() mutable {
-        if (m_peerConnection.isClosed())
-            return;
-
-        promise->reject(WTFMove(exception));
+    ASSERT(m_offerAnswerCallback);
+    m_peerConnection.queueTaskKeepingObjectAlive(m_peerConnection, TaskSource::Networking, [callback = WTFMove(m_offerAnswerCallback), exception = WTFMove(exception)]() mutable {
+        callback(WTFMove(exception));
     });
 }
 
@@ -407,7 +393,7 @@
 
 void PeerConnectionBackend::stop()
 {
-    m_offerAnswerPromise = nullptr;
+    m_offerAnswerCallback = nullptr;
     m_setDescriptionCallback = nullptr;
 
     m_pendingTrackEvents.clear();

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (282524 => 282525)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2021-09-16 10:01:25 UTC (rev 282525)
@@ -93,8 +93,9 @@
     explicit PeerConnectionBackend(RTCPeerConnection&);
     virtual ~PeerConnectionBackend();
 
-    void createOffer(RTCOfferOptions&&, PeerConnection::SessionDescriptionPromise&&);
-    void createAnswer(RTCAnswerOptions&&, PeerConnection::SessionDescriptionPromise&&);
+    using CreateCallback = Function<void(ExceptionOr<RTCSessionDescriptionInit>&&)>;
+    void createOffer(RTCOfferOptions&&, CreateCallback&&);
+    void createAnswer(RTCAnswerOptions&&, CreateCallback&&);
     void setLocalDescription(const RTCSessionDescription*, Function<void(ExceptionOr<void>&&)>&&);
     void setRemoteDescription(const RTCSessionDescription&, Function<void(ExceptionOr<void>&&)>&&);
     void addIceCandidate(RTCIceCandidate*, DOMPromiseDeferred<void>&&);
@@ -235,7 +236,7 @@
     RTCPeerConnection& m_peerConnection;
 
 private:
-    std::unique_ptr<PeerConnection::SessionDescriptionPromise> m_offerAnswerPromise;
+    CreateCallback m_offerAnswerCallback;
     Function<void(ExceptionOr<void>&&)> m_setDescriptionCallback;
 
     bool m_shouldFilterICECandidates { true };

Added: trunk/Source/WebCore/Modules/mediastream/RTCLocalSessionDescriptionInit.h (0 => 282525)


--- trunk/Source/WebCore/Modules/mediastream/RTCLocalSessionDescriptionInit.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCLocalSessionDescriptionInit.h	2021-09-16 10:01:25 UTC (rev 282525)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEB_RTC)
+
+#include "RTCSdpType.h"
+
+namespace WebCore {
+
+struct RTCLocalSessionDescriptionInit {
+    std::optional<RTCSdpType> type;
+    String sdp;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_RTC)

Added: trunk/Source/WebCore/Modules/mediastream/RTCLocalSessionDescriptionInit.idl (0 => 282525)


--- trunk/Source/WebCore/Modules/mediastream/RTCLocalSessionDescriptionInit.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCLocalSessionDescriptionInit.idl	2021-09-16 10:01:25 UTC (rev 282525)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=WEB_RTC
+] dictionary RTCLocalSessionDescriptionInit {
+    RTCSdpType type;
+    DOMString sdp = "";
+};

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (282524 => 282525)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp	2021-09-16 10:01:25 UTC (rev 282525)
@@ -42,6 +42,7 @@
 #include "Frame.h"
 #include "JSDOMPromiseDeferred.h"
 #include "JSRTCPeerConnection.h"
+#include "JSRTCSessionDescriptionInit.h"
 #include "Logging.h"
 #include "MediaEndpointConfiguration.h"
 #include "MediaStream.h"
@@ -212,7 +213,17 @@
             promise->reject(InvalidStateError);
             return;
         }
-        m_backend->createOffer(WTFMove(options), WTFMove(promise));
+        m_backend->createOffer(WTFMove(options), [this, protectedThis = makeRef(*this), promise = PeerConnection::SessionDescriptionPromise(WTFMove(promise))](auto&& result) mutable {
+            if (isClosed())
+                return;
+            if (result.hasException()) {
+                promise.reject(result.releaseException());
+                return;
+            }
+            // https://w3c.github.io/webrtc-pc/#dfn-final-steps-to-create-an-offer steps 4,5 and 6.
+            m_lastCreatedOffer = result.returnValue().sdp;
+            promise.resolve(result.releaseReturnValue());
+        });
     });
 }
 
@@ -229,66 +240,87 @@
             promise->reject(InvalidStateError);
             return;
         }
-        m_backend->createAnswer(WTFMove(options), WTFMove(promise));
+        m_backend->createAnswer(WTFMove(options), [this, protectedThis = makeRef(*this), promise = PeerConnection::SessionDescriptionPromise(WTFMove(promise))](auto&& result) mutable {
+            if (isClosed())
+                return;
+            if (result.hasException()) {
+                promise.reject(result.releaseException());
+                return;
+            }
+            // https://w3c.github.io/webrtc-pc/#dfn-final-steps-to-create-an-answer steps 4,5 and 6.
+            m_lastCreatedAnswer = result.returnValue().sdp;
+            promise.resolve(result.releaseReturnValue());
+        });
     });
 }
 
-void RTCPeerConnection::setLocalDescription(std::optional<Description>&& localDescription, Ref<DeferredPromise>&& promise)
+static RTCSdpType typeForSetLocalDescription(const std::optional<RTCLocalSessionDescriptionInit>& description, RTCSignalingState signalingState)
 {
+    std::optional<RTCSdpType> type;
+    if (description)
+        type = description->type;
+
+    // https://w3c.github.io/webrtc-pc/#dom-peerconnection-setlocaldescription step 4.1.
+    if (!type) {
+        bool shouldBeOffer = signalingState == RTCSignalingState::Stable || signalingState == RTCSignalingState::HaveLocalOffer || signalingState == RTCSignalingState::HaveRemotePranswer;
+        return shouldBeOffer ? RTCSdpType::Offer : RTCSdpType::Answer;
+    }
+    return *type;
+}
+
+void RTCPeerConnection::setLocalDescription(std::optional<RTCLocalSessionDescriptionInit>&& localDescription, Ref<DeferredPromise>&& promise)
+{
     if (isClosed()) {
         promise->reject(InvalidStateError);
         return;
     }
 
-    RefPtr<RTCSessionDescription> description;
-    if (localDescription) {
-        description = switchOn(*localDescription, [](RTCSessionDescriptionInit& init) -> RefPtr<RTCSessionDescription> {
-            return RTCSessionDescription::create(WTFMove(init));
-        }, [](RefPtr<RTCSessionDescription>& description) {
-            return WTFMove(description);
-        });
-    }
+    ALWAYS_LOG(LOGIDENTIFIER, "Setting local description to:\n", localDescription ? localDescription->sdp : "''");
+    chainOperation(WTFMove(promise), [this, localDescription = WTFMove(localDescription)](auto&& promise) mutable {
+        auto type = typeForSetLocalDescription(localDescription, m_signalingState);
+        String sdp;
+        if (localDescription)
+            sdp = localDescription->sdp;
+        if (type == RTCSdpType::Offer && sdp.isEmpty())
+            sdp = m_lastCreatedOffer;
+        else if (type == RTCSdpType::Answer && sdp.isEmpty())
+            sdp = m_lastCreatedAnswer;
 
-    ALWAYS_LOG(LOGIDENTIFIER, "Setting local description to:\n", description ? description->sdp() : "''");
-    chainOperation(WTFMove(promise), [this, description = WTFMove(description)](auto&& promise) mutable {
-        m_backend->setLocalDescription(description.get(), [promise = DOMPromiseDeferred<void>(WTFMove(promise))](auto&& result) mutable {
+        RefPtr<RTCSessionDescription> description;
+        if (!sdp.isEmpty() || (type != RTCSdpType::Offer && type != RTCSdpType::Answer))
+            description = RTCSessionDescription::create(type, WTFMove(sdp));
+        m_backend->setLocalDescription(description.get(), [protectedThis = makeRef(*this), promise = DOMPromiseDeferred<void>(WTFMove(promise))](auto&& result) mutable {
+            if (protectedThis->isClosed())
+                return;
             promise.settle(WTFMove(result));
         });
     });
 }
 
-void RTCPeerConnection::setRemoteDescription(Description&& remoteDescription, Ref<DeferredPromise>&& promise)
+void RTCPeerConnection::setRemoteDescription(RTCSessionDescriptionInit&& remoteDescription, Ref<DeferredPromise>&& promise)
 {
-    RefPtr<RTCSessionDescription> description;
-    description = switchOn(remoteDescription, [](RTCSessionDescriptionInit& init) -> RefPtr<RTCSessionDescription> {
-        return RTCSessionDescription::create(WTFMove(init));
-    }, [](RefPtr<RTCSessionDescription>& description) {
-        return WTFMove(description);
-    });
-    if (!description) {
-        promise->reject(TypeError);
-        return;
-    }
-
     if (isClosed()) {
         promise->reject(InvalidStateError);
         return;
     }
 
-    ALWAYS_LOG(LOGIDENTIFIER, "Setting remote description to:\n", description->sdp());
-    chainOperation(WTFMove(promise), [this, description = WTFMove(description)](auto&& promise) mutable {
+    ALWAYS_LOG(LOGIDENTIFIER, "Setting remote description to:\n", remoteDescription.sdp);
+    chainOperation(WTFMove(promise), [this, remoteDescription = WTFMove(remoteDescription)](auto&& promise) mutable {
+        auto description = RTCSessionDescription::create(WTFMove(remoteDescription));
         if (description->type() == RTCSdpType::Offer && m_signalingState != RTCSignalingState::Stable && m_signalingState != RTCSignalingState::HaveRemoteOffer) {
             auto rollbackDescription = RTCSessionDescription::create(RTCSdpType::Rollback, String { emptyString() });
             m_backend->setLocalDescription(rollbackDescription.ptr(), [this, protectedThis = makeRef(*this), description = WTFMove(description), promise = WTFMove(promise)](auto&&) mutable {
                 if (isClosed())
                     return;
-                m_backend->setRemoteDescription(*description, [promise = DOMPromiseDeferred<void>(WTFMove(promise))](auto&& result) mutable {
+                m_backend->setRemoteDescription(description.get(), [protectedThis = makeRef(*this), promise = DOMPromiseDeferred<void>(WTFMove(promise))](auto&& result) mutable {
+                    if (protectedThis->isClosed())
+                        return;
                     promise.settle(WTFMove(result));
                 });
             });
             return;
         }
-        m_backend->setRemoteDescription(*description, [promise = DOMPromiseDeferred<void>(WTFMove(promise))](auto&& result) mutable {
+        m_backend->setRemoteDescription(description.get(), [promise = DOMPromiseDeferred<void>(WTFMove(promise))](auto&& result) mutable {
             promise.settle(WTFMove(result));
         });
     });
@@ -926,13 +958,18 @@
 
 void RTCPeerConnection::updateDescriptions(PeerConnectionBackend::DescriptionStates&& states)
 {
-    if (states.signalingState)
-        setSignalingState(*states.signalingState);
-
     updateDescription(m_currentLocalDescription, states.currentLocalDescriptionSdpType, WTFMove(states.currentLocalDescriptionSdp));
     updateDescription(m_pendingLocalDescription, states.pendingLocalDescriptionSdpType, WTFMove(states.pendingLocalDescriptionSdp));
     updateDescription(m_currentRemoteDescription, states.currentRemoteDescriptionSdpType, WTFMove(states.currentRemoteDescriptionSdp));
     updateDescription(m_pendingRemoteDescription, states.pendingRemoteDescriptionSdpType, WTFMove(states.pendingRemoteDescriptionSdp));
+
+    if (states.signalingState)
+        setSignalingState(*states.signalingState);
+
+    if (!m_pendingRemoteDescription && !m_pendingLocalDescription) {
+        m_lastCreatedOffer = { };
+        m_lastCreatedAnswer = { };
+    }
 }
 
 void RTCPeerConnection::updateTransceiverTransports()

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (282524 => 282525)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2021-09-16 10:01:25 UTC (rev 282525)
@@ -44,9 +44,11 @@
 #include "RTCDataChannel.h"
 #include "RTCIceConnectionState.h"
 #include "RTCIceGatheringState.h"
+#include "RTCLocalSessionDescriptionInit.h"
 #include "RTCPeerConnectionState.h"
 #include "RTCRtpEncodingParameters.h"
 #include "RTCRtpTransceiver.h"
+#include "RTCSessionDescriptionInit.h"
 #include "RTCSignalingState.h"
 #include <_javascript_Core/Uint8Array.h>
 #include <wtf/LoggerHelper.h>
@@ -110,13 +112,12 @@
     void createOffer(RTCOfferOptions&&, Ref<DeferredPromise>&&);
     void createAnswer(RTCAnswerOptions&&, Ref<DeferredPromise>&&);
 
-    using Description = Variant<RTCSessionDescriptionInit, RefPtr<RTCSessionDescription>>;
-    void setLocalDescription(std::optional<Description>&&, Ref<DeferredPromise>&&);
+    void setLocalDescription(std::optional<RTCLocalSessionDescriptionInit>&&, Ref<DeferredPromise>&&);
     RefPtr<RTCSessionDescription> localDescription() const { return m_pendingLocalDescription ? m_pendingLocalDescription.get() : m_currentLocalDescription.get(); }
     RefPtr<RTCSessionDescription> currentLocalDescription() const { return m_currentLocalDescription.get(); }
     RefPtr<RTCSessionDescription> pendingLocalDescription() const { return m_pendingLocalDescription.get(); }
 
-    void setRemoteDescription(Description&&, Ref<DeferredPromise>&&);
+    void setRemoteDescription(RTCSessionDescriptionInit&&, Ref<DeferredPromise>&&);
     RTCSessionDescription* remoteDescription() const { return m_pendingRemoteDescription ? m_pendingRemoteDescription.get() : m_currentRemoteDescription.get(); }
     RTCSessionDescription* currentRemoteDescription() const { return m_currentRemoteDescription.get(); }
     RTCSessionDescription* pendingRemoteDescription() const { return m_pendingRemoteDescription.get(); }
@@ -276,6 +277,9 @@
     RefPtr<RTCSessionDescription> m_pendingLocalDescription;
     RefPtr<RTCSessionDescription> m_currentRemoteDescription;
     RefPtr<RTCSessionDescription> m_pendingRemoteDescription;
+
+    String m_lastCreatedOffer;
+    String m_lastCreatedAnswer;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl (282524 => 282525)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl	2021-09-16 10:01:25 UTC (rev 282525)
@@ -83,12 +83,12 @@
     Promise<RTCSessionDescriptionInit> createOffer(optional RTCOfferOptions offerOptions);
     Promise<RTCSessionDescriptionInit> createAnswer(optional RTCAnswerOptions answerOptions);
 
-    Promise<undefined> setLocalDescription(optional (RTCSessionDescriptionInit or RTCSessionDescription) description);
+    Promise<undefined> setLocalDescription(optional RTCLocalSessionDescriptionInit description);
     readonly attribute RTCSessionDescription? localDescription;
     readonly attribute RTCSessionDescription? currentLocalDescription;
     readonly attribute RTCSessionDescription? pendingLocalDescription;
 
-    Promise<undefined> setRemoteDescription((RTCSessionDescriptionInit or RTCSessionDescription) description);
+    Promise<undefined> setRemoteDescription(RTCSessionDescriptionInit description);
     readonly attribute RTCSessionDescription? remoteDescription;
     readonly attribute RTCSessionDescription? currentRemoteDescription;
     readonly attribute RTCSessionDescription? pendingRemoteDescription;

Modified: trunk/Source/WebCore/Sources.txt (282524 => 282525)


--- trunk/Source/WebCore/Sources.txt	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/Sources.txt	2021-09-16 10:01:25 UTC (rev 282525)
@@ -3354,6 +3354,7 @@
 JSRTCIceTcpCandidateType.cpp
 JSRTCIceTransport.cpp
 JSRTCIceTransportState.cpp
+JSRTCLocalSessionDescriptionInit.cpp
 JSRTCOfferAnswerOptions.cpp
 JSRTCOfferOptions.cpp
 JSRTCPeerConnection.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (282524 => 282525)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-09-16 10:00:31 UTC (rev 282524)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-09-16 10:01:25 UTC (rev 282525)
@@ -1063,6 +1063,7 @@
 		3FBC4AF4189881560046EE38 /* VideoFullscreenInterfaceAVKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBC4AF2189881560046EE38 /* VideoFullscreenInterfaceAVKit.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		3FF813A71DBA8640009BF001 /* PointerLockController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CFC434F192406A900A0D3B5 /* PointerLockController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		4107908C1FC3F0330061B27A /* ClientOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 4107908A1FC3E4F20061B27A /* ClientOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		410BCF5626F0CD8C0040B124 /* RTCLocalSessionDescriptionInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 410BCF5326F0CD8B0040B124 /* RTCLocalSessionDescriptionInit.h */; };
 		410E4461234373E9000173D4 /* LibWebRTCSocketIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 410E445F234373AD000173D4 /* LibWebRTCSocketIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		41100C8023F74583001BC33B /* WebSocketChannelInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 41100C7E23F73982001BC33B /* WebSocketChannelInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		41103AAC1E39791000769F03 /* RealtimeOutgoingAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41103AA81E39790A00769F03 /* RealtimeOutgoingAudioSource.h */; };
@@ -7801,6 +7802,8 @@
 		410A8EF924F8F47B004F9070 /* TextEncoderStreamEncoder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextEncoderStreamEncoder.h; sourceTree = "<group>"; };
 		410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageEventCustom.cpp; sourceTree = "<group>"; };
 		410BA1312570FE57002E2F8A /* LibWebRTCRtpTransformableFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibWebRTCRtpTransformableFrame.cpp; path = libwebrtc/LibWebRTCRtpTransformableFrame.cpp; sourceTree = "<group>"; };
+		410BCF5326F0CD8B0040B124 /* RTCLocalSessionDescriptionInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCLocalSessionDescriptionInit.h; sourceTree = "<group>"; };
+		410BCF5526F0CD8C0040B124 /* RTCLocalSessionDescriptionInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCLocalSessionDescriptionInit.idl; sourceTree = "<group>"; };
 		410E445F234373AD000173D4 /* LibWebRTCSocketIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCSocketIdentifier.h; path = libwebrtc/LibWebRTCSocketIdentifier.h; sourceTree = "<group>"; };
 		410F565524FCF70500A2E50C /* RTCSessionDescriptionInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCSessionDescriptionInit.idl; sourceTree = "<group>"; };
 		410F565724FCF7C700A2E50C /* RTCIceCandidateInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RTCIceCandidateInit.idl; sourceTree = "<group>"; };
@@ -17391,6 +17394,8 @@
 				316DCB891E7A6996001B5F87 /* RTCIceTransport.idl */,
 				414516E026CC042100AAABE0 /* RTCIceTransportBackend.h */,
 				316DCB8E1E7A6C79001B5F87 /* RTCIceTransportState.idl */,
+				410BCF5326F0CD8B0040B124 /* RTCLocalSessionDescriptionInit.h */,
+				410BCF5526F0CD8C0040B124 /* RTCLocalSessionDescriptionInit.idl */,
 				41C14BC426DE6DE800685BF5 /* RTCNetworkManager.h */,
 				073794DC19EE2C5200E5A045 /* RTCOfferAnswerOptions.h */,
 				316DCB121E78BE43001B5F87 /* RTCOfferAnswerOptions.idl */,
@@ -33127,6 +33132,7 @@
 				BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
 				652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
 				460CBF361D4BCD0E0092E88E /* JSDOMWindowProperties.h in Headers */,
+				410BCF5626F0CD8C0040B124 /* RTCLocalSessionDescriptionInit.h in Headers */,
 				65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */,
 				7C45C9D31E3FCBD700AAB558 /* JSDOMWrapperCache.h in Headers */,
 				93A8061E1E03B585008A1F26 /* JSDoubleRange.h in Headers */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to