[chromium] MediaStream API (JSEP): Introducing WebSessionDescription and WebIceCandidate
authortommyw@google.com <tommyw@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 17:55:04 +0000 (17:55 +0000)
committertommyw@google.com <tommyw@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 17:55:04 +0000 (17:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81339

Reviewed by Adam Barth.

Source/WebCore:

Not possible to test until the entire JSEP feature is commited.

* Modules/mediastream/IceCandidate.cpp:
(WebCore::IceCandidate::toSdp):
* Modules/mediastream/SessionDescription.cpp:
(WebCore::SessionDescription::toSdp):
* platform/mediastream/IceCandidateDescriptor.cpp:
(WebCore::IceCandidateDescriptor::toSDP):
* platform/mediastream/IceCandidateDescriptor.h:
(IceCandidateDescriptor):
* platform/mediastream/MediaStreamCenter.cpp:
(WebCore::MediaStreamCenter::constructSDP):
* platform/mediastream/MediaStreamCenter.h:
(MediaStreamCenter):
* platform/mediastream/SessionDescriptionDescriptor.cpp:
(WebCore::SessionDescriptionDescriptor::SessionDescriptionDescriptor):
(WebCore::SessionDescriptionDescriptor::toSDP):
(WebCore::SessionDescriptionDescriptor::initialSDP):
* platform/mediastream/SessionDescriptionDescriptor.h:
(SessionDescriptionDescriptor):

Source/WebKit/chromium:

Simple WebKit representations of the WebCore/platform versions.

* WebKit.gyp:
* public/platform/WebICECandidateDescriptor.h: Added.
(WebCore):
(WebKit):
(WebICECandidateDescriptor):
(WebKit::WebICECandidateDescriptor::WebICECandidateDescriptor):
(WebKit::WebICECandidateDescriptor::~WebICECandidateDescriptor):
(WebKit::WebICECandidateDescriptor::operator=):
(WebKit::WebICECandidateDescriptor::isNull):
* public/platform/WebSessionDescriptionDescriptor.h: Added.
(WebCore):
(WebKit):
(WebSessionDescriptionDescriptor):
(WebKit::WebSessionDescriptionDescriptor::WebSessionDescriptionDescriptor):
(WebKit::WebSessionDescriptionDescriptor::~WebSessionDescriptionDescriptor):
(WebKit::WebSessionDescriptionDescriptor::operator=):
(WebKit::WebSessionDescriptionDescriptor::isNull):
* src/WebICECandidateDescriptor.cpp: Added.
(WebKit):
(WebKit::WebICECandidateDescriptor::WebICECandidateDescriptor):
(WebKit::WebICECandidateDescriptor::assign):
(WebKit::WebICECandidateDescriptor::reset):
(WebKit::WebICECandidateDescriptor::initialize):
(WebKit::WebICECandidateDescriptor::operator PassRefPtr<WebCore::IceCandidateDescriptor>):
(WebKit::WebICECandidateDescriptor::label):
(WebKit::WebICECandidateDescriptor::candidateLine):
* src/WebSessionDescriptionDescriptor.cpp: Added.
(WebKit):
(WebKit::WebSessionDescriptionDescriptor::WebSessionDescriptionDescriptor):
(WebKit::WebSessionDescriptionDescriptor::assign):
(WebKit::WebSessionDescriptionDescriptor::reset):
(WebKit::WebSessionDescriptionDescriptor::operator WTF::PassRefPtr<WebCore::SessionDescriptionDescriptor>):
(WebKit::WebSessionDescriptionDescriptor::initialize):
(WebKit::WebSessionDescriptionDescriptor::numberOfAddedCandidates):
(WebKit::WebSessionDescriptionDescriptor::candidate):
(WebKit::WebSessionDescriptionDescriptor::initialSDP):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111577 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/IceCandidate.cpp
Source/WebCore/Modules/mediastream/SessionDescription.cpp
Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp
Source/WebCore/platform/mediastream/IceCandidateDescriptor.h
Source/WebCore/platform/mediastream/MediaStreamCenter.cpp
Source/WebCore/platform/mediastream/MediaStreamCenter.h
Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.cpp
Source/WebCore/platform/mediastream/SessionDescriptionDescriptor.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp
Source/WebKit/chromium/public/platform/WebICECandidateDescriptor.h [new file with mode: 0644]
Source/WebKit/chromium/public/platform/WebSessionDescriptionDescriptor.h [new file with mode: 0644]
Source/WebKit/chromium/src/WebICECandidateDescriptor.cpp [new file with mode: 0644]
Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp [new file with mode: 0644]

index dd4c1f7..a4c4e46 100644 (file)
@@ -1,3 +1,31 @@
+2012-03-21  Tommy Widenflycht  <tommyw@google.com>
+
+        [chromium] MediaStream API (JSEP): Introducing WebSessionDescription and WebIceCandidate
+        https://bugs.webkit.org/show_bug.cgi?id=81339
+
+        Reviewed by Adam Barth.
+
+        Not possible to test until the entire JSEP feature is commited.
+
+        * Modules/mediastream/IceCandidate.cpp:
+        (WebCore::IceCandidate::toSdp):
+        * Modules/mediastream/SessionDescription.cpp:
+        (WebCore::SessionDescription::toSdp):
+        * platform/mediastream/IceCandidateDescriptor.cpp:
+        (WebCore::IceCandidateDescriptor::toSDP):
+        * platform/mediastream/IceCandidateDescriptor.h:
+        (IceCandidateDescriptor):
+        * platform/mediastream/MediaStreamCenter.cpp:
+        (WebCore::MediaStreamCenter::constructSDP):
+        * platform/mediastream/MediaStreamCenter.h:
+        (MediaStreamCenter):
+        * platform/mediastream/SessionDescriptionDescriptor.cpp:
+        (WebCore::SessionDescriptionDescriptor::SessionDescriptionDescriptor):
+        (WebCore::SessionDescriptionDescriptor::toSDP):
+        (WebCore::SessionDescriptionDescriptor::initialSDP):
+        * platform/mediastream/SessionDescriptionDescriptor.h:
+        (SessionDescriptionDescriptor):
+
 2012-03-21  Yuta Kitamura  <yutak@chromium.org>
 
         Use RFC version of WebSocket protocol by default
index f0ce41e..cf9abcb 100644 (file)
@@ -69,7 +69,7 @@ const String& IceCandidate::candidateLine()
 
 String IceCandidate::toSdp()
 {
-    return m_descriptor->toSdp();
+    return m_descriptor->toSDP();
 }
 
 IceCandidateDescriptor* IceCandidate::descriptor()
index 67d22b6..188aece 100644 (file)
@@ -67,7 +67,7 @@ void SessionDescription::addCandidate(PassRefPtr<IceCandidate> candidate)
 
 String SessionDescription::toSdp()
 {
-    return m_descriptor->toSdp();
+    return m_descriptor->toSDP();
 }
 
 SessionDescriptionDescriptor* SessionDescription::descriptor()
index 332576f..d1f1c60 100644 (file)
@@ -53,9 +53,9 @@ IceCandidateDescriptor::~IceCandidateDescriptor()
 {
 }
 
-String IceCandidateDescriptor::toSdp()
+String IceCandidateDescriptor::toSDP()
 {
-    return MediaStreamCenter::instance().constructSdp(this);
+    return MediaStreamCenter::instance().constructSDP(this);
 }
 
 } // namespace WebCore
index b8bccf0..b775490 100644 (file)
@@ -47,7 +47,7 @@ public:
     const String& label() { return m_label; }
     const String& candidateLine() { return m_candidateLine; }
 
-    String toSdp();
+    String toSDP();
 
 private:
     IceCandidateDescriptor(const String& label, const String& candidateLine);
index 64e7f1d..21652ee 100644 (file)
@@ -58,12 +58,12 @@ void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescrip
         streamDescriptor->setEnded();
 }
 
-String MediaStreamCenter::constructSdp(IceCandidateDescriptor*)
+String MediaStreamCenter::constructSDP(IceCandidateDescriptor*)
 {
     return "";
 }
 
-String MediaStreamCenter::constructSdp(SessionDescriptionDescriptor*)
+String MediaStreamCenter::constructSDP(SessionDescriptionDescriptor*)
 {
     return "";
 }
index 6664e23..7ada3d1 100644 (file)
@@ -77,8 +77,8 @@ public:
     void didStopLocalMediaStream(MediaStreamDescriptor*);
     void didConstructMediaStream(MediaStreamDescriptor*);
 
-    String constructSdp(IceCandidateDescriptor*);
-    String constructSdp(SessionDescriptionDescriptor*);
+    String constructSDP(IceCandidateDescriptor*);
+    String constructSDP(SessionDescriptionDescriptor*);
 
     // Calls from the platform to update the DOM objects
     void endLocalMediaStream(MediaStreamDescriptor*);
index 0a4f379..48c6095 100644 (file)
@@ -45,7 +45,7 @@ PassRefPtr<SessionDescriptionDescriptor> SessionDescriptionDescriptor::create(co
 }
 
 SessionDescriptionDescriptor::SessionDescriptionDescriptor(const String& sdp)
-    : m_initialSdp(sdp)
+    : m_initialSDP(sdp)
 {
 }
 
@@ -58,9 +58,9 @@ void SessionDescriptionDescriptor::addCandidate(PassRefPtr<IceCandidateDescripto
     m_candidates.append(candidate);
 }
 
-String SessionDescriptionDescriptor::toSdp()
+String SessionDescriptionDescriptor::toSDP()
 {
-    return MediaStreamCenter::instance().constructSdp(this);
+    return MediaStreamCenter::instance().constructSDP(this);
 }
 
 size_t SessionDescriptionDescriptor::numberOfAddedCandidates() const
@@ -73,9 +73,9 @@ IceCandidateDescriptor* SessionDescriptionDescriptor::candidate(size_t index) co
     return m_candidates[index].get();
 }
 
-const String& SessionDescriptionDescriptor::initialSdp()
+const String& SessionDescriptionDescriptor::initialSDP()
 {
-    return m_initialSdp;
+    return m_initialSDP;
 }
 
 } // namespace WebCore
index 20f30a4..4512843 100644 (file)
@@ -47,16 +47,16 @@ public:
     virtual ~SessionDescriptionDescriptor();
 
     void addCandidate(PassRefPtr<IceCandidateDescriptor>);
-    String toSdp();
+    String toSDP();
 
     size_t numberOfAddedCandidates() const;
     IceCandidateDescriptor* candidate(size_t index) const;
-    const String& initialSdp();
+    const String& initialSDP();
 
 private:
     explicit SessionDescriptionDescriptor(const String& sdp);
 
-    String m_initialSdp;
+    String m_initialSDP;
     Vector<RefPtr<IceCandidateDescriptor> > m_candidates;
 };
 
index 34a961c..515c48a 100644 (file)
@@ -1,3 +1,49 @@
+2012-03-21  Tommy Widenflycht  <tommyw@google.com>
+
+        [chromium] MediaStream API (JSEP): Introducing WebSessionDescription and WebIceCandidate
+        https://bugs.webkit.org/show_bug.cgi?id=81339
+
+        Reviewed by Adam Barth.
+
+        Simple WebKit representations of the WebCore/platform versions.
+
+        * WebKit.gyp:
+        * public/platform/WebICECandidateDescriptor.h: Added.
+        (WebCore):
+        (WebKit):
+        (WebICECandidateDescriptor):
+        (WebKit::WebICECandidateDescriptor::WebICECandidateDescriptor):
+        (WebKit::WebICECandidateDescriptor::~WebICECandidateDescriptor):
+        (WebKit::WebICECandidateDescriptor::operator=):
+        (WebKit::WebICECandidateDescriptor::isNull):
+        * public/platform/WebSessionDescriptionDescriptor.h: Added.
+        (WebCore):
+        (WebKit):
+        (WebSessionDescriptionDescriptor):
+        (WebKit::WebSessionDescriptionDescriptor::WebSessionDescriptionDescriptor):
+        (WebKit::WebSessionDescriptionDescriptor::~WebSessionDescriptionDescriptor):
+        (WebKit::WebSessionDescriptionDescriptor::operator=):
+        (WebKit::WebSessionDescriptionDescriptor::isNull):
+        * src/WebICECandidateDescriptor.cpp: Added.
+        (WebKit):
+        (WebKit::WebICECandidateDescriptor::WebICECandidateDescriptor):
+        (WebKit::WebICECandidateDescriptor::assign):
+        (WebKit::WebICECandidateDescriptor::reset):
+        (WebKit::WebICECandidateDescriptor::initialize):
+        (WebKit::WebICECandidateDescriptor::operator PassRefPtr<WebCore::IceCandidateDescriptor>):
+        (WebKit::WebICECandidateDescriptor::label):
+        (WebKit::WebICECandidateDescriptor::candidateLine):
+        * src/WebSessionDescriptionDescriptor.cpp: Added.
+        (WebKit):
+        (WebKit::WebSessionDescriptionDescriptor::WebSessionDescriptionDescriptor):
+        (WebKit::WebSessionDescriptionDescriptor::assign):
+        (WebKit::WebSessionDescriptionDescriptor::reset):
+        (WebKit::WebSessionDescriptionDescriptor::operator WTF::PassRefPtr<WebCore::SessionDescriptionDescriptor>):
+        (WebKit::WebSessionDescriptionDescriptor::initialize):
+        (WebKit::WebSessionDescriptionDescriptor::numberOfAddedCandidates):
+        (WebKit::WebSessionDescriptionDescriptor::candidate):
+        (WebKit::WebSessionDescriptionDescriptor::initialSDP):
+
 2012-03-21  Sami Kyostila  <skyostil@chromium.org>
 
         [chromium] Use floating point scroll deltas for layers
index 9a5373d..b2cc298 100644 (file)
                 'public/WebGeolocationPosition.h',
                 'public/WebGlyphCache.h',
                 'public/WebHistoryItem.h',
+                'public/WebICECandidateDescriptor.h',
                 'public/WebICEOptions.h',
                 'public/WebIDBCallbacks.h',
                 'public/WebIDBCursor.h',
                 'public/WebSecurityOrigin.h',
                 'public/WebSecurityPolicy.h',
                 'public/WebSelectElement.h',
+                'public/WebSessionDescriptionDescriptor.h',
                 'public/WebSettings.h',
                 'public/WebSharedWorkerClient.h',
                 'public/WebSharedWorker.h',
                 'src/WebHistoryItem.cpp',
                 'src/WebHTTPBody.cpp',
                 'src/WebHTTPLoadInfo.cpp',
+                'src/WebICECandidateDescriptor.cpp',
                 'src/WebICEOptions.cpp',
                 'src/WebIconLoadingCompletionImpl.cpp',
                 'src/WebIconLoadingCompletionImpl.h',
                 'src/WebSecurityPolicy.cpp',
                 'src/WebSelectElement.cpp',
                 'src/WebSerializedScriptValue.cpp',
+                'src/WebSessionDescriptionDescriptor.cpp',
                 'src/WebSettingsImpl.cpp',
                 'src/WebSettingsImpl.h',
                 'src/WebSharedWorkerImpl.cpp',
diff --git a/Source/WebKit/chromium/public/platform/WebICECandidateDescriptor.h b/Source/WebKit/chromium/public/platform/WebICECandidateDescriptor.h
new file mode 100644 (file)
index 0000000..ba4867f
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * 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:
+ *
+ *     * 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.
+ */
+
+#ifndef WebICECandidateDescriptor_h
+#define WebICECandidateDescriptor_h
+
+#include "WebCommon.h"
+#include "WebPrivatePtr.h"
+
+namespace WebCore {
+class IceCandidateDescriptor;
+}
+
+namespace WebKit {
+
+class WebString;
+
+class WebICECandidateDescriptor {
+public:
+    WebICECandidateDescriptor() { }
+    WebICECandidateDescriptor(const WebICECandidateDescriptor& other) { assign(other); }
+    ~WebICECandidateDescriptor() { reset(); }
+
+    WebICECandidateDescriptor& operator=(const WebICECandidateDescriptor& other)
+    {
+        assign(other);
+        return *this;
+    }
+
+    WEBKIT_EXPORT void assign(const WebICECandidateDescriptor&);
+
+    WEBKIT_EXPORT void initialize(const WebString& label, const WebString& candidateLine);
+    WEBKIT_EXPORT void reset();
+    bool isNull() const { return m_private.isNull(); }
+
+    // The SDP m= line this candidate is associated with.
+    WEBKIT_EXPORT WebString label() const;
+
+    // The actual SDP candidate.
+    WEBKIT_EXPORT WebString candidateLine() const;
+
+#if WEBKIT_IMPLEMENTATION
+    WebICECandidateDescriptor(WebCore::IceCandidateDescriptor*);
+    WebICECandidateDescriptor(WTF::PassRefPtr<WebCore::IceCandidateDescriptor>);
+
+    operator WTF::PassRefPtr<WebCore::IceCandidateDescriptor>() const;
+#endif
+
+private:
+    WebPrivatePtr<WebCore::IceCandidateDescriptor> m_private;
+};
+
+} // namespace WebKit
+
+#endif // WebICECandidateDescriptor_h
diff --git a/Source/WebKit/chromium/public/platform/WebSessionDescriptionDescriptor.h b/Source/WebKit/chromium/public/platform/WebSessionDescriptionDescriptor.h
new file mode 100644 (file)
index 0000000..2bee453
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * 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:
+ *
+ *     * 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.
+ */
+
+#ifndef WebSessionDescriptionDescriptor_h
+#define WebSessionDescriptionDescriptor_h
+
+#include "WebCommon.h"
+#include "WebNonCopyable.h"
+#include "WebPrivatePtr.h"
+
+namespace WebCore {
+class SessionDescriptionDescriptor;
+}
+
+namespace WebKit {
+class WebString;
+class WebICECandidateDescriptor;
+
+/*
+ *  In order to establish the media plane, PeerConnection needs specific
+ *  parameters to indicate what to transmit to the remote side, as well
+ *  as how to handle the media that is received. These parameters are
+ *  determined by the exchange of session descriptions in offers and
+ *  answers, and there are certain details to this process that must be
+ *  handled in the JSEP APIs.
+
+ *  Whether a session description was sent or received affects the
+ *  meaning of that description. For example, the list of codecs sent to
+ *  a remote party indicates what the local side is willing to decode,
+ *  and what the remote party should send.
+ */
+class WebSessionDescriptionDescriptor {
+public:
+    WebSessionDescriptionDescriptor() { }
+    WebSessionDescriptionDescriptor(const WebSessionDescriptionDescriptor& other) { assign(other); }
+    ~WebSessionDescriptionDescriptor() { reset(); }
+
+    WebSessionDescriptionDescriptor& operator=(const WebSessionDescriptionDescriptor& other)
+    {
+        assign(other);
+        return *this;
+    }
+
+    WEBKIT_EXPORT void assign(const WebSessionDescriptionDescriptor&);
+
+    WEBKIT_EXPORT void initialize(const WebString& sdp);
+    WEBKIT_EXPORT void reset();
+    bool isNull() const { return m_private.isNull(); }
+
+    WEBKIT_EXPORT size_t numberOfAddedCandidates() const;
+    WEBKIT_EXPORT WebICECandidateDescriptor candidate(size_t index) const;
+    WEBKIT_EXPORT WebString initialSDP() const;
+
+#if WEBKIT_IMPLEMENTATION
+    WebSessionDescriptionDescriptor(const WTF::PassRefPtr<WebCore::SessionDescriptionDescriptor>&);
+
+    operator WTF::PassRefPtr<WebCore::SessionDescriptionDescriptor>();
+#endif
+
+private:
+    WebPrivatePtr<WebCore::SessionDescriptionDescriptor> m_private;
+};
+
+} // namespace WebKit
+
+#endif // WebSessionDescriptionDescriptor_h
diff --git a/Source/WebKit/chromium/src/WebICECandidateDescriptor.cpp b/Source/WebKit/chromium/src/WebICECandidateDescriptor.cpp
new file mode 100644 (file)
index 0000000..598f809
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * 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:
+ *
+ *     * 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(MEDIA_STREAM)
+
+#include "platform/WebICECandidateDescriptor.h"
+
+#include "IceCandidateDescriptor.h"
+#include "platform/WebString.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebICECandidateDescriptor::WebICECandidateDescriptor(IceCandidateDescriptor* iceCandidate)
+    : m_private(iceCandidate)
+{
+}
+
+WebICECandidateDescriptor::WebICECandidateDescriptor(PassRefPtr<IceCandidateDescriptor> iceCandidate)
+    : m_private(iceCandidate)
+{
+}
+
+void WebICECandidateDescriptor::assign(const WebICECandidateDescriptor& other)
+{
+    m_private = other.m_private;
+}
+
+void WebICECandidateDescriptor::reset()
+{
+    m_private.reset();
+}
+
+void WebICECandidateDescriptor::initialize(const WebString& label, const WebString& candidateLine)
+{
+    m_private = IceCandidateDescriptor::create(label, candidateLine);
+}
+
+WebICECandidateDescriptor::operator PassRefPtr<WebCore::IceCandidateDescriptor>() const
+{
+    return m_private.get();
+}
+
+WebString WebICECandidateDescriptor::label() const
+{
+    ASSERT(!m_private.isNull());
+    return m_private.get()->label();
+}
+
+WebString WebICECandidateDescriptor::candidateLine() const
+{
+    ASSERT(!m_private.isNull());
+    return m_private.get()->candidateLine();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(MEDIA_STREAM)
+
diff --git a/Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp b/Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp
new file mode 100644 (file)
index 0000000..e8f96e5
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * 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:
+ *
+ *     * 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(MEDIA_STREAM)
+
+#include "platform/WebSessionDescriptionDescriptor.h"
+
+#include "SessionDescriptionDescriptor.h"
+#include "platform/WebICECandidateDescriptor.h"
+#include "platform/WebString.h"
+#include <wtf/Vector.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebSessionDescriptionDescriptor::WebSessionDescriptionDescriptor(const PassRefPtr<SessionDescriptionDescriptor>& sessionDescription)
+    : m_private(sessionDescription)
+{
+}
+
+void WebSessionDescriptionDescriptor::assign(const WebSessionDescriptionDescriptor& other)
+{
+    m_private = other.m_private;
+}
+
+void WebSessionDescriptionDescriptor::reset()
+{
+    m_private.reset();
+}
+
+WebSessionDescriptionDescriptor::operator WTF::PassRefPtr<WebCore::SessionDescriptionDescriptor>()
+{
+    return m_private.get();
+}
+
+void WebSessionDescriptionDescriptor::initialize(const WebString& sdp)
+{
+    m_private = SessionDescriptionDescriptor::create(sdp);
+}
+
+size_t WebSessionDescriptionDescriptor::numberOfAddedCandidates() const
+{
+    ASSERT(!m_private.isNull());
+    return m_private.get()->numberOfAddedCandidates();
+}
+
+WebICECandidateDescriptor WebSessionDescriptionDescriptor::candidate(size_t index) const
+{
+    ASSERT(!m_private.isNull());
+    return m_private.get()->candidate(index);
+}
+
+WebString WebSessionDescriptionDescriptor::initialSDP() const
+{
+    ASSERT(!m_private.isNull());
+    return m_private.get()->initialSDP();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(MEDIA_STREAM)
+