summaryrefslogtreecommitdiff
path: root/Source/WebCore/Modules/mediastream/RTCIceCandidate.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/Modules/mediastream/RTCIceCandidate.h')
-rw-r--r--Source/WebCore/Modules/mediastream/RTCIceCandidate.h41
1 files changed, 18 insertions, 23 deletions
diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h
index 0dad25c27..2c665491d 100644
--- a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h
+++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h
@@ -28,43 +28,38 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RTCIceCandidate_h
-#define RTCIceCandidate_h
+#pragma once
-#if ENABLE(MEDIA_STREAM)
+#if ENABLE(WEB_RTC)
-#include "ExceptionBase.h"
+#include "ExceptionOr.h"
#include "ScriptWrappable.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
namespace WebCore {
-class Dictionary;
-class RTCIceCandidateDescriptor;
-
class RTCIceCandidate : public RefCounted<RTCIceCandidate>, public ScriptWrappable {
public:
- static PassRefPtr<RTCIceCandidate> create(const Dictionary&, ExceptionCode&);
- static PassRefPtr<RTCIceCandidate> create(PassRefPtr<RTCIceCandidateDescriptor>);
- virtual ~RTCIceCandidate();
+ struct Init {
+ String candidate;
+ String sdpMid;
+ std::optional<unsigned short> sdpMLineIndex;
+ };
- const String& candidate() const;
- const String& sdpMid() const;
- unsigned short sdpMLineIndex() const;
+ static ExceptionOr<Ref<RTCIceCandidate>> create(const Init&);
+ static Ref<RTCIceCandidate> create(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex);
- RTCIceCandidateDescriptor* descriptor();
+ const String& candidate() const { return m_candidate; }
+ const String& sdpMid() const { return m_sdpMid; }
+ std::optional<unsigned short> sdpMLineIndex() const { return m_sdpMLineIndex; }
private:
- explicit RTCIceCandidate(PassRefPtr<RTCIceCandidateDescriptor>);
+ RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex);
- RefPtr<RTCIceCandidateDescriptor> m_descriptor;
+ String m_candidate;
+ String m_sdpMid;
+ std::optional<unsigned short> m_sdpMLineIndex;
};
} // namespace WebCore
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // RTCIceCandidate_h
+#endif // ENABLE(WEB_RTC)