Replace string type with SdpType enum
This moves all WebRTC internal code from using
SessionDescriptionInterface::type() which returns a string and
from using CreateSessionDescription with a string type parameter.
Bug: webrtc:8613
Change-Id: I1cdd93dc4b26dec157e22476fdac569d5da2810a
Reviewed-on: https://webrtc-review.googlesource.com/29500
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21147}
diff --git a/pc/sdputils.cc b/pc/sdputils.cc
index 9bcbc43..de77d63 100644
--- a/pc/sdputils.cc
+++ b/pc/sdputils.cc
@@ -21,16 +21,16 @@
std::unique_ptr<SessionDescriptionInterface> CloneSessionDescription(
const SessionDescriptionInterface* sdesc) {
RTC_DCHECK(sdesc);
- return CloneSessionDescriptionAsType(sdesc, sdesc->type());
+ return CloneSessionDescriptionAsType(sdesc, sdesc->GetType());
}
std::unique_ptr<SessionDescriptionInterface> CloneSessionDescriptionAsType(
const SessionDescriptionInterface* sdesc,
- const std::string& type) {
+ SdpType type) {
RTC_DCHECK(sdesc);
auto clone = rtc::MakeUnique<JsepSessionDescription>(type);
clone->Initialize(sdesc->description()->Copy(), sdesc->session_id(),
- sdesc->session_version());
+ sdesc->session_version());
// As of writing, our version of GCC does not allow returning a unique_ptr of
// a subclass as a unique_ptr of a base class. To get around this, we need to
// std::move the return value.