Title: [126333] trunk
Revision
126333
Author
[email protected]
Date
2012-08-22 12:30:08 -0700 (Wed, 22 Aug 2012)

Log Message

MediaStream API: Introduce RTCSessionDescription
https://bugs.webkit.org/show_bug.cgi?id=93119

Reviewed by Adam Barth.

Source/WebCore:

This patch introduces RTCSessionDescription together with its
corresponding WebCore/platform representation.

Test: fast/mediastream/RTCSessionDescription.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/mediastream/DOMWindowMediaStream.idl:
* Modules/mediastream/RTCSessionDescription.cpp: Added.
(WebCore):
(WebCore::RTCSessionDescription::create):
(WebCore::RTCSessionDescription::RTCSessionDescription):
(WebCore::RTCSessionDescription::~RTCSessionDescription):
(WebCore::RTCSessionDescription::type):
(WebCore::RTCSessionDescription::setType):
(WebCore::RTCSessionDescription::sdp):
(WebCore::RTCSessionDescription::setSdp):
(WebCore::RTCSessionDescription::descriptor):
* Modules/mediastream/RTCSessionDescription.h: Added.
(WebCore):
(RTCSessionDescription):
* Modules/mediastream/RTCSessionDescription.idl: Added.
* WebCore.gypi:
* platform/mediastream/RTCSessionDescriptionDescriptor.cpp: Added.
(WebCore):
(WebCore::RTCSessionDescriptionDescriptor::create):
(WebCore::RTCSessionDescriptionDescriptor::RTCSessionDescriptionDescriptor):
(WebCore::RTCSessionDescriptionDescriptor::~RTCSessionDescriptionDescriptor):
* platform/mediastream/RTCSessionDescriptionDescriptor.h: Added.
(WebCore):
(RTCSessionDescriptionDescriptor):
(WebCore::RTCSessionDescriptionDescriptor::type):
(WebCore::RTCSessionDescriptionDescriptor::setType):
(WebCore::RTCSessionDescriptionDescriptor::sdp):
(WebCore::RTCSessionDescriptionDescriptor::setSdp):

LayoutTests:

* fast/mediastream/RTCSessionDescription-expected.txt: Added.
* fast/mediastream/RTCSessionDescription.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (126332 => 126333)


--- trunk/LayoutTests/ChangeLog	2012-08-22 19:27:51 UTC (rev 126332)
+++ trunk/LayoutTests/ChangeLog	2012-08-22 19:30:08 UTC (rev 126333)
@@ -1,3 +1,13 @@
+2012-08-22  Tommy Widenflycht  <[email protected]>
+
+        MediaStream API: Introduce RTCSessionDescription
+        https://bugs.webkit.org/show_bug.cgi?id=93119
+
+        Reviewed by Adam Barth.
+
+        * fast/mediastream/RTCSessionDescription-expected.txt: Added.
+        * fast/mediastream/RTCSessionDescription.html: Added.
+
 2012-08-22  Victor Carbune  <[email protected]>
 
         DOM manipulation crashes the browser

Added: trunk/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt (0 => 126333)


--- trunk/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt	2012-08-22 19:30:08 UTC (rev 126333)
@@ -0,0 +1,23 @@
+Tests RTCSessionDescription.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS sessionDescription = new RTCSessionDescription(initializer); did not throw exception.
+PASS sessionDescription.type is "offer"
+PASS sessionDescription.sdp is "foobar"
+PASS sessionDescription = new RTCSessionDescription(initializer); did not throw exception.
+PASS sessionDescription.type is "offer"
+PASS sessionDescription.sdp is "foobar"
+PASS new RTCSessionDescription({}); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS new RTCSessionDescription(5); threw exception TypeError: Not an object..
+PASS new RTCSessionDescription('foobar'); threw exception TypeError: Not an object..
+PASS new RTCSessionDescription({type:'foobar', sdp:'x'}); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS new RTCSessionDescription({type:'offer', sdp:''}); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS new RTCSessionDescription({type:'offer', sdp:'x'}); did not throw exception.
+PASS new RTCSessionDescription({type:'answer', sdp:'x'}); did not throw exception.
+PASS new RTCSessionDescription({type:'pranswer', sdp:'x'}); did not throw exception.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/mediastream/RTCSessionDescription.html (0 => 126333)


--- trunk/LayoutTests/fast/mediastream/RTCSessionDescription.html	                        (rev 0)
+++ trunk/LayoutTests/fast/mediastream/RTCSessionDescription.html	2012-08-22 19:30:08 UTC (rev 126333)
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("Tests RTCSessionDescription.");
+
+var initializer = {type:"offer", sdp:"foobar"};
+var sessionDescription;
+shouldNotThrow("sessionDescription = new RTCSessionDescription(initializer);");
+shouldBe('sessionDescription.type', '"offer"');
+shouldBe('sessionDescription.sdp', '"foobar"');
+
+initializer = JSON.parse(JSON.stringify(sessionDescription));
+shouldNotThrow("sessionDescription = new RTCSessionDescription(initializer);");
+shouldBe('sessionDescription.type', '"offer"');
+shouldBe('sessionDescription.sdp', '"foobar"');
+
+shouldThrow("new RTCSessionDescription({});");
+shouldThrow("new RTCSessionDescription(5);");
+shouldThrow("new RTCSessionDescription('foobar');");
+shouldThrow("new RTCSessionDescription({type:'foobar', sdp:'x'});");
+shouldThrow("new RTCSessionDescription({type:'offer', sdp:''});");
+
+shouldNotThrow("new RTCSessionDescription({type:'offer', sdp:'x'});");
+shouldNotThrow("new RTCSessionDescription({type:'answer', sdp:'x'});");
+shouldNotThrow("new RTCSessionDescription({type:'pranswer', sdp:'x'});");
+
+window.successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/CMakeLists.txt (126332 => 126333)


--- trunk/Source/WebCore/CMakeLists.txt	2012-08-22 19:27:51 UTC (rev 126332)
+++ trunk/Source/WebCore/CMakeLists.txt	2012-08-22 19:30:08 UTC (rev 126333)
@@ -224,6 +224,7 @@
     Modules/mediastream/PeerConnection00.idl
     Modules/mediastream/RTCIceCandidate.idl
     Modules/mediastream/RTCPeerConnection.idl
+    Modules/mediastream/RTCSessionDescription.idl
     Modules/mediastream/SessionDescription.idl
 
     Modules/networkinfo/NavigatorNetworkInfoConnection.idl
@@ -853,6 +854,7 @@
     Modules/mediastream/PeerConnection00.cpp
     Modules/mediastream/RTCIceCandidate.cpp
     Modules/mediastream/RTCPeerConnection.cpp
+    Modules/mediastream/RTCSessionDescription.cpp
     Modules/mediastream/SessionDescription.cpp
     Modules/mediastream/UserMediaController.cpp
     Modules/mediastream/UserMediaRequest.cpp
@@ -1926,6 +1928,7 @@
     platform/mediastream/PeerConnection00Handler.cpp
     platform/mediastream/RTCIceCandidateDescriptor.cpp
     platform/mediastream/RTCPeerConnectionHandler.cpp
+    platform/mediastream/RTCSessionDescriptionDescriptor.cpp
     platform/mediastream/SessionDescriptionDescriptor.cpp
 
     platform/mock/DeviceMotionClientMock.cpp

Modified: trunk/Source/WebCore/ChangeLog (126332 => 126333)


--- trunk/Source/WebCore/ChangeLog	2012-08-22 19:27:51 UTC (rev 126332)
+++ trunk/Source/WebCore/ChangeLog	2012-08-22 19:30:08 UTC (rev 126333)
@@ -1,3 +1,46 @@
+2012-08-22  Tommy Widenflycht  <[email protected]>
+
+        MediaStream API: Introduce RTCSessionDescription
+        https://bugs.webkit.org/show_bug.cgi?id=93119
+
+        Reviewed by Adam Barth.
+
+        This patch introduces RTCSessionDescription together with its
+        corresponding WebCore/platform representation.
+
+        Test: fast/mediastream/RTCSessionDescription.html
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Modules/mediastream/DOMWindowMediaStream.idl:
+        * Modules/mediastream/RTCSessionDescription.cpp: Added.
+        (WebCore):
+        (WebCore::RTCSessionDescription::create):
+        (WebCore::RTCSessionDescription::RTCSessionDescription):
+        (WebCore::RTCSessionDescription::~RTCSessionDescription):
+        (WebCore::RTCSessionDescription::type):
+        (WebCore::RTCSessionDescription::setType):
+        (WebCore::RTCSessionDescription::sdp):
+        (WebCore::RTCSessionDescription::setSdp):
+        (WebCore::RTCSessionDescription::descriptor):
+        * Modules/mediastream/RTCSessionDescription.h: Added.
+        (WebCore):
+        (RTCSessionDescription):
+        * Modules/mediastream/RTCSessionDescription.idl: Added.
+        * WebCore.gypi:
+        * platform/mediastream/RTCSessionDescriptionDescriptor.cpp: Added.
+        (WebCore):
+        (WebCore::RTCSessionDescriptionDescriptor::create):
+        (WebCore::RTCSessionDescriptionDescriptor::RTCSessionDescriptionDescriptor):
+        (WebCore::RTCSessionDescriptionDescriptor::~RTCSessionDescriptionDescriptor):
+        * platform/mediastream/RTCSessionDescriptionDescriptor.h: Added.
+        (WebCore):
+        (RTCSessionDescriptionDescriptor):
+        (WebCore::RTCSessionDescriptionDescriptor::type):
+        (WebCore::RTCSessionDescriptionDescriptor::setType):
+        (WebCore::RTCSessionDescriptionDescriptor::sdp):
+        (WebCore::RTCSessionDescriptionDescriptor::setSdp):
+
 2012-08-22  Victor Carbune  <[email protected]>
 
         DOM manipulation crashes the browser

Modified: trunk/Source/WebCore/GNUmakefile.list.am (126332 => 126333)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-08-22 19:27:51 UTC (rev 126332)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-08-22 19:30:08 UTC (rev 126333)
@@ -628,6 +628,8 @@
 	DerivedSources/WebCore/JSRTCIceCandidate.h \
 	DerivedSources/WebCore/JSRTCPeerConnection.cpp \
 	DerivedSources/WebCore/JSRTCPeerConnection.h \
+	DerivedSources/WebCore/JSRTCSessionDescription.cpp \
+	DerivedSources/WebCore/JSRTCSessionDescription.h \
 	DerivedSources/WebCore/JSScreen.cpp \
 	DerivedSources/WebCore/JSScreen.h \
 	DerivedSources/WebCore/JSScriptProfile.cpp \
@@ -1218,6 +1220,7 @@
 	$(WebCore)/Modules/mediastream/PeerConnection00.idl \
 	$(WebCore)/Modules/mediastream/RTCIceCandidate.idl \
 	$(WebCore)/Modules/mediastream/RTCPeerConnection.idl \
+	$(WebCore)/Modules/mediastream/RTCSessionDescription.idl \
 	$(WebCore)/Modules/mediastream/SessionDescription.idl \
 	$(WebCore)/Modules/notifications/Notification.idl \
 	$(WebCore)/Modules/notifications/NotificationCenter.idl \
@@ -1906,6 +1909,8 @@
 	Source/WebCore/Modules/mediastream/RTCIceCandidate.h \
 	Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp \
 	Source/WebCore/Modules/mediastream/RTCPeerConnection.h \
+	Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp \
+	Source/WebCore/Modules/mediastream/RTCSessionDescription.h \
 	Source/WebCore/Modules/mediastream/SessionDescription.cpp \
 	Source/WebCore/Modules/mediastream/SessionDescription.h \
 	Source/WebCore/Modules/mediastream/UserMediaClient.h \
@@ -5492,6 +5497,8 @@
 	Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.cpp \
 	Source/WebCore/platform/mediastream/RTCPeerConnectionHandler.h \
 	Source/WebCore/platform/mediastream/RTCPeerConnectionHandlerClient.h \
+	Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.cpp \
+	Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h \
 	Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.cpp \
 	Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h \
 	Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp \

Modified: trunk/Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl (126332 => 126333)


--- trunk/Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl	2012-08-22 19:27:51 UTC (rev 126332)
+++ trunk/Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl	2012-08-22 19:30:08 UTC (rev 126333)
@@ -34,6 +34,7 @@
         attribute [V8EnabledAtRuntime] PeerConnection00Constructor webkitPeerConnection00;
         attribute [V8EnabledAtRuntime] RTCPeerConnectionConstructor webkitRTCPeerConnection;
         attribute SessionDescriptionConstructor SessionDescription;
+        attribute RTCSessionDescriptionConstructor RTCSessionDescription;
         attribute IceCandidateConstructor IceCandidate;
         attribute RTCIceCandidateConstructor RTCIceCandidate;
         attribute MediaStreamEventConstructor MediaStreamEvent;

Added: trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp (0 => 126333)


--- trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp	2012-08-22 19:30:08 UTC (rev 126333)
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2012 Google 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.
+ * 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.
+ */
+
+#include "config.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "RTCSessionDescription.h"
+
+#include "Dictionary.h"
+#include "ExceptionCode.h"
+#include "RTCSessionDescriptionDescriptor.h"
+
+namespace WebCore {
+
+static bool verifyType(const String& type)
+{
+    return type == "offer" || type == "pranswer" || type == "answer";
+}
+
+PassRefPtr<RTCSessionDescription> RTCSessionDescription::create(const Dictionary& dictionary, ExceptionCode& ec)
+{
+    String type;
+    bool ok = dictionary.get("type", type);
+    if (!ok || !verifyType(type)) {
+        ec = TYPE_MISMATCH_ERR;
+        return 0;
+    }
+
+    String sdp;
+    ok = dictionary.get("sdp", sdp);
+    if (!ok || !sdp.length()) {
+        ec = TYPE_MISMATCH_ERR;
+        return 0;
+    }
+
+    return adoptRef(new RTCSessionDescription(RTCSessionDescriptionDescriptor::create(type, sdp)));
+}
+
+PassRefPtr<RTCSessionDescription> RTCSessionDescription::create(PassRefPtr<RTCSessionDescriptionDescriptor> descriptor)
+{
+    ASSERT(descriptor);
+    return adoptRef(new RTCSessionDescription(descriptor));
+}
+
+RTCSessionDescription::RTCSessionDescription(PassRefPtr<RTCSessionDescriptionDescriptor> descriptor)
+    : m_descriptor(descriptor)
+{
+}
+
+RTCSessionDescription::~RTCSessionDescription()
+{
+}
+
+const String& RTCSessionDescription::type()
+{
+    return m_descriptor->type();
+}
+
+void RTCSessionDescription::setType(const String& type, ExceptionCode& ec)
+{
+    if (verifyType(type))
+        m_descriptor->setType(type);
+    else
+        ec = TYPE_MISMATCH_ERR;
+}
+
+const String& RTCSessionDescription::sdp()
+{
+    return m_descriptor->sdp();
+}
+
+void RTCSessionDescription::setSdp(const String& sdp, ExceptionCode& ec)
+{
+    m_descriptor->setSdp(sdp);
+}
+
+RTCSessionDescriptionDescriptor* RTCSessionDescription::descriptor()
+{
+    return m_descriptor.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)

Added: trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h (0 => 126333)


--- trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h	2012-08-22 19:30:08 UTC (rev 126333)
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2012 Google 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.
+ * 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 RTCSessionDescription_h
+#define RTCSessionDescription_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "ExceptionBase.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class Dictionary;
+class RTCSessionDescriptionDescriptor;
+
+class RTCSessionDescription : public RefCounted<RTCSessionDescription> {
+public:
+    static PassRefPtr<RTCSessionDescription> create(const Dictionary&, ExceptionCode&);
+    static PassRefPtr<RTCSessionDescription> create(PassRefPtr<RTCSessionDescriptionDescriptor>);
+    virtual ~RTCSessionDescription();
+
+    const String& type();
+    void setType(const String&, ExceptionCode&);
+
+    const String& sdp();
+    void setSdp(const String&, ExceptionCode&);
+
+    RTCSessionDescriptionDescriptor* descriptor();
+
+private:
+    explicit RTCSessionDescription(PassRefPtr<RTCSessionDescriptionDescriptor>);
+
+    RefPtr<RTCSessionDescriptionDescriptor> m_descriptor;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // RTCSessionDescription_h

Added: trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl (0 => 126333)


--- trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl	2012-08-22 19:30:08 UTC (rev 126333)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2012 Google 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.
+ * 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.
+ */
+
+module mediastream {
+
+    interface [
+        Conditional=MEDIA_STREAM,
+        Constructor(in Dictionary dictionary),
+        ConstructorRaisesException
+    ] RTCSessionDescription {
+        attribute DOMString type
+            setter raises(DOMException);
+        attribute DOMString sdp
+            setter raises(DOMException);
+    };
+
+}

Modified: trunk/Source/WebCore/WebCore.gypi (126332 => 126333)


--- trunk/Source/WebCore/WebCore.gypi	2012-08-22 19:27:51 UTC (rev 126332)
+++ trunk/Source/WebCore/WebCore.gypi	2012-08-22 19:30:08 UTC (rev 126333)
@@ -459,6 +459,8 @@
             'platform/mediastream/RTCIceCandidateDescriptor.h',
             'platform/mediastream/RTCPeerConnectionHandler.h',
             'platform/mediastream/RTCPeerConnectionHandlerClient.h',
+            'platform/mediastream/RTCSessionDescriptionDescriptor.cpp',
+            'platform/mediastream/RTCSessionDescriptionDescriptor.h',
             'platform/mediastream/SessionDescriptionDescriptor.cpp',
             'platform/mediastream/SessionDescriptionDescriptor.h',
             'platform/mediastream/chromium/MediaStreamCenterChromium.cpp',
@@ -858,6 +860,7 @@
             'Modules/mediastream/PeerConnection00.idl',
             'Modules/mediastream/RTCIceCandidate.idl',
             'Modules/mediastream/RTCPeerConnection.idl',
+            'Modules/mediastream/RTCSessionDescription.idl',
             'Modules/mediastream/SessionDescription.idl',
             'Modules/notifications/DOMWindowNotifications.idl',
             'Modules/notifications/Notification.idl',
@@ -1597,6 +1600,8 @@
             'Modules/mediastream/RTCIceCandidate.h',
             'Modules/mediastream/RTCPeerConnection.cpp',
             'Modules/mediastream/RTCPeerConnection.h',
+            'Modules/mediastream/RTCSessionDescription.cpp',
+            'Modules/mediastream/RTCSessionDescription.h',
             'Modules/mediastream/SessionDescription.cpp',
             'Modules/mediastream/SessionDescription.h',
             'Modules/mediastream/UserMediaClient.h',

Added: trunk/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.cpp (0 => 126333)


--- trunk/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.cpp	2012-08-22 19:30:08 UTC (rev 126333)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 Google 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.
+ * 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.
+ */
+
+#include "config.h"
+
+#if ENABLE(MEDIA_STREAM)
+
+#include "RTCSessionDescriptionDescriptor.h"
+
+namespace WebCore {
+
+PassRefPtr<RTCSessionDescriptionDescriptor> RTCSessionDescriptionDescriptor::create(const String& type, const String& sdp)
+{
+    return adoptRef(new RTCSessionDescriptionDescriptor(type, sdp));
+}
+
+RTCSessionDescriptionDescriptor::RTCSessionDescriptionDescriptor(const String& type, const String& sdp)
+    : m_type(type)
+    , m_sdp(sdp)
+{
+}
+
+RTCSessionDescriptionDescriptor::~RTCSessionDescriptionDescriptor()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)

Added: trunk/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h (0 => 126333)


--- trunk/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/RTCSessionDescriptionDescriptor.h	2012-08-22 19:30:08 UTC (rev 126333)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2012 Google 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.
+ * 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 RTCSessionDescriptionDescriptor_h
+#define RTCSessionDescriptionDescriptor_h
+
+#if ENABLE(MEDIA_STREAM)
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class RTCSessionDescriptionDescriptor : public RefCounted<RTCSessionDescriptionDescriptor> {
+public:
+    static PassRefPtr<RTCSessionDescriptionDescriptor> create(const String& type, const String& sdp);
+    virtual ~RTCSessionDescriptionDescriptor();
+
+    const String& type() { return m_type; }
+    void setType(const String& type) { m_type = type; }
+
+    const String& sdp() { return m_sdp; }
+    void setSdp(const String& sdp) { m_sdp = sdp; }
+
+private:
+    RTCSessionDescriptionDescriptor(const String& type, const String& sdp);
+
+    String m_type;
+    String m_sdp;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(MEDIA_STREAM)
+
+#endif // RTCSessionDescriptionDescriptor_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to