summaryrefslogtreecommitdiffstats
path: root/media/webrtc/signaling/src/jsep/JsepTransport.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /media/webrtc/signaling/src/jsep/JsepTransport.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'media/webrtc/signaling/src/jsep/JsepTransport.h')
-rw-r--r--media/webrtc/signaling/src/jsep/JsepTransport.h116
1 files changed, 116 insertions, 0 deletions
diff --git a/media/webrtc/signaling/src/jsep/JsepTransport.h b/media/webrtc/signaling/src/jsep/JsepTransport.h
new file mode 100644
index 000000000..3b0d38ad6
--- /dev/null
+++ b/media/webrtc/signaling/src/jsep/JsepTransport.h
@@ -0,0 +1,116 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef _JSEPTRANSPORT_H_
+#define _JSEPTRANSPORT_H_
+
+#include <string>
+#include <vector>
+
+#include <mozilla/RefPtr.h>
+#include <mozilla/UniquePtr.h>
+#include "nsISupportsImpl.h"
+
+#include "signaling/src/sdp/SdpAttribute.h"
+
+namespace mozilla {
+
+class JsepDtlsTransport
+{
+public:
+ JsepDtlsTransport() : mRole(kJsepDtlsInvalidRole) {}
+
+ virtual ~JsepDtlsTransport() {}
+
+ enum Role {
+ kJsepDtlsClient,
+ kJsepDtlsServer,
+ kJsepDtlsInvalidRole
+ };
+
+ virtual const SdpFingerprintAttributeList&
+ GetFingerprints() const
+ {
+ return mFingerprints;
+ }
+
+ virtual Role
+ GetRole() const
+ {
+ return mRole;
+ }
+
+private:
+ friend class JsepSessionImpl;
+
+ SdpFingerprintAttributeList mFingerprints;
+ Role mRole;
+};
+
+class JsepIceTransport
+{
+public:
+ JsepIceTransport() {}
+
+ virtual ~JsepIceTransport() {}
+
+ const std::string&
+ GetUfrag() const
+ {
+ return mUfrag;
+ }
+ const std::string&
+ GetPassword() const
+ {
+ return mPwd;
+ }
+ const std::vector<std::string>&
+ GetCandidates() const
+ {
+ return mCandidates;
+ }
+
+private:
+ friend class JsepSessionImpl;
+
+ std::string mUfrag;
+ std::string mPwd;
+ std::vector<std::string> mCandidates;
+};
+
+class JsepTransport
+{
+public:
+ JsepTransport()
+ : mComponents(0)
+ {
+ }
+
+ void Close()
+ {
+ mComponents = 0;
+ mTransportId.clear();
+ mIce.reset();
+ mDtls.reset();
+ }
+
+ // Unique identifier for this transport within this call. Group?
+ std::string mTransportId;
+
+ // ICE stuff.
+ UniquePtr<JsepIceTransport> mIce;
+ UniquePtr<JsepDtlsTransport> mDtls;
+
+ // Number of required components.
+ size_t mComponents;
+
+ NS_INLINE_DECL_THREADSAFE_REFCOUNTING(JsepTransport);
+
+protected:
+ ~JsepTransport() {}
+};
+
+} // namespace mozilla
+
+#endif