Introduce webrtc::SdpType, the chosen enum for offer/pranswer/answer

This change introduces a new method |GetType()| in
SessionDescriptionInterface which returns an enum for the SDP type
rather than a string. Additionally, new overloads were added for
CreateSessionDescription to take SdpType instead of a type string.

Bug: webrtc:8613
Change-Id: I52b342f12155daf8d623646b0c21b7562f69d101
Reviewed-on: https://webrtc-review.googlesource.com/29380
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21100}
diff --git a/api/jsepsessiondescription.h b/api/jsepsessiondescription.h
index 6b115ee..70bb277 100644
--- a/api/jsepsessiondescription.h
+++ b/api/jsepsessiondescription.h
@@ -32,6 +32,8 @@
 // Implementation of SessionDescriptionInterface.
 class JsepSessionDescription : public SessionDescriptionInterface {
  public:
+  explicit JsepSessionDescription(SdpType type);
+  // TODO(steveanton): Remove this once callers have switched to SdpType.
   explicit JsepSessionDescription(const std::string& type);
   virtual ~JsepSessionDescription();
 
@@ -54,11 +56,9 @@
   virtual std::string session_version() const {
     return session_version_;
   }
-  virtual std::string type() const {
-    return type_;
-  }
+  virtual SdpType GetType() const { return type_; }
+  virtual std::string type() const { return SdpTypeToString(type_); }
   // Allows changing the type. Used for testing.
-  void set_type(const std::string& type) { type_ = type; }
   virtual bool AddCandidate(const IceCandidateInterface* candidate);
   virtual size_t RemoveCandidates(
       const std::vector<cricket::Candidate>& candidates);
@@ -74,7 +74,7 @@
   std::unique_ptr<cricket::SessionDescription> description_;
   std::string session_id_;
   std::string session_version_;
-  std::string type_;
+  SdpType type_;
   std::vector<JsepCandidateCollection> candidate_collection_;
 
   bool GetMediasectionIndex(const IceCandidateInterface* candidate,