summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp
diff options
context:
space:
mode:
authorpilgrim@chromium.org <pilgrim@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2013-10-25 19:02:00 +0000
committerpilgrim@chromium.org <pilgrim@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538>2013-10-25 19:02:00 +0000
commitf163bc3ba167c32a246ce3df5ec50ad366fb44a3 (patch)
treeb4131702818f9fb104dcdbe2942d9f1b1d35f1fd /third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp
parent203260b4836688980d6351f3bd0194a8eb24911c (diff)
downloadchromium_src-f163bc3ba167c32a246ce3df5ec50ad366fb44a3.zip
chromium_src-f163bc3ba167c32a246ce3df5ec50ad366fb44a3.tar.gz
chromium_src-f163bc3ba167c32a246ce3df5ec50ad366fb44a3.tar.bz2
Move WebRTCICECandidate to platform/
BUG=297477 Review URL: https://codereview.chromium.org/44253004 git-svn-id: svn://svn.chromium.org/blink/trunk@160607 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp')
-rw-r--r--third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp99
1 files changed, 99 insertions, 0 deletions
diff --git a/third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp b/third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp
new file mode 100644
index 0000000..a92d12c
--- /dev/null
+++ b/third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp
@@ -0,0 +1,99 @@
+/*
+ * 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"
+#include "public/platform/WebRTCICECandidate.h"
+
+#include "public/platform/WebString.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+
+namespace WebKit {
+
+class WebRTCICECandidatePrivate : public RefCounted<WebRTCICECandidatePrivate> {
+public:
+ static PassRefPtr<WebRTCICECandidatePrivate> create(const WebString& candidate, const WebString& sdpMid, unsigned short sdpMLineIndex)
+ {
+ return adoptRef(new WebRTCICECandidatePrivate(candidate, sdpMid, sdpMLineIndex));
+ }
+
+ const WebString& candidate() const { return m_candidate; }
+ const WebString& sdpMid() const { return m_sdpMid; }
+ unsigned short sdpMLineIndex() const { return m_sdpMLineIndex; }
+
+private:
+ WebRTCICECandidatePrivate(const WebString& candidate, const WebString& sdpMid, unsigned short sdpMLineIndex);
+
+ WebString m_candidate;
+ WebString m_sdpMid;
+ unsigned short m_sdpMLineIndex;
+};
+
+WebRTCICECandidatePrivate::WebRTCICECandidatePrivate(const WebString& candidate, const WebString& sdpMid, unsigned short sdpMLineIndex)
+ : m_candidate(candidate)
+ , m_sdpMid(sdpMid)
+ , m_sdpMLineIndex(sdpMLineIndex)
+{
+}
+
+void WebRTCICECandidate::assign(const WebRTCICECandidate& other)
+{
+ m_private = other.m_private;
+}
+
+void WebRTCICECandidate::reset()
+{
+ m_private.reset();
+}
+
+void WebRTCICECandidate::initialize(const WebString& candidate, const WebString& sdpMid, unsigned short sdpMLineIndex)
+{
+ m_private = WebRTCICECandidatePrivate::create(candidate, sdpMid, sdpMLineIndex);
+}
+
+WebString WebRTCICECandidate::candidate() const
+{
+ ASSERT(!m_private.isNull());
+ return m_private->candidate();
+}
+
+WebString WebRTCICECandidate::sdpMid() const
+{
+ ASSERT(!m_private.isNull());
+ return m_private->sdpMid();
+}
+
+unsigned short WebRTCICECandidate::sdpMLineIndex() const
+{
+ ASSERT(!m_private.isNull());
+ return m_private->sdpMLineIndex();
+}
+
+} // namespace WebKit