make MediaType extracted enum class
authorNico Grunbaum
Wed, 27 Jun 2018 14:23:46 -0700
changeset 1550405 05404cc5766a61c4f8899855460390d50ceb3bc2
parent 1549717 9c7bb8874337c2d40aef3d9945b10490a5115188
child 1550406 c512f545de5bee78e826a5fce4e093504543e820
push id281101
push userna-g@nostrum.com
push dateWed, 27 Jun 2018 21:24:24 +0000
treeherdertry@c512f545de5b [default view] [failures only]
milestone63.0a1
make MediaType extracted enum class
media/webrtc/signaling/gtest/jsep_session_unittest.cpp
media/webrtc/signaling/gtest/jsep_track_unittest.cpp
media/webrtc/signaling/gtest/sdp_unittests.cpp
media/webrtc/signaling/src/jsep/JsepCodecDescription.h
media/webrtc/signaling/src/jsep/JsepSession.h
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
media/webrtc/signaling/src/jsep/JsepSessionImpl.h
media/webrtc/signaling/src/jsep/JsepTrack.cpp
media/webrtc/signaling/src/jsep/JsepTrack.h
media/webrtc/signaling/src/jsep/JsepTransceiver.h
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
media/webrtc/signaling/src/sdp/RsdparsaSdp.cpp
media/webrtc/signaling/src/sdp/RsdparsaSdp.h
media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.cpp
media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.h
media/webrtc/signaling/src/sdp/Sdp.h
media/webrtc/signaling/src/sdp/SdpEnum.h
media/webrtc/signaling/src/sdp/SdpHelper.cpp
media/webrtc/signaling/src/sdp/SdpHelper.h
media/webrtc/signaling/src/sdp/SdpMediaSection.h
media/webrtc/signaling/src/sdp/SipccSdp.cpp
media/webrtc/signaling/src/sdp/SipccSdp.h
media/webrtc/signaling/src/sdp/SipccSdpMediaSection.cpp
media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h
media/webrtc/signaling/test/signaling_unittests.cpp
package-lock.json
--- a/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
+++ b/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
@@ -234,36 +234,36 @@ protected:
     // Add tracks.
     if (types.empty()) {
       types = BuildTypes(GetParam());
     }
     AddTracks(side, types, magic);
 
     // Now, we move datachannel to the end
     auto it = std::find(types.begin(), types.end(),
-                        SdpMediaSection::kApplication);
+                        sdp::MediaType::kApplication);
     if (it != types.end()) {
       types.erase(it);
-      types.push_back(SdpMediaSection::kApplication);
+      types.push_back(sdp::MediaType::kApplication);
     }
   }
 
   void
   AddTracks(JsepSessionImpl& side,
             const std::string& mediatypes,
             AddTrackMagic magic = ADDTRACK_MAGIC)
   {
     AddTracks(side, BuildTypes(mediatypes), magic);
   }
 
   JsepTrack
   RemoveTrack(JsepSession& side, size_t index) {
     if (side.GetTransceivers().size() <= index) {
       EXPECT_TRUE(false) << "Index " << index << " out of bounds!";
-      return JsepTrack(SdpMediaSection::kAudio, sdp::kSend);
+      return JsepTrack(sdp::MediaType::kAudio, sdp::kSend);
     }
 
     RefPtr<JsepTransceiver>& transceiver(side.GetTransceivers()[index]);
     JsepTrack& track = transceiver->mSendTrack;
     EXPECT_FALSE(track.GetTrackId().empty()) << "No track at index " << index;
 
     JsepTrack original(track);
     track.ClearTrackIds();
@@ -276,47 +276,47 @@ protected:
                size_t index,
                SdpDirectionAttribute::Direction direction) {
     ASSERT_LT(index, side.GetTransceivers().size())
       << "Index " << index << " out of bounds!";
 
     side.GetTransceivers()[index]->mJsDirection = direction;
   }
 
-  std::vector<SdpMediaSection::MediaType>
+  std::vector<sdp::MediaType>
   BuildTypes(const std::string& mediatypes)
   {
-    std::vector<SdpMediaSection::MediaType> result;
+    std::vector<sdp::MediaType> result;
     size_t ptr = 0;
 
     for (;;) {
       size_t comma = mediatypes.find(',', ptr);
       std::string chunk = mediatypes.substr(ptr, comma - ptr);
 
       if (chunk == "audio") {
-        result.push_back(SdpMediaSection::kAudio);
+        result.push_back(sdp::MediaType::kAudio);
       } else if (chunk == "video") {
-        result.push_back(SdpMediaSection::kVideo);
+        result.push_back(sdp::MediaType::kVideo);
       } else if (chunk == "datachannel") {
-        result.push_back(SdpMediaSection::kApplication);
+        result.push_back(sdp::MediaType::kApplication);
       } else {
         MOZ_CRASH();
       }
 
       if (comma == std::string::npos)
         break;
       ptr = comma + 1;
     }
 
     return result;
   }
 
   void
   AddTracks(JsepSessionImpl& side,
-            const std::vector<SdpMediaSection::MediaType>& mediatypes,
+            const std::vector<sdp::MediaType>& mediatypes,
             AddTrackMagic magic = ADDTRACK_MAGIC)
   {
     FakeUuidGenerator uuid_gen;
     std::string stream_id;
     std::string track_id;
 
     ASSERT_TRUE(uuid_gen.Generate(&stream_id));
 
@@ -332,23 +332,23 @@ protected:
     AddTracksToStream(side, stream_id, BuildTypes(mediatypes), magic);
   }
 
   // A bit of a hack. JsepSessionImpl populates the track-id automatically, just
   // in case, because the w3c spec requires msid to be set even when there's no
   // send track.
   bool IsNull(const JsepTrack& track) const {
     return track.GetStreamIds().empty() &&
-           (track.GetMediaType() != SdpMediaSection::MediaType::kApplication);
+           (track.GetMediaType() != sdp::MediaType::kApplication);
   }
 
   void
   AddTracksToStream(JsepSessionImpl& side,
                     const std::string stream_id,
-                    const std::vector<SdpMediaSection::MediaType>& mediatypes,
+                    const std::vector<sdp::MediaType>& mediatypes,
                     AddTrackMagic magic = ADDTRACK_MAGIC)
 
   {
     FakeUuidGenerator uuid_gen;
     std::string track_id;
 
     for (auto type : mediatypes) {
       ASSERT_TRUE(uuid_gen.Generate(&track_id));
@@ -357,17 +357,17 @@ protected:
       size_t i = transceivers.size();
       if (magic == ADDTRACK_MAGIC) {
         for (i = 0; i < transceivers.size(); ++i) {
           if (transceivers[i]->mSendTrack.GetMediaType() != type) {
             continue;
           }
 
           if (IsNull(transceivers[i]->mSendTrack) ||
-              transceivers[i]->GetMediaType() == SdpMediaSection::kApplication) {
+              transceivers[i]->GetMediaType() == sdp::MediaType::kApplication) {
             break;
           }
         }
       }
 
       if (i == transceivers.size()) {
         side.AddTransceiver(new JsepTransceiver(type));
         MOZ_ASSERT(i < transceivers.size());
@@ -381,17 +381,17 @@ protected:
         SdpDirectionAttribute::Direction::kSendonly;
       transceivers[i]->mSendTrack.UpdateTrackIds(
           std::vector<std::string>(1, stream_id), track_id);
     }
   }
 
   bool HasMediaStream(const std::vector<JsepTrack>& tracks) const {
     for (const auto& track : tracks) {
-      if (track.GetMediaType() != SdpMediaSection::kApplication) {
+      if (track.GetMediaType() != sdp::MediaType::kApplication) {
         return true;
       }
     }
     return false;
   }
 
   const std::string GetFirstLocalStreamId(JsepSessionImpl& side) const {
     auto tracks = GetLocalTracks(side);
@@ -419,17 +419,17 @@ protected:
     }
     return result;
   }
 
   JsepTransceiver*
   GetDatachannelTransceiver(JsepSession& side) {
     for (const auto& transceiver : side.GetTransceivers()) {
       if (transceiver->mSendTrack.GetMediaType() ==
-            SdpMediaSection::MediaType::kApplication) {
+            sdp::MediaType::kApplication) {
         return transceiver.get();
       }
     }
 
     return nullptr;
   }
 
   JsepTransceiver*
@@ -467,17 +467,17 @@ protected:
     return GetTransceiverByLevel(side.GetTransceivers(), level);
   }
 
   std::vector<std::string>
   GetMediaStreamIds(const std::vector<JsepTrack>& tracks) const {
     std::vector<std::string> ids;
     for (const auto& track : tracks) {
       // data channels don't have msid's
-      if (track.GetMediaType() == SdpMediaSection::kApplication) {
+      if (track.GetMediaType() == sdp::MediaType::kApplication) {
         continue;
       }
       ids.insert(ids.end(),
                  track.GetStreamIds().begin(),
                  track.GetStreamIds().end());
     }
     return ids;
   }
@@ -506,17 +506,17 @@ protected:
   }
 
   std::vector<std::string>
   GetRemoteUniqueStreamIds(JsepSessionImpl& side) const {
     return sortUniqueStrVector(GetRemoteMediaStreamIds(side));
   }
 
   JsepTrack GetTrack(JsepSessionImpl& side,
-                     SdpMediaSection::MediaType type,
+                     sdp::MediaType type,
                      size_t index) const {
     for (const auto& transceiver : side.GetTransceivers()) {
       if (IsNull(transceiver->mSendTrack) ||
           transceiver->mSendTrack.GetMediaType() != type) {
         continue;
       }
 
       if (index != 0) {
@@ -525,21 +525,21 @@ protected:
       }
 
       return transceiver->mSendTrack;
     }
 
     return JsepTrack(type, sdp::kSend);
   }
 
-  JsepTrack GetTrackOff(size_t index, SdpMediaSection::MediaType type) {
+  JsepTrack GetTrackOff(size_t index, sdp::MediaType type) {
     return GetTrack(*mSessionOff, type, index);
   }
 
-  JsepTrack GetTrackAns(size_t index, SdpMediaSection::MediaType type) {
+  JsepTrack GetTrackAns(size_t index, sdp::MediaType type) {
     return GetTrack(*mSessionAns, type, index);
   }
 
   bool Equals(const SdpFingerprintAttributeList::Fingerprint& f1,
               const SdpFingerprintAttributeList::Fingerprint& f2) const {
     if (f1.hashFunc != f2.hashFunc) {
       return false;
     }
@@ -727,32 +727,32 @@ protected:
         return false;
       }
     }
 
     return true;
   }
 
   size_t GetTrackCount(JsepSessionImpl& side,
-                       SdpMediaSection::MediaType type) const {
+                       sdp::MediaType type) const {
     size_t result = 0;
     for (const auto& track : GetLocalTracks(side)) {
       if (track.GetMediaType() == type) {
         ++result;
       }
     }
     return result;
   }
 
   UniquePtr<Sdp> GetParsedLocalDescription(const JsepSessionImpl& side) const {
     return Parse(side.GetLocalDescription(kJsepDescriptionCurrent));
   }
 
   SdpMediaSection* GetMsection(Sdp& sdp,
-                               SdpMediaSection::MediaType type,
+                               sdp::MediaType type,
                                size_t index) const {
     for (size_t i = 0; i < sdp.GetMediaSectionCount(); ++i) {
       auto& msection = sdp.GetMediaSection(i);
       if (msection.GetMediaType() != type) {
         continue;
       }
 
       if (index) {
@@ -786,17 +786,17 @@ protected:
     for (auto* codec : session.Codecs()) {
       if (codec->mName == codecName) {
         codec->mEnabled = enabled;
       }
     }
   }
 
   void
-  EnsureNegotiationFailure(SdpMediaSection::MediaType type,
+  EnsureNegotiationFailure(sdp::MediaType type,
                            const std::string& codecName)
   {
     for (auto* codec : mSessionOff->Codecs()) {
       if (codec->mType == type && codec->mName != codecName) {
         codec->mEnabled = false;
       }
     }
 
@@ -872,27 +872,27 @@ protected:
       for (const auto& transceiver : mSessionOff->GetTransceivers()) {
         if (!transceiver->HasLevel()) {
           continue;
         }
         const auto& track(transceiver->mSendTrack);
         size_t level = transceiver->GetLevel();
         ASSERT_FALSE(IsNull(track));
         ASSERT_EQ(types[level], track.GetMediaType());
-        if (track.GetMediaType() != SdpMediaSection::kApplication) {
+        if (track.GetMediaType() != sdp::MediaType::kApplication) {
           std::string msidAttr("a=msid:");
           msidAttr += track.GetStreamIds()[0];
           msidAttr += " ";
           msidAttr += track.GetTrackId();
           ASSERT_NE(std::string::npos, offer.find(msidAttr))
             << "Did not find " << msidAttr << " in offer";
         }
       }
       if (types.size() == 1 &&
-          types[0] == SdpMediaSection::kApplication) {
+          types[0] == sdp::MediaType::kApplication) {
         ASSERT_EQ(std::string::npos, offer.find("a=ssrc"))
           << "Data channel should not contain SSRC";
       }
     }
   }
 
   void
   SetRemoteOffer(const std::string& offer, uint32_t checkFlags = ALL_CHECKS)
@@ -915,17 +915,17 @@ protected:
       for (const auto& transceiver : mSessionAns->GetTransceivers()) {
         if (!transceiver->HasLevel()) {
           continue;
         }
         const auto& track(transceiver->mRecvTrack);
         size_t level = transceiver->GetLevel();
         ASSERT_FALSE(IsNull(track));
         ASSERT_EQ(types[level], track.GetMediaType());
-        if (track.GetMediaType() != SdpMediaSection::kApplication) {
+        if (track.GetMediaType() != sdp::MediaType::kApplication) {
           std::string msidAttr("a=msid:");
           msidAttr += track.GetStreamIds()[0];
           msidAttr += " ";
           msidAttr += track.GetTrackId();
           ASSERT_NE(std::string::npos, offer.find(msidAttr))
             << "Did not find " << msidAttr << " in offer";
         }
       }
@@ -958,27 +958,27 @@ protected:
         size_t level = transceiver->GetLevel();
         ASSERT_FALSE(IsNull(sendTrack));
         ASSERT_EQ(types[level], sendTrack.GetMediaType());
         // These might have been in the SDP, or might have been randomly
         // chosen by JsepSessionImpl
         ASSERT_FALSE(IsNull(recvTrack));
         ASSERT_EQ(types[level], recvTrack.GetMediaType());
 
-        if (recvTrack.GetMediaType() != SdpMediaSection::kApplication) {
+        if (recvTrack.GetMediaType() != sdp::MediaType::kApplication) {
           std::string msidAttr("a=msid:");
           msidAttr += sendTrack.GetStreamIds()[0];
           msidAttr += " ";
           msidAttr += sendTrack.GetTrackId();
           ASSERT_NE(std::string::npos, answer.find(msidAttr))
             << "Did not find " << msidAttr << " in answer";
         }
       }
       if (types.size() == 1 &&
-          types[0] == SdpMediaSection::kApplication) {
+          types[0] == sdp::MediaType::kApplication) {
         ASSERT_EQ(std::string::npos, answer.find("a=ssrc"))
           << "Data channel should not contain SSRC";
       }
     }
     std::cerr << "Answerer transceivers:" << std::endl;
     DumpTransceivers(*mSessionAns);
   }
 
@@ -1008,17 +1008,17 @@ protected:
         size_t level = transceiver->GetLevel();
         ASSERT_FALSE(IsNull(sendTrack));
         ASSERT_EQ(types[level], sendTrack.GetMediaType());
         // These might have been in the SDP, or might have been randomly
         // chosen by JsepSessionImpl
         ASSERT_FALSE(IsNull(recvTrack));
         ASSERT_EQ(types[level], recvTrack.GetMediaType());
 
-        if (recvTrack.GetMediaType() != SdpMediaSection::kApplication) {
+        if (recvTrack.GetMediaType() != sdp::MediaType::kApplication) {
           std::string msidAttr("a=msid:");
           msidAttr += recvTrack.GetStreamIds()[0];
           msidAttr += " ";
           msidAttr += recvTrack.GetTrackId();
           ASSERT_NE(std::string::npos, answer.find(msidAttr))
             << "Did not find " << msidAttr << " in answer";
         }
       }
@@ -1032,22 +1032,22 @@ protected:
     RTCP = 2
   } ComponentType;
 
   class CandidateSet {
     public:
       CandidateSet() {}
 
       void Gather(JsepSession& session,
-                  const std::vector<SdpMediaSection::MediaType>& types,
+                  const std::vector<sdp::MediaType>& types,
                   ComponentType maxComponent = RTCP)
       {
         for (size_t level = 0; level < types.size(); ++level) {
           Gather(session, level, RTP);
-          if (types[level] != SdpMediaSection::kApplication &&
+          if (types[level] != sdp::MediaType::kApplication &&
               maxComponent == RTCP) {
             Gather(session, level, RTCP);
           }
         }
         FinishGathering(session);
       }
 
       void Gather(JsepSession& session, size_t level, ComponentType component)
@@ -1339,29 +1339,29 @@ protected:
 
     auto& attrs = msection->GetAttributeList();
     ASSERT_TRUE(attrs.HasAttribute(SdpAttribute::kMidAttribute));
     ASSERT_TRUE(attrs.HasAttribute(SdpAttribute::kDirectionAttribute));
     ASSERT_FALSE(attrs.HasAttribute(SdpAttribute::kBundleOnlyAttribute));
     ASSERT_EQ(SdpDirectionAttribute::kInactive,
               msection->GetDirectionAttribute().mValue);
     ASSERT_EQ(3U, attrs.Count());
-    if (msection->GetMediaType() == SdpMediaSection::kAudio) {
+    if (msection->GetMediaType() == sdp::MediaType::kAudio) {
       ASSERT_EQ("0", msection->GetFormats()[0]);
       const SdpRtpmapAttributeList::Rtpmap* rtpmap(msection->FindRtpmap("0"));
       ASSERT_TRUE(rtpmap);
       ASSERT_EQ("0", rtpmap->pt);
       ASSERT_EQ("PCMU", rtpmap->name);
-    } else if (msection->GetMediaType() == SdpMediaSection::kVideo) {
+    } else if (msection->GetMediaType() == sdp::MediaType::kVideo) {
       ASSERT_EQ("120", msection->GetFormats()[0]);
       const SdpRtpmapAttributeList::Rtpmap* rtpmap(msection->FindRtpmap("120"));
       ASSERT_TRUE(rtpmap);
       ASSERT_EQ("120", rtpmap->pt);
       ASSERT_EQ("VP8", rtpmap->name);
-    } else if (msection->GetMediaType() == SdpMediaSection::kApplication) {
+    } else if (msection->GetMediaType() == sdp::MediaType::kApplication) {
       ASSERT_EQ("0", msection->GetFormats()[0]);
       const SdpSctpmapAttributeList::Sctpmap* sctpmap(msection->GetSctpmap());
       ASSERT_TRUE(sctpmap);
       ASSERT_EQ("0", sctpmap->pt);
       ASSERT_EQ("rejected", sctpmap->name);
       ASSERT_EQ(0U, sctpmap->streams);
     } else {
       // Not that we would have any test which tests this...
@@ -1402,17 +1402,17 @@ protected:
     }
     std::cerr << "  encodings=" << std::endl;
     for (size_t i = 0; i < details->GetEncodingCount(); ++i) {
       const JsepTrackEncoding& encoding = details->GetEncoding(i);
       std::cerr << "    id=" << encoding.mRid << std::endl;
       for (const JsepCodecDescription* codec : encoding.GetCodecs()) {
         std::cerr << "      " << codec->mName
                   << " enabled(" << (codec->mEnabled?"yes":"no") << ")";
-        if (track.GetMediaType() == SdpMediaSection::kAudio) {
+        if (track.GetMediaType() == sdp::MediaType::kAudio) {
           const JsepAudioCodecDescription* audioCodec =
               static_cast<const JsepAudioCodecDescription*>(codec);
           std::cerr << " dtmf(" << (audioCodec->mDtmfEnabled?"yes":"no") << ")";
         }
         std::cerr << std::endl;
       }
     }
   }
@@ -1460,30 +1460,30 @@ protected:
     mOffererTransport.swap(mAnswererTransport);
   }
 
   UniquePtr<JsepSessionImpl> mSessionOff;
   UniquePtr<CandidateSet> mOffCandidates;
   UniquePtr<JsepSessionImpl> mSessionAns;
   UniquePtr<CandidateSet> mAnsCandidates;
 
-  std::vector<SdpMediaSection::MediaType> types;
+  std::vector<sdp::MediaType> types;
   std::vector<std::pair<std::string, uint16_t>> mGatheredCandidates;
 
 private:
   void
   ValidateTransport(TransportData& source, const std::string& sdp_str)
   {
     UniquePtr<Sdp> sdp(Parse(sdp_str));
     ASSERT_TRUE(!!sdp);
     size_t num_m_sections = sdp->GetMediaSectionCount();
     for (size_t i = 0; i < num_m_sections; ++i) {
       auto& msection = sdp->GetMediaSection(i);
 
-      if (msection.GetMediaType() == SdpMediaSection::kApplication) {
+      if (msection.GetMediaType() == sdp::MediaType::kApplication) {
         ASSERT_EQ(SdpMediaSection::kDtlsSctp, msection.GetProtocol());
       } else {
         ASSERT_EQ(SdpMediaSection::kUdpTlsRtpSavpf, msection.GetProtocol());
       }
 
       const SdpAttributeList& attrs = msection.GetAttributeList();
       bool bundle_only = attrs.HasAttribute(SdpAttribute::kBundleOnlyAttribute);
 
@@ -1738,19 +1738,19 @@ TEST_P(JsepSessionTest, RenegotiationOff
   ValidateSetupAttribute(*mSessionOff, SdpSetupAttribute::kActpass);
   ValidateSetupAttribute(*mSessionAns, SdpSetupAttribute::kActive);
 
   std::vector<RefPtr<JsepTransceiver>> origOffererTransceivers
     = DeepCopy(mSessionOff->GetTransceivers());
   std::vector<RefPtr<JsepTransceiver>> origAnswererTransceivers
     = DeepCopy(mSessionAns->GetTransceivers());
 
-  std::vector<SdpMediaSection::MediaType> extraTypes;
-  extraTypes.push_back(SdpMediaSection::kAudio);
-  extraTypes.push_back(SdpMediaSection::kVideo);
+  std::vector<sdp::MediaType> extraTypes;
+  extraTypes.push_back(sdp::MediaType::kAudio);
+  extraTypes.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, extraTypes);
   types.insert(types.end(), extraTypes.begin(), extraTypes.end());
 
   OfferAnswer(CHECK_SUCCESS);
 
   ValidateSetupAttribute(*mSessionOff, SdpSetupAttribute::kActpass);
   ValidateSetupAttribute(*mSessionAns, SdpSetupAttribute::kActive);
 
@@ -1776,27 +1776,27 @@ TEST_P(JsepSessionTest, RenegotiationAns
   ValidateSetupAttribute(*mSessionOff, SdpSetupAttribute::kActpass);
   ValidateSetupAttribute(*mSessionAns, SdpSetupAttribute::kActive);
 
   std::vector<RefPtr<JsepTransceiver>> origOffererTransceivers
     = DeepCopy(mSessionOff->GetTransceivers());
   std::vector<RefPtr<JsepTransceiver>> origAnswererTransceivers
     = DeepCopy(mSessionAns->GetTransceivers());
 
-  std::vector<SdpMediaSection::MediaType> extraTypes;
-  extraTypes.push_back(SdpMediaSection::kAudio);
-  extraTypes.push_back(SdpMediaSection::kVideo);
+  std::vector<sdp::MediaType> extraTypes;
+  extraTypes.push_back(sdp::MediaType::kAudio);
+  extraTypes.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionAns, extraTypes);
   types.insert(types.end(), extraTypes.begin(), extraTypes.end());
 
   // We need to add a recvonly m-section to the offer for this to work
   mSessionOff->AddTransceiver(new JsepTransceiver(
-        SdpMediaSection::kAudio, SdpDirectionAttribute::Direction::kRecvonly));
+        sdp::MediaType::kAudio, SdpDirectionAttribute::Direction::kRecvonly));
   mSessionOff->AddTransceiver(new JsepTransceiver(
-        SdpMediaSection::kVideo, SdpDirectionAttribute::Direction::kRecvonly));
+        sdp::MediaType::kVideo, SdpDirectionAttribute::Direction::kRecvonly));
 
   std::string offer = CreateOffer();
   SetLocalOffer(offer, CHECK_SUCCESS);
   SetRemoteOffer(offer, CHECK_SUCCESS);
 
   std::string answer = CreateAnswer();
   SetLocalAnswer(answer, CHECK_SUCCESS);
   SetRemoteAnswer(answer, CHECK_SUCCESS);
@@ -1826,19 +1826,19 @@ TEST_P(JsepSessionTest, RenegotiationBot
   ValidateSetupAttribute(*mSessionOff, SdpSetupAttribute::kActpass);
   ValidateSetupAttribute(*mSessionAns, SdpSetupAttribute::kActive);
 
   std::vector<RefPtr<JsepTransceiver>> origOffererTransceivers
     = DeepCopy(mSessionOff->GetTransceivers());
   std::vector<RefPtr<JsepTransceiver>> origAnswererTransceivers
     = DeepCopy(mSessionAns->GetTransceivers());
 
-  std::vector<SdpMediaSection::MediaType> extraTypes;
-  extraTypes.push_back(SdpMediaSection::kAudio);
-  extraTypes.push_back(SdpMediaSection::kVideo);
+  std::vector<sdp::MediaType> extraTypes;
+  extraTypes.push_back(sdp::MediaType::kAudio);
+  extraTypes.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionAns, extraTypes);
   AddTracks(*mSessionOff, extraTypes);
   types.insert(types.end(), extraTypes.begin(), extraTypes.end());
 
   OfferAnswer(CHECK_SUCCESS);
 
   ValidateSetupAttribute(*mSessionOff, SdpSetupAttribute::kActpass);
   ValidateSetupAttribute(*mSessionAns, SdpSetupAttribute::kActive);
@@ -1873,19 +1873,19 @@ TEST_P(JsepSessionTest, RenegotiationBot
   ASSERT_EQ(oHasStream, !GetRemoteUniqueStreamIds(*mSessionAns).empty());
 
   auto firstOffId = GetFirstLocalStreamId(*mSessionOff);
   auto firstAnsId = GetFirstLocalStreamId(*mSessionAns);
 
   auto offererTransceivers = DeepCopy(mSessionOff->GetTransceivers());
   auto answererTransceivers = DeepCopy(mSessionAns->GetTransceivers());
 
-  std::vector<SdpMediaSection::MediaType> extraTypes;
-  extraTypes.push_back(SdpMediaSection::kAudio);
-  extraTypes.push_back(SdpMediaSection::kVideo);
+  std::vector<sdp::MediaType> extraTypes;
+  extraTypes.push_back(sdp::MediaType::kAudio);
+  extraTypes.push_back(sdp::MediaType::kVideo);
   AddTracksToStream(*mSessionOff, firstOffId, extraTypes);
   AddTracksToStream(*mSessionAns, firstAnsId, extraTypes);
   types.insert(types.end(), extraTypes.begin(), extraTypes.end());
 
   OfferAnswer(CHECK_SUCCESS);
 
   oHasStream = HasMediaStream(GetLocalTracks(*mSessionOff));
   aHasStream = HasMediaStream(GetLocalTracks(*mSessionAns));
@@ -1921,17 +1921,17 @@ TEST_P(JsepSessionTest, RenegotiationOff
   OfferAnswer();
 
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
 
   RefPtr<JsepTransceiver> transceiver =
     GetNegotiatedTransceiver(*mSessionOff, 0);
   ASSERT_TRUE(transceiver);
-  if (transceiver->GetMediaType() == SdpMediaSection::kApplication) {
+  if (transceiver->GetMediaType() == sdp::MediaType::kApplication) {
     return;
   }
   std::string streamId = transceiver->mSendTrack.GetStreamIds()[0];
   std::string trackId = transceiver->mSendTrack.GetTrackId();
   std::string msidToReplace("a=msid:");
   msidToReplace += streamId;
   msidToReplace += " ";
   msidToReplace += trackId;
@@ -1956,29 +1956,29 @@ TEST_P(JsepSessionTest, RenegotiationAns
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
 
   OfferAnswer();
 
   RefPtr<JsepTransceiver> transceiver =
     GetNegotiatedTransceiver(*mSessionOff, 0);
   ASSERT_TRUE(transceiver);
-  if (transceiver->GetMediaType() == SdpMediaSection::kApplication) {
+  if (transceiver->GetMediaType() == sdp::MediaType::kApplication) {
     return;
   }
 
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
   SetRemoteOffer(offer);
   std::string answer = CreateAnswer();
   SetLocalAnswer(answer);
 
   transceiver = GetNegotiatedTransceiver(*mSessionAns, 0);
   ASSERT_TRUE(transceiver);
-  if (transceiver->GetMediaType() == SdpMediaSection::kApplication) {
+  if (transceiver->GetMediaType() == sdp::MediaType::kApplication) {
     return;
   }
   std::string streamId = transceiver->mSendTrack.GetStreamIds()[0];
   std::string trackId = transceiver->mSendTrack.GetTrackId();
   std::string msidToReplace("a=msid:");
   msidToReplace += streamId;
   msidToReplace += " ";
   msidToReplace += trackId;
@@ -1992,17 +1992,17 @@ TEST_P(JsepSessionTest, RenegotiationAns
   ASSERT_EQ("foo", transceiver->mRecvTrack.GetStreamIds()[0]);
   ASSERT_EQ("bar", transceiver->mRecvTrack.GetTrackId());
 }
 
 TEST_P(JsepSessionTest, RenegotiationOffererStopsTransceiver)
 {
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
-  if (types.back() == SdpMediaSection::kApplication) {
+  if (types.back() == sdp::MediaType::kApplication) {
     return;
   }
 
   OfferAnswer();
 
   std::vector<RefPtr<JsepTransceiver>> origOffererTransceivers =
     DeepCopy(mSessionOff->GetTransceivers());
   std::vector<RefPtr<JsepTransceiver>> origAnswererTransceivers =
@@ -2047,17 +2047,17 @@ TEST_P(JsepSessionTest, RenegotiationOff
   ASSERT_TRUE(Equals(origOffererTransceivers, newOffererTransceivers));
   ASSERT_TRUE(Equals(origAnswererTransceivers, newAnswererTransceivers));
 }
 
 TEST_P(JsepSessionTest, RenegotiationAnswererStopsTransceiver)
 {
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
-  if (types.back() == SdpMediaSection::kApplication) {
+  if (types.back() == sdp::MediaType::kApplication) {
     return;
   }
 
   OfferAnswer();
 
   std::vector<RefPtr<JsepTransceiver>> origOffererTransceivers
     = DeepCopy(mSessionOff->GetTransceivers());
   std::vector<RefPtr<JsepTransceiver>> origAnswererTransceivers
@@ -2100,17 +2100,17 @@ TEST_P(JsepSessionTest, RenegotiationAns
   ASSERT_TRUE(Equals(origOffererTransceivers, newOffererTransceivers));
   ASSERT_TRUE(Equals(origAnswererTransceivers, newAnswererTransceivers));
 }
 
 TEST_P(JsepSessionTest, RenegotiationBothStopSameTransceiver)
 {
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
-  if (types.back() == SdpMediaSection::kApplication) {
+  if (types.back() == sdp::MediaType::kApplication) {
     return;
   }
 
   OfferAnswer();
 
   std::vector<RefPtr<JsepTransceiver>> origOffererTransceivers
     = DeepCopy(mSessionOff->GetTransceivers());
   std::vector<RefPtr<JsepTransceiver>> origAnswererTransceivers
@@ -2154,38 +2154,38 @@ TEST_P(JsepSessionTest, RenegotiationBot
   ASSERT_TRUE(Equals(origOffererTransceivers, newOffererTransceivers));
   ASSERT_TRUE(Equals(origAnswererTransceivers, newAnswererTransceivers));
 }
 
 TEST_P(JsepSessionTest, RenegotiationBothStopTransceiverThenAddTrack)
 {
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
-  if (types.back() == SdpMediaSection::kApplication) {
+  if (types.back() == sdp::MediaType::kApplication) {
     return;
   }
 
-  SdpMediaSection::MediaType removedType = types.back();
+  sdp::MediaType removedType = types.back();
 
   OfferAnswer();
 
   // Avoid bundle transport side effects; don't stop the BUNDLE-tag!
   mSessionOff->GetTransceivers().back()->Stop();
   JsepTrack removedTrackOffer(mSessionOff->GetTransceivers().back()->mSendTrack);
   mSessionOff->GetTransceivers().back()->Stop();
   JsepTrack removedTrackAnswer(mSessionOff->GetTransceivers().back()->mSendTrack);
 
   OfferAnswer(CHECK_SUCCESS);
 
   std::vector<RefPtr<JsepTransceiver>> origOffererTransceivers
     = DeepCopy(mSessionOff->GetTransceivers());
   std::vector<RefPtr<JsepTransceiver>> origAnswererTransceivers
     = DeepCopy(mSessionAns->GetTransceivers());
 
-  std::vector<SdpMediaSection::MediaType> extraTypes;
+  std::vector<sdp::MediaType> extraTypes;
   extraTypes.push_back(removedType);
   AddTracks(*mSessionAns, extraTypes);
   AddTracks(*mSessionOff, extraTypes);
   types.insert(types.end(), extraTypes.begin(), extraTypes.end());
 
   OfferAnswer(CHECK_SUCCESS);
 
   auto newOffererTransceivers = mSessionOff->GetTransceivers();
@@ -2208,19 +2208,19 @@ TEST_P(JsepSessionTest, RenegotiationBot
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
 
   if (types.size() < 2) {
     return;
   }
 
   if (mSessionOff->GetTransceivers()[0]->GetMediaType() ==
-        SdpMediaSection::kApplication ||
+        sdp::MediaType::kApplication ||
       mSessionOff->GetTransceivers()[1]->GetMediaType() ==
-        SdpMediaSection::kApplication) {
+        sdp::MediaType::kApplication) {
     return;
   }
 
   OfferAnswer();
 
   mSessionOff->GetTransceivers()[0]->Stop();
   mSessionOff->GetTransceivers()[1]->Stop();
 
@@ -2230,17 +2230,17 @@ TEST_P(JsepSessionTest, RenegotiationBot
 }
 
 TEST_P(JsepSessionTest, RenegotiationOffererReplacesTrack)
 {
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
 
   if (mSessionOff->GetTransceivers()[0]->GetMediaType() ==
-        SdpMediaSection::kApplication) {
+        sdp::MediaType::kApplication) {
     return;
   }
 
   OfferAnswer();
 
   mSessionOff->GetTransceivers()[0]->mSendTrack.UpdateTrackIds(
       std::vector<std::string>(1, "newstream"), "newtrack");
 
@@ -2255,17 +2255,17 @@ TEST_P(JsepSessionTest, RenegotiationOff
 }
 
 TEST_P(JsepSessionTest, RenegotiationAnswererReplacesTrack)
 {
   AddTracks(*mSessionOff);
   AddTracks(*mSessionAns);
 
   if (mSessionOff->GetTransceivers()[0]->GetMediaType() ==
-        SdpMediaSection::kApplication) {
+        sdp::MediaType::kApplication) {
     return;
   }
 
   OfferAnswer();
 
   mSessionAns->GetTransceivers()[0]->mSendTrack.UpdateTrackIds(
       std::vector<std::string>(1, "newstream"), "newtrack");
 
@@ -2336,17 +2336,17 @@ TEST_P(JsepSessionTest, RenegotiationOff
   // and dtmf is enabled on all audio tracks
   std::vector<JsepTrack> tracks;
   for (const auto& transceiver : mSessionOff->GetTransceivers()) {
     tracks.push_back(transceiver->mSendTrack);
     tracks.push_back(transceiver->mRecvTrack);
   }
 
   for (const JsepTrack& track : tracks) {
-    if (track.GetMediaType() != SdpMediaSection::kAudio) {
+    if (track.GetMediaType() != sdp::MediaType::kAudio) {
       continue;
     }
     const JsepTrackNegotiatedDetails* details = track.GetNegotiatedDetails();
     ASSERT_EQ(1U, details->GetEncodingCount());
     const JsepTrackEncoding& encoding = details->GetEncoding(0);
     ASSERT_EQ(2U, encoding.GetCodecs().size());
     ASSERT_TRUE(encoding.HasFormat("109"));
     ASSERT_TRUE(encoding.HasFormat("101"));
@@ -2375,17 +2375,17 @@ TEST_P(JsepSessionTest, RenegotiationOff
   // and dtmf is disabled on all audio tracks
   tracks.clear();
   for (const auto& transceiver : mSessionOff->GetTransceivers()) {
     tracks.push_back(transceiver->mSendTrack);
     tracks.push_back(transceiver->mRecvTrack);
   }
 
   for (const JsepTrack& track : tracks) {
-    if (track.GetMediaType() != SdpMediaSection::kAudio) {
+    if (track.GetMediaType() != sdp::MediaType::kAudio) {
       continue;
     }
     const JsepTrackNegotiatedDetails* details = track.GetNegotiatedDetails();
     ASSERT_EQ(1U, details->GetEncodingCount());
     const JsepTrackEncoding& encoding = details->GetEncoding(0);
     ASSERT_EQ(1U, encoding.GetCodecs().size());
     ASSERT_TRUE(encoding.HasFormat("109"));
     // we can cast here because we've already checked for audio track
@@ -2432,17 +2432,17 @@ TEST_P(JsepSessionTest, RenegotiationAns
               newOffererTransceivers[i]->mRecvTrack.GetMediaType());
 
     ASSERT_TRUE(Equals(origOffererTransceivers[i]->mSendTrack,
                        newOffererTransceivers[i]->mSendTrack));
     ASSERT_TRUE(Equals(origOffererTransceivers[i]->mTransport,
                        newOffererTransceivers[i]->mTransport));
 
     if (origOffererTransceivers[i]->mRecvTrack.GetMediaType() ==
-        SdpMediaSection::kApplication) {
+        sdp::MediaType::kApplication) {
       ASSERT_TRUE(Equals(origOffererTransceivers[i]->mRecvTrack,
                          newOffererTransceivers[i]->mRecvTrack));
     } else {
       // This should be the only difference
       ASSERT_FALSE(Equals(origOffererTransceivers[i]->mRecvTrack,
                           newOffererTransceivers[i]->mRecvTrack));
     }
   }
@@ -2642,17 +2642,17 @@ TEST_P(JsepSessionTest, RenegotiationAns
     ASSERT_NE(ot0->mTransport.get(), ot->mTransport.get());
     ASSERT_NE(at0->mTransport.get(), at->mTransport.get());
   }
 }
 
 TEST_P(JsepSessionTest, ParseRejectsBadMediaFormat)
 {
   AddTracks(*mSessionOff);
-  if (types.front() == SdpMediaSection::MediaType::kApplication) {
+  if (types.front() == sdp::MediaType::kApplication) {
     return;
   }
   std::string offer = CreateOffer();
   UniquePtr<Sdp> munge(Parse(offer));
   SdpMediaSection& mediaSection = munge->GetMediaSection(0);
   mediaSection.AddCodec("75", "DummyFormatVal", 8000, 1);
   std::string sdpString = munge->ToString();
   nsresult rv = mSessionOff->SetLocalDescription(kJsepSdpOffer, sdpString);
@@ -2671,22 +2671,22 @@ TEST_P(JsepSessionTest, FullCallWithCand
   for (size_t i = 0; i < localOffer->GetMediaSectionCount(); ++i) {
     mOffCandidates->CheckRtpCandidates(
         true, localOffer->GetMediaSection(i), i,
         "Local offer after gathering should have RTP candidates.");
     mOffCandidates->CheckDefaultRtpCandidate(
         true, localOffer->GetMediaSection(i), i,
         "Local offer after gathering should have a default RTP candidate.");
     mOffCandidates->CheckRtcpCandidates(
-        types[i] != SdpMediaSection::kApplication,
+        types[i] != sdp::MediaType::kApplication,
         localOffer->GetMediaSection(i), i,
         "Local offer after gathering should have RTCP candidates "
         "(unless m=application)");
     mOffCandidates->CheckDefaultRtcpCandidate(
-        types[i] != SdpMediaSection::kApplication,
+        types[i] != sdp::MediaType::kApplication,
         localOffer->GetMediaSection(i), i,
         "Local offer after gathering should have a default RTCP candidate "
         "(unless m=application)");
     CheckEndOfCandidates(true, localOffer->GetMediaSection(i),
         "Local offer after gathering should have an end-of-candidates.");
   }
 
   SetRemoteOffer(offer);
@@ -2697,17 +2697,17 @@ TEST_P(JsepSessionTest, FullCallWithCand
   for (size_t i = 0; i < remoteOffer->GetMediaSectionCount(); ++i) {
     mOffCandidates->CheckRtpCandidates(
         true, remoteOffer->GetMediaSection(i), i,
         "Remote offer after trickle should have RTP candidates.");
     mOffCandidates->CheckDefaultRtpCandidate(
         false, remoteOffer->GetMediaSection(i), i,
         "Initial remote offer should not have a default RTP candidate.");
     mOffCandidates->CheckRtcpCandidates(
-        types[i] != SdpMediaSection::kApplication,
+        types[i] != sdp::MediaType::kApplication,
         remoteOffer->GetMediaSection(i), i,
         "Remote offer after trickle should have RTCP candidates "
         "(unless m=application)");
     mOffCandidates->CheckDefaultRtcpCandidate(
         false, remoteOffer->GetMediaSection(i), i,
         "Initial remote offer should not have a default RTCP candidate.");
     CheckEndOfCandidates(false, remoteOffer->GetMediaSection(i),
         "Initial remote offer should not have an end-of-candidates.");
@@ -2835,25 +2835,25 @@ TEST_P(JsepSessionTest, RenegotiationWit
         "(previous answerer)");
   }
 
   // Ok, let's continue with the renegotiation
   SetRemoteOffer(offer);
 
   // PeerConnection will not re-gather for RTP, but it will for RTCP in case
   // the answerer decides to turn off rtcp-mux.
-  if (types[0] != SdpMediaSection::kApplication) {
+  if (types[0] != sdp::MediaType::kApplication) {
     mOffCandidates->Gather(*mSessionOff, 0, RTCP);
   }
 
   // Since the remaining levels were bundled, PeerConnection will re-gather for
   // both RTP and RTCP, in case the answerer rejects bundle.
   for (size_t level = 1; level < types.size(); ++level) {
     mOffCandidates->Gather(*mSessionOff, level, RTP);
-    if (types[level] != SdpMediaSection::kApplication) {
+    if (types[level] != sdp::MediaType::kApplication) {
       mOffCandidates->Gather(*mSessionOff, level, RTCP);
     }
   }
   mOffCandidates->FinishGathering(*mSessionOff);
 
   mOffCandidates->Trickle(*mSessionAns);
 
   UniquePtr<Sdp> localOffer(Parse(
@@ -2861,22 +2861,22 @@ TEST_P(JsepSessionTest, RenegotiationWit
   for (size_t i = 0; i < localOffer->GetMediaSectionCount(); ++i) {
     mOffCandidates->CheckRtpCandidates(
         true, localOffer->GetMediaSection(i), i,
         "Local reoffer after gathering should have RTP candidates.");
     mOffCandidates->CheckDefaultRtpCandidate(
         true, localOffer->GetMediaSection(i), i,
         "Local reoffer after gathering should have a default RTP candidate.");
     mOffCandidates->CheckRtcpCandidates(
-        types[i] != SdpMediaSection::kApplication,
+        types[i] != sdp::MediaType::kApplication,
         localOffer->GetMediaSection(i), i,
         "Local reoffer after gathering should have RTCP candidates "
         "(unless m=application)");
     mOffCandidates->CheckDefaultRtcpCandidate(
-        types[i] != SdpMediaSection::kApplication,
+        types[i] != sdp::MediaType::kApplication,
         localOffer->GetMediaSection(i), i,
         "Local reoffer after gathering should have a default RTCP candidate "
         "(unless m=application)");
     CheckEndOfCandidates(true, localOffer->GetMediaSection(i),
         "Local reoffer after gathering should have an end-of-candidates.");
   }
 
   UniquePtr<Sdp> remoteOffer(Parse(
@@ -2885,17 +2885,17 @@ TEST_P(JsepSessionTest, RenegotiationWit
     mOffCandidates->CheckRtpCandidates(
         true, remoteOffer->GetMediaSection(i), i,
         "Remote reoffer after trickle should have RTP candidates.");
     mOffCandidates->CheckDefaultRtpCandidate(
         i == 0, remoteOffer->GetMediaSection(i), i,
         "Remote reoffer should have a default RTP candidate on level 0 "
         "(because it was gathered last offer/answer).");
     mOffCandidates->CheckRtcpCandidates(
-        types[i] != SdpMediaSection::kApplication,
+        types[i] != sdp::MediaType::kApplication,
         remoteOffer->GetMediaSection(i), i,
         "Remote reoffer after trickle should have RTCP candidates.");
     mOffCandidates->CheckDefaultRtcpCandidate(
         false, remoteOffer->GetMediaSection(i), i,
         "Remote reoffer should not have a default RTCP candidate.");
     CheckEndOfCandidates(false, remoteOffer->GetMediaSection(i),
         "Remote reoffer should not have an end-of-candidates.");
   }
@@ -2964,27 +2964,27 @@ TEST_P(JsepSessionTest, RenegotiationAns
   SetLocalOffer(offer);
   SetRemoteOffer(offer);
   std::string answer = CreateAnswer();
   SetLocalAnswer(answer);
 
   UniquePtr<Sdp> parsedAnswer(Parse(answer));
   for (size_t i = 0; i < parsedAnswer->GetMediaSectionCount(); ++i) {
     SdpMediaSection& msection = parsedAnswer->GetMediaSection(i);
-    if (msection.GetMediaType() != SdpMediaSection::kApplication) {
+    if (msection.GetMediaType() != sdp::MediaType::kApplication) {
       msection.SetReceiving(false);
     }
   }
 
   answer = parsedAnswer->ToString();
 
   SetRemoteAnswer(answer);
 
   for (const JsepTrack& track : GetLocalTracks(*mSessionOff)) {
-    if (track.GetMediaType() != SdpMediaSection::kApplication) {
+    if (track.GetMediaType() != sdp::MediaType::kApplication) {
       ASSERT_FALSE(track.GetActive());
     }
   }
 
   ASSERT_EQ(types.size(), mSessionOff->GetTransceivers().size());
 }
 
 TEST_P(JsepSessionTest, RenegotiationAnswererInactive)
@@ -2997,28 +2997,28 @@ TEST_P(JsepSessionTest, RenegotiationAns
   SetLocalOffer(offer);
   SetRemoteOffer(offer);
   std::string answer = CreateAnswer();
   SetLocalAnswer(answer);
 
   UniquePtr<Sdp> parsedAnswer(Parse(answer));
   for (size_t i = 0; i < parsedAnswer->GetMediaSectionCount(); ++i) {
     SdpMediaSection& msection = parsedAnswer->GetMediaSection(i);
-    if (msection.GetMediaType() != SdpMediaSection::kApplication) {
+    if (msection.GetMediaType() != sdp::MediaType::kApplication) {
       msection.SetReceiving(false);
       msection.SetSending(false);
     }
   }
 
   answer = parsedAnswer->ToString();
 
   SetRemoteAnswer(answer, CHECK_SUCCESS); // Won't have answerer tracks
 
   for (const JsepTrack& track : GetLocalTracks(*mSessionOff)) {
-    if (track.GetMediaType() != SdpMediaSection::kApplication) {
+    if (track.GetMediaType() != sdp::MediaType::kApplication) {
       ASSERT_FALSE(track.GetActive());
     }
   }
 
   ASSERT_EQ(types.size(), mSessionOff->GetTransceivers().size());
 }
 
 
@@ -3047,42 +3047,42 @@ INSTANTIATE_TEST_CASE_P(
                       "audio,audio,video,video",
                       "audio,audio,video,video,datachannel"));
 
 // offerToReceiveXxx variants
 
 TEST_F(JsepSessionTest, OfferAnswerRecvOnlyLines)
 {
   mSessionOff->AddTransceiver(new JsepTransceiver(
-        SdpMediaSection::kAudio, SdpDirectionAttribute::kRecvonly));
+        sdp::MediaType::kAudio, SdpDirectionAttribute::kRecvonly));
   mSessionOff->AddTransceiver(new JsepTransceiver(
-        SdpMediaSection::kVideo, SdpDirectionAttribute::kRecvonly));
+        sdp::MediaType::kVideo, SdpDirectionAttribute::kRecvonly));
   mSessionOff->AddTransceiver(new JsepTransceiver(
-        SdpMediaSection::kVideo, SdpDirectionAttribute::kRecvonly));
+        sdp::MediaType::kVideo, SdpDirectionAttribute::kRecvonly));
   std::string offer = CreateOffer();
 
   UniquePtr<Sdp> parsedOffer(Parse(offer));
   ASSERT_TRUE(!!parsedOffer);
 
   ASSERT_EQ(3U, parsedOffer->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kAudio,
+  ASSERT_EQ(sdp::MediaType::kAudio,
             parsedOffer->GetMediaSection(0).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kRecvonly,
             parsedOffer->GetMediaSection(0).GetAttributeList().GetDirection());
   ASSERT_TRUE(parsedOffer->GetMediaSection(0).GetAttributeList().HasAttribute(
         SdpAttribute::kSsrcAttribute));
 
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             parsedOffer->GetMediaSection(1).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kRecvonly,
             parsedOffer->GetMediaSection(1).GetAttributeList().GetDirection());
   ASSERT_TRUE(parsedOffer->GetMediaSection(1).GetAttributeList().HasAttribute(
         SdpAttribute::kSsrcAttribute));
 
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             parsedOffer->GetMediaSection(2).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kRecvonly,
             parsedOffer->GetMediaSection(2).GetAttributeList().GetDirection());
   ASSERT_TRUE(parsedOffer->GetMediaSection(2).GetAttributeList().HasAttribute(
         SdpAttribute::kSsrcAttribute));
 
   ASSERT_TRUE(parsedOffer->GetMediaSection(0).GetAttributeList().HasAttribute(
       SdpAttribute::kRtcpMuxAttribute));
@@ -3095,25 +3095,25 @@ TEST_F(JsepSessionTest, OfferAnswerRecvO
 
   AddTracks(*mSessionAns, "audio,video");
   SetRemoteOffer(offer, CHECK_SUCCESS);
 
   std::string answer = CreateAnswer();
   UniquePtr<Sdp> parsedAnswer(Parse(answer));
 
   ASSERT_EQ(3U, parsedAnswer->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kAudio,
+  ASSERT_EQ(sdp::MediaType::kAudio,
             parsedAnswer->GetMediaSection(0).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kSendonly,
             parsedAnswer->GetMediaSection(0).GetAttributeList().GetDirection());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             parsedAnswer->GetMediaSection(1).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kSendonly,
             parsedAnswer->GetMediaSection(1).GetAttributeList().GetDirection());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             parsedAnswer->GetMediaSection(2).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kInactive,
             parsedAnswer->GetMediaSection(2).GetAttributeList().GetDirection());
 
   SetLocalAnswer(answer, CHECK_SUCCESS);
   SetRemoteAnswer(answer, CHECK_SUCCESS);
 
   std::vector<RefPtr<JsepTransceiver>> transceivers(mSessionOff->GetTransceivers());
@@ -3132,25 +3132,25 @@ TEST_F(JsepSessionTest, OfferAnswerSendO
   SetDirection(*mSessionOff, 0, SdpDirectionAttribute::kSendonly);
   SetDirection(*mSessionOff, 2, SdpDirectionAttribute::kSendonly);
   std::string offer = CreateOffer();
 
   UniquePtr<Sdp> outputSdp(Parse(offer));
   ASSERT_TRUE(!!outputSdp);
 
   ASSERT_EQ(3U, outputSdp->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kAudio,
+  ASSERT_EQ(sdp::MediaType::kAudio,
             outputSdp->GetMediaSection(0).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kSendonly,
             outputSdp->GetMediaSection(0).GetAttributeList().GetDirection());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             outputSdp->GetMediaSection(1).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kSendrecv,
             outputSdp->GetMediaSection(1).GetAttributeList().GetDirection());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             outputSdp->GetMediaSection(2).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kSendonly,
             outputSdp->GetMediaSection(2).GetAttributeList().GetDirection());
 
   ASSERT_TRUE(outputSdp->GetMediaSection(0).GetAttributeList().HasAttribute(
       SdpAttribute::kRtcpMuxAttribute));
   ASSERT_TRUE(outputSdp->GetMediaSection(1).GetAttributeList().HasAttribute(
       SdpAttribute::kRtcpMuxAttribute));
@@ -3161,127 +3161,127 @@ TEST_F(JsepSessionTest, OfferAnswerSendO
 
   AddTracks(*mSessionAns, "audio,video");
   SetRemoteOffer(offer, CHECK_SUCCESS);
 
   std::string answer = CreateAnswer();
   outputSdp = Parse(answer);
 
   ASSERT_EQ(3U, outputSdp->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kAudio,
+  ASSERT_EQ(sdp::MediaType::kAudio,
             outputSdp->GetMediaSection(0).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kRecvonly,
             outputSdp->GetMediaSection(0).GetAttributeList().GetDirection());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             outputSdp->GetMediaSection(1).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kSendrecv,
             outputSdp->GetMediaSection(1).GetAttributeList().GetDirection());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             outputSdp->GetMediaSection(2).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kRecvonly,
             outputSdp->GetMediaSection(2).GetAttributeList().GetDirection());
 }
 
 TEST_F(JsepSessionTest, OfferToReceiveAudioNotUsed)
 {
   mSessionOff->AddTransceiver(new JsepTransceiver(
-        SdpMediaSection::kAudio, SdpDirectionAttribute::kRecvonly));
+        sdp::MediaType::kAudio, SdpDirectionAttribute::kRecvonly));
 
   OfferAnswer(CHECK_SUCCESS);
 
   UniquePtr<Sdp> offer(Parse(
         mSessionOff->GetLocalDescription(kJsepDescriptionCurrent)));
   ASSERT_TRUE(offer.get());
   ASSERT_EQ(1U, offer->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kAudio,
+  ASSERT_EQ(sdp::MediaType::kAudio,
             offer->GetMediaSection(0).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kRecvonly,
             offer->GetMediaSection(0).GetAttributeList().GetDirection());
 
   UniquePtr<Sdp> answer(Parse(
         mSessionAns->GetLocalDescription(kJsepDescriptionCurrent)));
   ASSERT_TRUE(answer.get());
   ASSERT_EQ(1U, answer->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kAudio,
+  ASSERT_EQ(sdp::MediaType::kAudio,
             answer->GetMediaSection(0).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kInactive,
             answer->GetMediaSection(0).GetAttributeList().GetDirection());
 }
 
 TEST_F(JsepSessionTest, OfferToReceiveVideoNotUsed)
 {
   mSessionOff->AddTransceiver(new JsepTransceiver(
-        SdpMediaSection::kVideo, SdpDirectionAttribute::kRecvonly));
+        sdp::MediaType::kVideo, SdpDirectionAttribute::kRecvonly));
 
   OfferAnswer(CHECK_SUCCESS);
 
   UniquePtr<Sdp> offer(Parse(
         mSessionOff->GetLocalDescription(kJsepDescriptionCurrent)));
   ASSERT_TRUE(offer.get());
   ASSERT_EQ(1U, offer->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             offer->GetMediaSection(0).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kRecvonly,
             offer->GetMediaSection(0).GetAttributeList().GetDirection());
 
   UniquePtr<Sdp> answer(Parse(
         mSessionAns->GetLocalDescription(kJsepDescriptionCurrent)));
   ASSERT_TRUE(answer.get());
   ASSERT_EQ(1U, answer->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             answer->GetMediaSection(0).GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::kInactive,
             answer->GetMediaSection(0).GetAttributeList().GetDirection());
 }
 
 TEST_F(JsepSessionTest, CreateOfferNoDatachannelDefault)
 {
-  RefPtr<JsepTransceiver> audio(new JsepTransceiver(SdpMediaSection::kAudio));
+  RefPtr<JsepTransceiver> audio(new JsepTransceiver(sdp::MediaType::kAudio));
   audio->mSendTrack.UpdateTrackIds(
       std::vector<std::string>(1, "offerer_stream"), "a1");
   mSessionOff->AddTransceiver(audio);
 
-  RefPtr<JsepTransceiver> video(new JsepTransceiver(SdpMediaSection::kVideo));
+  RefPtr<JsepTransceiver> video(new JsepTransceiver(sdp::MediaType::kVideo));
   video->mSendTrack.UpdateTrackIds(
       std::vector<std::string>(1, "offerer_stream"), "v1");
   mSessionOff->AddTransceiver(video);
 
   std::string offer = CreateOffer();
 
   UniquePtr<Sdp> outputSdp(Parse(offer));
   ASSERT_TRUE(!!outputSdp);
 
   ASSERT_EQ(2U, outputSdp->GetMediaSectionCount());
-  ASSERT_EQ(SdpMediaSection::kAudio,
+  ASSERT_EQ(sdp::MediaType::kAudio,
             outputSdp->GetMediaSection(0).GetMediaType());
-  ASSERT_EQ(SdpMediaSection::kVideo,
+  ASSERT_EQ(sdp::MediaType::kVideo,
             outputSdp->GetMediaSection(1).GetMediaType());
 }
 
 TEST_F(JsepSessionTest, ValidateOfferedVideoCodecParams)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
-
-  RefPtr<JsepTransceiver> audio(new JsepTransceiver(SdpMediaSection::kAudio));
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
+
+  RefPtr<JsepTransceiver> audio(new JsepTransceiver(sdp::MediaType::kAudio));
   audio->mSendTrack.UpdateTrackIds(std::vector<std::string>(1, "offerer_stream"), "a1");
   mSessionOff->AddTransceiver(audio);
 
-  RefPtr<JsepTransceiver> video(new JsepTransceiver(SdpMediaSection::kVideo));
+  RefPtr<JsepTransceiver> video(new JsepTransceiver(sdp::MediaType::kVideo));
   video->mSendTrack.UpdateTrackIds(std::vector<std::string>(1, "offerer_stream"), "v1");
   mSessionOff->AddTransceiver(video);
 
   std::string offer = CreateOffer();
 
   UniquePtr<Sdp> outputSdp(Parse(offer));
   ASSERT_TRUE(!!outputSdp);
 
   ASSERT_EQ(2U, outputSdp->GetMediaSectionCount());
   auto& video_section = outputSdp->GetMediaSection(1);
-  ASSERT_EQ(SdpMediaSection::kVideo, video_section.GetMediaType());
+  ASSERT_EQ(sdp::MediaType::kVideo, video_section.GetMediaType());
   auto& video_attrs = video_section.GetAttributeList();
   ASSERT_EQ(SdpDirectionAttribute::kSendrecv, video_attrs.GetDirection());
 
   ASSERT_EQ(6U, video_section.GetFormats().size());
   ASSERT_EQ("120", video_section.GetFormats()[0]);
   ASSERT_EQ("121", video_section.GetFormats()[1]);
   ASSERT_EQ("126", video_section.GetFormats()[2]);
   ASSERT_EQ("97", video_section.GetFormats()[3]);
@@ -3381,35 +3381,35 @@ TEST_F(JsepSessionTest, ValidateOfferedV
   ASSERT_EQ(121, parsed_red_params.encodings[1]);
   ASSERT_EQ(126, parsed_red_params.encodings[2]);
   ASSERT_EQ(97, parsed_red_params.encodings[3]);
   ASSERT_EQ(123, parsed_red_params.encodings[4]);
 }
 
 TEST_F(JsepSessionTest, ValidateOfferedAudioCodecParams)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
-
-  RefPtr<JsepTransceiver> audio(new JsepTransceiver(SdpMediaSection::kAudio));
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
+
+  RefPtr<JsepTransceiver> audio(new JsepTransceiver(sdp::MediaType::kAudio));
   audio->mSendTrack.UpdateTrackIds(std::vector<std::string>(1, "offerer_stream"), "a1");
   mSessionOff->AddTransceiver(audio);
 
-  RefPtr<JsepTransceiver> video(new JsepTransceiver(SdpMediaSection::kVideo));
+  RefPtr<JsepTransceiver> video(new JsepTransceiver(sdp::MediaType::kVideo));
   video->mSendTrack.UpdateTrackIds(std::vector<std::string>(1, "offerer_stream"), "v1");
   mSessionOff->AddTransceiver(video);
 
   std::string offer = CreateOffer();
 
   UniquePtr<Sdp> outputSdp(Parse(offer));
   ASSERT_TRUE(!!outputSdp);
 
   ASSERT_EQ(2U, outputSdp->GetMediaSectionCount());
   auto& audio_section = outputSdp->GetMediaSection(0);
-  ASSERT_EQ(SdpMediaSection::kAudio, audio_section.GetMediaType());
+  ASSERT_EQ(sdp::MediaType::kAudio, audio_section.GetMediaType());
   auto& audio_attrs = audio_section.GetAttributeList();
   ASSERT_EQ(SdpDirectionAttribute::kSendrecv, audio_attrs.GetDirection());
   ASSERT_EQ(5U, audio_section.GetFormats().size());
   ASSERT_EQ("109", audio_section.GetFormats()[0]);
   ASSERT_EQ("9", audio_section.GetFormats()[1]);
   ASSERT_EQ("0", audio_section.GetFormats()[2]);
   ASSERT_EQ("8", audio_section.GetFormats()[3]);
   ASSERT_EQ("101", audio_section.GetFormats()[4]);
@@ -3464,18 +3464,18 @@ TEST_F(JsepSessionTest, ValidateOfferedA
       *static_cast<const SdpFmtpAttributeList::TelephoneEventParameters*>
           (dtmf_params);
 
   ASSERT_EQ("0-15", parsed_dtmf_params.dtmfTones);
 }
 
 TEST_F(JsepSessionTest, ValidateNoFmtpLineForRedInOfferAndAnswer)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
 
   AddTracksToStream(*mSessionOff, "offerer_stream", "audio,video");
 
   std::string offer = CreateOffer();
 
   // look for line with fmtp:122 and remove it
   size_t start = offer.find("a=fmtp:122");
   size_t end = offer.find("\r\n", start);
@@ -3491,17 +3491,17 @@ TEST_F(JsepSessionTest, ValidateNoFmtpLi
   // in the answer sdp string
   ASSERT_EQ(std::string::npos, answer.find("a=fmtp:122"));
 
   UniquePtr<Sdp> outputSdp(Parse(answer));
   ASSERT_TRUE(!!outputSdp);
 
   ASSERT_EQ(2U, outputSdp->GetMediaSectionCount());
   auto& video_section = outputSdp->GetMediaSection(1);
-  ASSERT_EQ(SdpMediaSection::kVideo, video_section.GetMediaType());
+  ASSERT_EQ(sdp::MediaType::kVideo, video_section.GetMediaType());
   auto& video_attrs = video_section.GetAttributeList();
   ASSERT_EQ(SdpDirectionAttribute::kSendrecv, video_attrs.GetDirection());
 
   ASSERT_EQ(6U, video_section.GetFormats().size());
   ASSERT_EQ("120", video_section.GetFormats()[0]);
   ASSERT_EQ("121", video_section.GetFormats()[1]);
   ASSERT_EQ("126", video_section.GetFormats()[2]);
   ASSERT_EQ("97", video_section.GetFormats()[3]);
@@ -3576,35 +3576,35 @@ TEST_F(JsepSessionTest, ValidateAnswered
       if (h264->mDefaultPt == "126") {
         h264->mDefaultPt = "97";
       } else {
         h264->mDefaultPt = "126";
       }
     }
   }
 
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
 
   AddTracksToStream(*mSessionOff, "offerer_stream", "audio,video");
 
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
   SetRemoteOffer(offer);
 
   AddTracksToStream(*mSessionAns, "answerer_stream", "audio,video");
 
   std::string answer = CreateAnswer();
 
   UniquePtr<Sdp> outputSdp(Parse(answer));
   ASSERT_TRUE(!!outputSdp);
 
   ASSERT_EQ(2U, outputSdp->GetMediaSectionCount());
   auto& video_section = outputSdp->GetMediaSection(1);
-  ASSERT_EQ(SdpMediaSection::kVideo, video_section.GetMediaType());
+  ASSERT_EQ(sdp::MediaType::kVideo, video_section.GetMediaType());
   auto& video_attrs = video_section.GetAttributeList();
   ASSERT_EQ(SdpDirectionAttribute::kSendrecv, video_attrs.GetDirection());
 
   // TODO(bug 1099351): Once fixed, this stuff will need to be updated.
   ASSERT_EQ(1U, video_section.GetFormats().size());
   // ASSERT_EQ(3U, video_section.GetFormats().size());
   ASSERT_EQ("120", video_section.GetFormats()[0]);
   // ASSERT_EQ("121", video_section.GetFormats()[1]);
@@ -4071,28 +4071,28 @@ TEST_F(JsepSessionTest, TestH264LevelAsy
   // elsewhere
 }
 
 TEST_P(JsepSessionTest, TestRejectMline)
 {
   // We need to do this before adding tracks
   types = BuildTypes(GetParam());
 
-  SdpMediaSection::MediaType type = types.front();
+  sdp::MediaType type = types.front();
 
   switch (type) {
-    case SdpMediaSection::kAudio:
+    case sdp::MediaType::kAudio:
       // Sabotage audio
       EnsureNegotiationFailure(types.front(), "opus");
       break;
-    case SdpMediaSection::kVideo:
+    case sdp::MediaType::kVideo:
       // Sabotage video
       EnsureNegotiationFailure(types.front(), "H264");
       break;
-    case SdpMediaSection::kApplication:
+    case sdp::MediaType::kApplication:
       // Sabotage datachannel
       EnsureNegotiationFailure(types.front(), "webrtc-datachannel");
       break;
     default:
       ASSERT_TRUE(false) << "Unknown media type";
   }
 
   AddTracks(*mSessionOff);
@@ -4122,17 +4122,17 @@ TEST_P(JsepSessionTest, TestRejectMline)
   ASSERT_EQ(0U, failed_section->GetPort());
 
   mSessionAns->SetLocalDescription(kJsepSdpAnswer, answer);
   mSessionOff->SetRemoteDescription(kJsepSdpAnswer, answer);
 
   size_t numRejected = std::count(types.begin(), types.end(), type);
   size_t numAccepted = types.size() - numRejected;
 
-  if (type == SdpMediaSection::MediaType::kApplication) {
+  if (type == sdp::MediaType::kApplication) {
     ASSERT_TRUE(GetDatachannelTransceiver(*mSessionOff));
     ASSERT_FALSE(
         GetDatachannelTransceiver(*mSessionOff)->mRecvTrack.GetActive());
     ASSERT_TRUE(GetDatachannelTransceiver(*mSessionAns));
     ASSERT_FALSE(
         GetDatachannelTransceiver(*mSessionAns)->mRecvTrack.GetActive());
   } else {
     ASSERT_EQ(types.size(), GetLocalTracks(*mSessionOff).size());
@@ -4459,17 +4459,17 @@ TEST_F(JsepSessionTest, TestUniquePayloa
   ASSERT_TRUE(answerTransceivers[2]->mRecvTrack.GetNegotiatedDetails());
   ASSERT_NE(0U,
       answerTransceivers[2]->mRecvTrack.GetNegotiatedDetails()->
       GetUniquePayloadTypes().size());
 }
 
 TEST_F(JsepSessionTest, UnknownFingerprintAlgorithm)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
 
   std::string offer(CreateOffer());
   SetLocalOffer(offer);
   ReplaceAll("fingerprint:sha", "fingerprint:foo", &offer);
   nsresult rv = mSessionAns->SetRemoteDescription(kJsepSdpOffer, offer);
   ASSERT_NE(NS_OK, rv);
@@ -4521,17 +4521,17 @@ TEST(H264ProfileLevelIdTest, TestLevelSe
 TEST_F(JsepSessionTest, StronglyPreferredCodec)
 {
   for (JsepCodecDescription* codec : mSessionAns->Codecs()) {
     if (codec->mName == "H264") {
       codec->mStronglyPreferred = true;
     }
   }
 
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "video");
   AddTracks(*mSessionAns, "video");
 
   OfferAnswer();
 
   const JsepCodecDescription* codec;
   GetCodec(*mSessionAns, 0, sdp::kSend, 0, 0, &codec);
   ASSERT_TRUE(codec);
@@ -4539,17 +4539,17 @@ TEST_F(JsepSessionTest, StronglyPreferre
   GetCodec(*mSessionAns, 0, sdp::kRecv, 0, 0, &codec);
   ASSERT_TRUE(codec);
   ASSERT_EQ("H264", codec->mName);
 }
 
 TEST_F(JsepSessionTest, LowDynamicPayloadType)
 {
   SetPayloadTypeNumber(*mSessionOff, "opus", "12");
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
 
   OfferAnswer();
   const JsepCodecDescription* codec;
   GetCodec(*mSessionAns, 0, sdp::kSend, 0, 0, &codec);
   ASSERT_TRUE(codec);
   ASSERT_EQ("opus", codec->mName);
@@ -4561,17 +4561,17 @@ TEST_F(JsepSessionTest, LowDynamicPayloa
 }
 
 TEST_F(JsepSessionTest, PayloadTypeClash)
 {
   // Disable this so mSessionOff doesn't have a duplicate
   SetCodecEnabled(*mSessionOff, "PCMU", false);
   SetPayloadTypeNumber(*mSessionOff, "opus", "0");
   SetPayloadTypeNumber(*mSessionAns, "PCMU", "0");
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
 
   OfferAnswer();
   const JsepCodecDescription* codec;
   GetCodec(*mSessionAns, 0, sdp::kSend, 0, 0, &codec);
   ASSERT_TRUE(codec);
   ASSERT_EQ("opus", codec->mName);
@@ -4704,17 +4704,17 @@ TEST_P(JsepSessionTest, TestBalancedBund
 
   mSessionOff->SetBundlePolicy(kBundleBalanced);
 
   std::string offer = CreateOffer();
   SipccSdpParser parser;
   UniquePtr<Sdp> parsedOffer = parser.Parse(offer);
   ASSERT_TRUE(parsedOffer.get());
 
-  std::map<SdpMediaSection::MediaType, SdpMediaSection*> firstByType;
+  std::map<sdp::MediaType, SdpMediaSection*> firstByType;
 
   for (size_t i = 0; i < parsedOffer->GetMediaSectionCount(); ++i) {
     SdpMediaSection& msection(parsedOffer->GetMediaSection(i));
     bool firstOfType = !firstByType.count(msection.GetMediaType());
     if (firstOfType) {
       firstByType[msection.GetMediaType()] = &msection;
     }
     ASSERT_EQ(!firstOfType,
@@ -4809,118 +4809,118 @@ TEST_F(JsepSessionTest, TestNonDefaultPr
   ASSERT_EQ(SdpMediaSection::kRtpSavpf,
             parsedOffer->GetMediaSection(0).GetProtocol());
   ASSERT_EQ(SdpMediaSection::kRtpSavpf,
             parsedOffer->GetMediaSection(1).GetProtocol());
 }
 
 TEST_F(JsepSessionTest, CreateOfferNoVideoStreamRecvVideo)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(1U));
 
   CreateOffer(Some(options));
 }
 
 TEST_F(JsepSessionTest, CreateOfferNoAudioStreamRecvAudio)
 {
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "video");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(1U));
 
   CreateOffer(Some(options));
 }
 
 TEST_F(JsepSessionTest, CreateOfferNoVideoStream)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(0U));
 
   CreateOffer(Some(options));
 }
 
 TEST_F(JsepSessionTest, CreateOfferNoAudioStream)
 {
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "video");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(0U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(1U));
 
   CreateOffer(Some(options));
 }
 
 TEST_F(JsepSessionTest, CreateOfferDontReceiveAudio)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(0U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(1U));
 
   CreateOffer(Some(options));
 }
 
 TEST_F(JsepSessionTest, CreateOfferDontReceiveVideo)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(0U));
 
   CreateOffer(Some(options));
 }
 
 TEST_F(JsepSessionTest, CreateOfferRemoveAudioTrack)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
 
   SetDirection(*mSessionOff, 1, SdpDirectionAttribute::kSendonly);
   JsepTrack removedTrack = RemoveTrack(*mSessionOff, 0);
   ASSERT_FALSE(IsNull(removedTrack));
 
   CreateOffer();
 }
 
 TEST_F(JsepSessionTest, CreateOfferDontReceiveAudioRemoveAudioTrack)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
 
   SetDirection(*mSessionOff, 0, SdpDirectionAttribute::kSendonly);
   JsepTrack removedTrack = RemoveTrack(*mSessionOff, 0);
   ASSERT_FALSE(IsNull(removedTrack));
 
   CreateOffer();
 }
 
 TEST_F(JsepSessionTest, CreateOfferDontReceiveVideoRemoveVideoTrack)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(0U));
 
   JsepTrack removedTrack = RemoveTrack(*mSessionOff, 0);
   ASSERT_FALSE(IsNull(removedTrack));
@@ -4930,17 +4930,17 @@ TEST_F(JsepSessionTest, CreateOfferDontR
 
 static const std::string strSampleCandidate =
   "a=candidate:1 1 UDP 2130706431 192.168.2.1 50005 typ host\r\n";
 
 static const unsigned short nSamplelevel = 2;
 
 TEST_F(JsepSessionTest, CreateOfferAddCandidate)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
 
   std::string mid;
   bool skipped;
   nsresult rv;
   rv = mSessionOff->AddLocalIceCandidate(strSampleCandidate,
@@ -4957,18 +4957,18 @@ TEST_F(JsepSessionTest, AddIceCandidateE
                                         nSamplelevel, &mid, &skipped);
 
   // This can't succeed without a local description
   ASSERT_NE(NS_OK, rv);
 }
 
 TEST_F(JsepSessionTest, OfferAnswerDontAddAudioStreamOnAnswerNoOptions)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
   AddTracks(*mSessionAns, "video");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(1U));
 
   CreateOffer(Some(options));
@@ -4977,18 +4977,18 @@ TEST_F(JsepSessionTest, OfferAnswerDontA
   SetRemoteOffer(offer);
   std::string answer = CreateAnswer();
   SetLocalAnswer(answer, CHECK_SUCCESS);
   SetRemoteAnswer(answer, CHECK_SUCCESS);
 }
 
 TEST_F(JsepSessionTest, OfferAnswerDontAddVideoStreamOnAnswerNoOptions)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
   AddTracks(*mSessionAns, "audio");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(1U));
 
   CreateOffer(Some(options));
@@ -4997,31 +4997,31 @@ TEST_F(JsepSessionTest, OfferAnswerDontA
   SetRemoteOffer(offer);
   std::string answer = CreateAnswer();
   SetLocalAnswer(answer, CHECK_SUCCESS);
   SetRemoteAnswer(answer, CHECK_SUCCESS);
 }
 
 TEST_F(JsepSessionTest, OfferAnswerDontAddAudioVideoStreamsOnAnswerNoOptions)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
   AddTracks(*mSessionAns);
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(1U));
 
   OfferAnswer();
 }
 
 TEST_F(JsepSessionTest, OfferAndAnswerWithExtraCodec)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
   SetRemoteOffer(offer);
   std::string answer = CreateAnswer();
 
   UniquePtr<Sdp> munge = Parse(answer);
@@ -5029,67 +5029,67 @@ TEST_F(JsepSessionTest, OfferAndAnswerWi
   mediaSection.AddCodec("8", "PCMA", 8000, 1);
   std::string sdpString = munge->ToString();
 
   SetLocalAnswer(sdpString);
   SetRemoteAnswer(answer);
 }
 
 TEST_F(JsepSessionTest, AddCandidateInHaveLocalOffer) {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
 
   nsresult rv;
   std::string mid;
   rv = mSessionOff->AddRemoteIceCandidate(strSampleCandidate,
                                          mid, nSamplelevel);
   ASSERT_EQ(NS_ERROR_UNEXPECTED, rv);
 }
 
 TEST_F(JsepSessionTest, SetLocalWithoutCreateOffer) {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
 
   std::string offer = CreateOffer();
   nsresult rv = mSessionAns->SetLocalDescription(kJsepSdpOffer, offer);
   ASSERT_EQ(NS_ERROR_UNEXPECTED, rv);
 }
 
 TEST_F(JsepSessionTest, SetLocalWithoutCreateAnswer) {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
 
   std::string offer = CreateOffer();
   SetRemoteOffer(offer);
   nsresult rv = mSessionAns->SetLocalDescription(kJsepSdpAnswer, offer);
   ASSERT_EQ(NS_ERROR_UNEXPECTED, rv);
 }
 
 // Test for Bug 843595
 TEST_F(JsepSessionTest, missingUfrag)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   std::string ufrag = "ice-ufrag";
   std::size_t pos = offer.find(ufrag);
   ASSERT_NE(pos, std::string::npos);
   offer.replace(pos, ufrag.length(), "ice-ufrog");
   nsresult rv = mSessionAns->SetRemoteDescription(kJsepSdpOffer, offer);
   ASSERT_EQ(NS_ERROR_INVALID_ARG, rv);
 }
 
 TEST_F(JsepSessionTest, AudioOnlyCalleeNoRtcpMux)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   std::string rtcp_mux = "a=rtcp-mux\r\n";
   std::size_t pos = offer.find(rtcp_mux);
   ASSERT_NE(pos, std::string::npos);
   offer.replace(pos, rtcp_mux.length(), "");
   SetLocalOffer(offer);
@@ -5118,17 +5118,17 @@ TEST_F(JsepSessionTest, AudioOnlyG711Cal
     "a=rtpmap:126 telephone-event/8000\r\n"
     "a=candidate:0 1 udp 2130706432 148.147.200.251 9000 typ host\r\n"
     "a=candidate:0 2 udp 2130706432 148.147.200.251 9005 typ host\r\n"
     "a=ice-ufrag:cYuakxkEKH+RApYE\r\n"
     "a=ice-pwd:bwtpzLZD+3jbu8vQHvEa6Xuq\r\n"
     "a=setup:active\r\n"
     "a=sendrecv\r\n";
 
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionAns, "audio");
   SetRemoteOffer(offer, CHECK_SUCCESS);
   std::string answer = CreateAnswer();
 
   // They didn't offer opus, so our answer shouldn't include it.
   ASSERT_EQ(answer.find(" opus/"), std::string::npos);
 
   // They also didn't offer video or application
@@ -5140,17 +5140,17 @@ TEST_F(JsepSessionTest, AudioOnlyG711Cal
 
   // Double-check the directionality
   ASSERT_NE(answer.find("\r\na=sendrecv"), std::string::npos);
 
 }
 
 TEST_F(JsepSessionTest, AudioOnlyG722Only)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
 
   std::string audio = "m=audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8 101\r\n";
   std::size_t pos = offer.find(audio);
   ASSERT_NE(pos, std::string::npos);
@@ -5165,17 +5165,17 @@ TEST_F(JsepSessionTest, AudioOnlyG722Onl
             std::string::npos);
   ASSERT_NE(mSessionAns->GetLocalDescription(kJsepDescriptionCurrent)
             .find("a=rtpmap:9 G722/8000"),
             std::string::npos);
 }
 
 TEST_F(JsepSessionTest, AudioOnlyG722Rejected)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
 
   std::string audio = "m=audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8 101\r\n";
   std::size_t pos = offer.find(audio);
   ASSERT_NE(pos, std::string::npos);
@@ -5199,17 +5199,17 @@ TEST_F(JsepSessionTest, AudioOnlyG722Rej
             .find("a=rtpmap:109 opus/48000/2"), std::string::npos);
   ASSERT_EQ(mSessionAns->GetLocalDescription(kJsepDescriptionCurrent)
             .find("a=rtpmap:9 G722/8000"), std::string::npos);
 }
 
 // This test doesn't make sense for bundle
 TEST_F(JsepSessionTest, DISABLED_FullCallAudioNoMuxVideoMux)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio,video");
   AddTracks(*mSessionAns, "audio,video");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
   std::string rtcp_mux = "a=rtcp-mux\r\n";
   std::size_t pos = offer.find(rtcp_mux);
   ASSERT_NE(pos, std::string::npos);
   offer.replace(pos, rtcp_mux.length(), "");
@@ -5224,17 +5224,17 @@ TEST_F(JsepSessionTest, DISABLED_FullCal
   ASSERT_EQ(match, std::string::npos);
 }
 
 // Disabled pending resolution of bug 818640.
 // Actually, this test is completely broken; you can't just call
 // SetRemote/CreateAnswer over and over again.
 TEST_F(JsepSessionTest, DISABLED_OfferAllDynamicTypes)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionAns, "audio");
 
   std::string offer;
   for (int i = 96; i < 128; i++)
   {
     std::stringstream ss;
     ss << i;
     std::cout << "Trying dynamic pt = " << i << std::endl;
@@ -5275,17 +5275,17 @@ TEST_F(JsepSessionTest, ipAddrAnyOffer)
     "m=audio 9000 UDP/TLS/RTP/SAVPF 99\r\n"
     "c=IN IP4 0.0.0.0\r\n"
     "a=rtpmap:99 opus/48000/2\r\n"
     "a=ice-ufrag:cYuakxkEKH+RApYE\r\n"
     "a=ice-pwd:bwtpzLZD+3jbu8vQHvEa6Xuq\r\n"
     "a=setup:active\r\n"
     "a=sendrecv\r\n";
 
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionAns, "audio");
   SetRemoteOffer(offer, CHECK_SUCCESS);
   std::string answer = CreateAnswer();
 
   ASSERT_NE(answer.find("a=sendrecv"), std::string::npos);
 }
 
 static void CreateSDPForBigOTests(std::string& offer, const std::string& number) {
@@ -5311,53 +5311,53 @@ static void CreateSDPForBigOTests(std::s
 }
 
 TEST_F(JsepSessionTest, BigOValues)
 {
   std::string offer;
 
   CreateSDPForBigOTests(offer, "12345678901234567");
 
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionAns, "audio");
   SetRemoteOffer(offer, CHECK_SUCCESS);
 }
 
 TEST_F(JsepSessionTest, BigOValuesExtraChars)
 {
   std::string offer;
 
   CreateSDPForBigOTests(offer, "12345678901234567FOOBAR");
 
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionAns, "audio");
   // The signaling state will remain "stable" because the unparsable
   // SDP leads to a failure in SetRemoteDescription.
   SetRemoteOffer(offer, NO_CHECKS);
   ASSERT_EQ(kJsepStateStable, mSessionAns->GetState());
 }
 
 TEST_F(JsepSessionTest, BigOValuesTooBig)
 {
   std::string offer;
 
   CreateSDPForBigOTests(offer, "18446744073709551615");
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionAns, "audio");
 
   // The signaling state will remain "stable" because the unparsable
   // SDP leads to a failure in SetRemoteDescription.
   SetRemoteOffer(offer, NO_CHECKS);
   ASSERT_EQ(kJsepStateStable, mSessionAns->GetState());
 }
 
 
 TEST_F(JsepSessionTest, SetLocalAnswerInStable)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   std::string offer = CreateOffer();
 
   // The signaling state will remain "stable" because the
   // SetLocalDescription call fails.
   SetLocalAnswer(offer, NO_CHECKS);
   ASSERT_EQ(kJsepStateStable, mSessionOff->GetState());
 }
@@ -5393,83 +5393,83 @@ TEST_F(JsepSessionTest, SetRemoteAnswerI
   // SetRemoteDescription call fails.
   nsresult rv = mSessionOff->SetRemoteDescription(kJsepSdpAnswer, answer);
   ASSERT_NE(NS_OK, rv);
   ASSERT_EQ(kJsepStateStable, mSessionOff->GetState());
 }
 
 TEST_F(JsepSessionTest, SetLocalAnswerInHaveLocalOffer)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   std::string offer = CreateOffer();
 
   SetLocalOffer(offer);
   ASSERT_EQ(kJsepStateHaveLocalOffer, mSessionOff->GetState());
 
   // The signaling state will remain "have-local-offer" because the
   // SetLocalDescription call fails.
   nsresult rv = mSessionOff->SetLocalDescription(kJsepSdpAnswer, offer);
   ASSERT_NE(NS_OK, rv);
   ASSERT_EQ(kJsepStateHaveLocalOffer, mSessionOff->GetState());
 }
 
 TEST_F(JsepSessionTest, SetRemoteOfferInHaveLocalOffer)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   std::string offer = CreateOffer();
 
   SetLocalOffer(offer);
   ASSERT_EQ(kJsepStateHaveLocalOffer, mSessionOff->GetState());
 
   // The signaling state will remain "have-local-offer" because the
   // SetRemoteDescription call fails.
   nsresult rv = mSessionOff->SetRemoteDescription(kJsepSdpOffer, offer);
   ASSERT_NE(NS_OK, rv);
   ASSERT_EQ(kJsepStateHaveLocalOffer, mSessionOff->GetState());
 }
 
 TEST_F(JsepSessionTest, SetLocalOfferInHaveRemoteOffer)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   std::string offer = CreateOffer();
 
   SetRemoteOffer(offer);
   ASSERT_EQ(kJsepStateHaveRemoteOffer, mSessionAns->GetState());
 
   // The signaling state will remain "have-remote-offer" because the
   // SetLocalDescription call fails.
   nsresult rv = mSessionAns->SetLocalDescription(kJsepSdpOffer, offer);
   ASSERT_NE(NS_OK, rv);
   ASSERT_EQ(kJsepStateHaveRemoteOffer, mSessionAns->GetState());
 }
 
 TEST_F(JsepSessionTest, SetRemoteAnswerInHaveRemoteOffer)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   std::string offer = CreateOffer();
 
   SetRemoteOffer(offer);
   ASSERT_EQ(kJsepStateHaveRemoteOffer, mSessionAns->GetState());
 
   // The signaling state will remain "have-remote-offer" because the
   // SetRemoteDescription call fails.
   nsresult rv = mSessionAns->SetRemoteDescription(kJsepSdpAnswer, offer);
   ASSERT_NE(NS_OK, rv);
 
   ASSERT_EQ(kJsepStateHaveRemoteOffer, mSessionAns->GetState());
 }
 
 TEST_F(JsepSessionTest, RtcpFbInOffer)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
   std::string offer = CreateOffer();
 
   std::map<std::string, bool> expected;
   expected["nack"] = false;
   expected["nack pli"] = false;
   expected["ccm fir"] = false;
 
@@ -5500,17 +5500,17 @@ TEST_F(JsepSessionTest, RtcpFbInOffer)
     ASSERT_EQ(it->second, true);
   }
 }
 
 // In this test we will change the offer SDP's a=setup value
 // from actpass to passive. This will force the answer to do active.
 TEST_F(JsepSessionTest, AudioCallForceDtlsRoles)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
 
   std::string actpass = "\r\na=setup:actpass";
   size_t match = offer.find(actpass);
   ASSERT_NE(match, std::string::npos);
   offer.replace(match, actpass.length(), "\r\na=setup:passive");
@@ -5526,17 +5526,17 @@ TEST_F(JsepSessionTest, AudioCallForceDt
   SetRemoteAnswer(answer);
   ASSERT_EQ(kJsepStateStable, mSessionAns->GetState());
 }
 
 // In this test we will change the offer SDP's a=setup value
 // from actpass to active. This will force the answer to do passive.
 TEST_F(JsepSessionTest, AudioCallReverseDtlsRoles)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
 
   std::string actpass = "\r\na=setup:actpass";
   size_t match = offer.find(actpass);
   ASSERT_NE(match, std::string::npos);
   offer.replace(match, actpass.length(), "\r\na=setup:active");
@@ -5553,17 +5553,17 @@ TEST_F(JsepSessionTest, AudioCallReverse
   ASSERT_EQ(kJsepStateStable, mSessionAns->GetState());
 }
 
 // In this test we will change the answer SDP's a=setup value
 // from active to passive.  This will make both sides do
 // active and should not connect.
 TEST_F(JsepSessionTest, AudioCallMismatchDtlsRoles)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
 
   std::string actpass = "\r\na=setup:actpass";
   size_t match = offer.find(actpass);
   ASSERT_NE(match, std::string::npos);
   SetLocalOffer(offer);
@@ -5583,17 +5583,17 @@ TEST_F(JsepSessionTest, AudioCallMismatc
       mSessionOff->GetTransceivers()[0]->mTransport->mDtls->GetRole());
   ASSERT_EQ(JsepDtlsTransport::kJsepDtlsClient,
       mSessionAns->GetTransceivers()[0]->mTransport->mDtls->GetRole());
 }
 
 // Verify that missing a=setup in offer gets rejected
 TEST_F(JsepSessionTest, AudioCallOffererNoSetup)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
 
   std::string actpass = "\r\na=setup:actpass";
   size_t match = offer.find(actpass);
   ASSERT_NE(match, std::string::npos);
@@ -5605,17 +5605,17 @@ TEST_F(JsepSessionTest, AudioCallOfferer
   ASSERT_EQ(kJsepStateStable, mSessionAns->GetState());
   ASSERT_EQ(kJsepStateHaveLocalOffer, mSessionOff->GetState());
 }
 
 // In this test we will change the answer SDP to remove the
 // a=setup line, which results in active being assumed.
 TEST_F(JsepSessionTest, AudioCallAnswerNoSetup)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   size_t match = offer.find("\r\na=setup:actpass");
   ASSERT_NE(match, std::string::npos);
 
   SetLocalOffer(offer);
   SetRemoteOffer(offer);
@@ -5635,17 +5635,17 @@ TEST_F(JsepSessionTest, AudioCallAnswerN
       mSessionOff->GetTransceivers()[0]->mTransport->mDtls->GetRole());
   ASSERT_EQ(JsepDtlsTransport::kJsepDtlsClient,
       mSessionAns->GetTransceivers()[0]->mTransport->mDtls->GetRole());
 }
 
 // Verify that 'holdconn' gets rejected
 TEST_F(JsepSessionTest, AudioCallDtlsRoleHoldconn)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
 
   std::string actpass = "\r\na=setup:actpass";
   size_t match = offer.find(actpass);
   ASSERT_NE(match, std::string::npos);
@@ -5656,17 +5656,17 @@ TEST_F(JsepSessionTest, AudioCallDtlsRol
   SetRemoteOffer(offer, NO_CHECKS);
   ASSERT_EQ(kJsepStateStable, mSessionAns->GetState());
   ASSERT_EQ(kJsepStateHaveLocalOffer, mSessionOff->GetState());
 }
 
 // Verify that 'actpass' in answer gets rejected
 TEST_F(JsepSessionTest, AudioCallAnswererUsesActpass)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
   SetRemoteOffer(offer);
   std::string answer = CreateAnswer();
   SetLocalAnswer(answer);
 
@@ -5680,17 +5680,17 @@ TEST_F(JsepSessionTest, AudioCallAnswere
   SetRemoteAnswer(answer, NO_CHECKS);
   ASSERT_EQ(kJsepStateStable, mSessionAns->GetState());
   ASSERT_EQ(kJsepStateHaveLocalOffer, mSessionOff->GetState());
 }
 
 // Disabled: See Bug 1329028
 TEST_F(JsepSessionTest, DISABLED_AudioCallOffererAttemptsSetupRoleSwitch)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
 
   OfferAnswer();
 
   ValidateSetupAttribute(*mSessionOff, SdpSetupAttribute::kActpass);
   ValidateSetupAttribute(*mSessionAns, SdpSetupAttribute::kActive);
 
@@ -5706,17 +5706,17 @@ TEST_F(JsepSessionTest, DISABLED_AudioCa
   SetRemoteOffer(reoffer, NO_CHECKS);
   ASSERT_EQ(kJsepStateHaveLocalOffer, mSessionOff->GetState());
   ASSERT_EQ(kJsepStateStable, mSessionAns->GetState());
 }
 
 // Disabled: See Bug 1329028
 TEST_F(JsepSessionTest, DISABLED_AudioCallAnswererAttemptsSetupRoleSwitch)
 {
-  types.push_back(SdpMediaSection::kAudio);
+  types.push_back(sdp::MediaType::kAudio);
   AddTracks(*mSessionOff, "audio");
   AddTracks(*mSessionAns, "audio");
 
   OfferAnswer();
 
   ValidateSetupAttribute(*mSessionOff, SdpSetupAttribute::kActpass);
   ValidateSetupAttribute(*mSessionAns, SdpSetupAttribute::kActive);
 
@@ -5742,18 +5742,18 @@ TEST_F(JsepSessionTest, DISABLED_AudioCa
 TEST_F(JsepSessionTest, OfferWithOnlyH264P0)
 {
   for (JsepCodecDescription* codec : mSessionOff->Codecs()) {
     if (codec->mName != "H264" || codec->mDefaultPt == "126") {
       codec->mEnabled = false;
     }
   }
 
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
   AddTracks(*mSessionAns, "audio,video");
   std::string offer = CreateOffer();
 
   ASSERT_EQ(offer.find("a=rtpmap:126 H264/90000"), std::string::npos);
   ASSERT_EQ(offer.find("a=rtpmap:120 VP8/90000"), std::string::npos);
 
   SetLocalOffer(offer);
@@ -5773,18 +5773,18 @@ TEST_F(JsepSessionTest, OfferWithOnlyH26
   ASSERT_EQ(answer.find("a=rtcp-fb:120"), std::string::npos);
   ASSERT_EQ(answer.find("a=rtcp-fb:126"), std::string::npos);
 }
 
 // Test negotiating an answer which has only H.264 P1
 // Which means replace VP8 with H.264 P1 in answer
 TEST_F(JsepSessionTest, AnswerWithoutVP8)
 {
-  types.push_back(SdpMediaSection::kAudio);
-  types.push_back(SdpMediaSection::kVideo);
+  types.push_back(sdp::MediaType::kAudio);
+  types.push_back(sdp::MediaType::kVideo);
   AddTracks(*mSessionOff, "audio,video");
   AddTracks(*mSessionAns, "audio,video");
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
   SetRemoteOffer(offer);
 
   for (JsepCodecDescription* codec : mSessionOff->Codecs()) {
     if (codec->mName != "H264" || codec->mDefaultPt == "126") {
@@ -6196,17 +6196,17 @@ TEST_F(JsepSessionTest, NoAddTrackMagicR
   AddTracks(*mSessionAns);
 
   OfferAnswer();
 
   ASSERT_EQ(2U, mSessionOff->GetTransceivers().size());
   ASSERT_EQ(2U, mSessionAns->GetTransceivers().size());
   AddTracks(*mSessionOff, "audio");
   mSessionAns->AddTransceiver(
-      new JsepTransceiver(SdpMediaSection::MediaType::kAudio));
+      new JsepTransceiver(sdp::MediaType::kAudio));
 
   mSessionAns->GetTransceivers()[2]->mSendTrack.UpdateTrackIds(
       {"newstream"}, "newtrack");
 
   ASSERT_EQ(3U, mSessionAns->GetTransceivers().size());
   ASSERT_EQ(0U, mSessionAns->GetTransceivers()[0]->GetLevel());
   ASSERT_FALSE(mSessionAns->GetTransceivers()[0]->IsStopped());
   ASSERT_TRUE(mSessionAns->GetTransceivers()[0]->IsAssociated());
@@ -6245,17 +6245,17 @@ TEST_F(JsepSessionTest, AddTrackMakesTra
   AddTracks(*mSessionAns);
 
   OfferAnswer();
 
   ASSERT_EQ(2U, mSessionOff->GetTransceivers().size());
   ASSERT_EQ(2U, mSessionAns->GetTransceivers().size());
   AddTracks(*mSessionOff, "audio");
   mSessionAns->AddTransceiver(
-      new JsepTransceiver(SdpMediaSection::MediaType::kAudio));
+      new JsepTransceiver(sdp::MediaType::kAudio));
 
   ASSERT_EQ(3U, mSessionAns->GetTransceivers().size());
   ASSERT_EQ(0U, mSessionAns->GetTransceivers()[0]->GetLevel());
   ASSERT_FALSE(mSessionAns->GetTransceivers()[0]->IsStopped());
   ASSERT_TRUE(mSessionAns->GetTransceivers()[0]->IsAssociated());
   ASSERT_EQ(1U, mSessionAns->GetTransceivers()[1]->GetLevel());
   ASSERT_FALSE(mSessionAns->GetTransceivers()[1]->IsStopped());
   ASSERT_TRUE(mSessionAns->GetTransceivers()[1]->IsAssociated());
@@ -6356,17 +6356,17 @@ TEST_F(JsepSessionTest, ComplicatedRemot
   // This will not cause the third audio transceiver to stick around; having a
   // track is _not_ enough to preserve it. It must have addTrack "magic"!
   mSessionAns->GetTransceivers()[4]->mSendTrack.UpdateTrackIds(
       {"newstream"}, "newtrack");
 
   // Create a fourth audio transceiver. Rollback will leave it alone, since we
   // created it.
   mSessionAns->AddTransceiver(new JsepTransceiver(
-        SdpMediaSection::MediaType::kAudio,
+        sdp::MediaType::kAudio,
         SdpDirectionAttribute::Direction::kRecvonly));
 
   ASSERT_EQ(NS_OK,
             mSessionAns->SetRemoteDescription(kJsepSdpRollback, ""));
 
   // Three recvonly for audio, one sendrecv for video, and one (unmapped) for
   // the second video track.
   ASSERT_EQ(4U, mSessionAns->GetTransceivers().size());
--- a/media/webrtc/signaling/gtest/jsep_track_unittest.cpp
+++ b/media/webrtc/signaling/gtest/jsep_track_unittest.cpp
@@ -12,20 +12,20 @@
 #include "signaling/src/sdp/SdpHelper.h"
 
 namespace mozilla {
 
 class JsepTrackTest : public ::testing::Test
 {
   public:
     JsepTrackTest() :
-      mSendOff(SdpMediaSection::kAudio, sdp::kSend),
-      mRecvOff(SdpMediaSection::kAudio, sdp::kRecv),
-      mSendAns(SdpMediaSection::kAudio, sdp::kSend),
-      mRecvAns(SdpMediaSection::kAudio, sdp::kRecv)
+      mSendOff(sdp::MediaType::kAudio, sdp::kSend),
+      mRecvOff(sdp::MediaType::kAudio, sdp::kRecv),
+      mSendAns(sdp::MediaType::kAudio, sdp::kSend),
+      mRecvAns(sdp::MediaType::kAudio, sdp::kRecv)
     {}
 
     std::vector<JsepCodecDescription*>
     MakeCodecs(bool addFecCodecs = false,
                bool preferRed = false,
                bool addDtmfCodec = false) const
     {
       std::vector<JsepCodecDescription*> results;
@@ -90,49 +90,49 @@ class JsepTrackTest : public ::testing::
       // to update the redundant encodings list
       if (red) {
         red->UpdateRedundantEncodings(results);
       }
 
       return results;
     }
 
-    void Init(SdpMediaSection::MediaType type) {
+    void Init(sdp::MediaType type) {
       InitCodecs();
       InitTracks(type);
       InitSdp(type);
     }
 
     void InitCodecs() {
       mOffCodecs.values = MakeCodecs();
       mAnsCodecs.values = MakeCodecs();
     }
 
-    void InitTracks(SdpMediaSection::MediaType type)
+    void InitTracks(sdp::MediaType type)
     {
       mSendOff = JsepTrack(type, sdp::kSend);
-      if (type != SdpMediaSection::MediaType::kApplication) {
+      if (type != sdp::MediaType::kApplication) {
         mSendOff.UpdateTrackIds(
             std::vector<std::string>(1, "stream_id"), "track_id");
       }
       mRecvOff = JsepTrack(type, sdp::kRecv);
       mSendOff.PopulateCodecs(mOffCodecs.values);
       mRecvOff.PopulateCodecs(mOffCodecs.values);
 
       mSendAns = JsepTrack(type, sdp::kSend);
-      if (type != SdpMediaSection::MediaType::kApplication) {
+      if (type != sdp::MediaType::kApplication) {
         mSendAns.UpdateTrackIds(
             std::vector<std::string>(1, "stream_id"), "track_id");
       }
       mRecvAns = JsepTrack(type, sdp::kRecv);
       mSendAns.PopulateCodecs(mAnsCodecs.values);
       mRecvAns.PopulateCodecs(mAnsCodecs.values);
     }
 
-    void InitSdp(SdpMediaSection::MediaType type)
+    void InitSdp(sdp::MediaType type)
     {
       std::vector<std::string> msids(1, "*");
       std::string error;
       SdpHelper helper(&error);
 
       mOffer.reset(new SipccSdp(SdpOrigin("", 0, 0, sdp::kIPv4, "")));
       mOffer->AddMediaSection(
           type,
@@ -169,33 +169,33 @@ class JsepTrackTest : public ::testing::
     void CreateOffer()
     {
       mSendOff.AddToOffer(mSsrcGenerator, &GetOffer());
       mRecvOff.AddToOffer(mSsrcGenerator, &GetOffer());
     }
 
     void CreateAnswer()
     {
-      if (mRecvAns.GetMediaType() != SdpMediaSection::MediaType::kApplication) {
+      if (mRecvAns.GetMediaType() != sdp::MediaType::kApplication) {
         mRecvAns.UpdateRecvTrack(*mOffer, GetOffer());
       }
 
       mSendAns.AddToAnswer(GetOffer(), mSsrcGenerator, &GetAnswer());
       mRecvAns.AddToAnswer(GetOffer(), mSsrcGenerator, &GetAnswer());
     }
 
     void Negotiate()
     {
       std::cerr << "Offer SDP: " << std::endl;
       mOffer->Serialize(std::cerr);
 
       std::cerr << "Answer SDP: " << std::endl;
       mAnswer->Serialize(std::cerr);
 
-      if (mRecvOff.GetMediaType() != SdpMediaSection::MediaType::kApplication) {
+      if (mRecvOff.GetMediaType() != sdp::MediaType::kApplication) {
         mRecvOff.UpdateRecvTrack(*mAnswer, GetAnswer());
       }
 
       if (GetAnswer().IsSending()) {
         mSendAns.Negotiate(GetAnswer(), GetOffer());
         mRecvOff.Negotiate(GetAnswer(), GetAnswer());
       }
 
@@ -242,17 +242,17 @@ class JsepTrackTest : public ::testing::
 
     void CheckAnsEncodingCount(size_t expected) const
     {
       CheckEncodingCount(expected, mSendAns, mRecvOff);
     }
 
     const JsepCodecDescription*
     GetCodec(const JsepTrack& track,
-             SdpMediaSection::MediaType type,
+             sdp::MediaType type,
              size_t expectedSize,
              size_t codecIndex) const
     {
       if (!track.GetNegotiatedDetails() ||
           track.GetNegotiatedDetails()->GetEncodingCount() != 1U ||
           track.GetMediaType() != type) {
         return nullptr;
       }
@@ -268,26 +268,26 @@ class JsepTrackTest : public ::testing::
     }
 
     const JsepVideoCodecDescription*
     GetVideoCodec(const JsepTrack& track,
                   size_t expectedSize = 1,
                   size_t codecIndex = 0) const
     {
       return static_cast<const JsepVideoCodecDescription*>
-        (GetCodec(track, SdpMediaSection::kVideo, expectedSize, codecIndex));
+        (GetCodec(track, sdp::MediaType::kVideo, expectedSize, codecIndex));
     }
 
     const JsepAudioCodecDescription*
     GetAudioCodec(const JsepTrack& track,
                   size_t expectedSize = 1,
                   size_t codecIndex = 0) const
     {
       return static_cast<const JsepAudioCodecDescription*>
-        (GetCodec(track, SdpMediaSection::kAudio, expectedSize, codecIndex));
+        (GetCodec(track, sdp::MediaType::kAudio, expectedSize, codecIndex));
     }
 
     void CheckOtherFbsSize(const JsepTrack& track, size_t expected) const
     {
       const JsepVideoCodecDescription* videoCodec = GetVideoCodec(track);
       ASSERT_NE(videoCodec, nullptr);
       ASSERT_EQ(videoCodec->mOtherFbTypes.size(), expected);
     }
@@ -313,28 +313,28 @@ class JsepTrackTest : public ::testing::
       ASSERT_EQ(a.mCcmFbTypes.size(), b.mCcmFbTypes.size());
       ASSERT_EQ(a.mOtherFbTypes.size(), b.mOtherFbTypes.size());
     }
 
     void SanityCheckCodecs(const JsepCodecDescription& a,
                            const JsepCodecDescription& b) const
     {
       ASSERT_EQ(a.mType, b.mType);
-      if (a.mType != SdpMediaSection::kApplication) {
+      if (a.mType != sdp::MediaType::kApplication) {
         ASSERT_EQ(a.mDefaultPt, b.mDefaultPt);
       }
       std::cerr << a.mName << " vs " << b.mName << std::endl;
       ASSERT_EQ(a.mName, b.mName);
       ASSERT_EQ(a.mClock, b.mClock);
       ASSERT_EQ(a.mChannels, b.mChannels);
       ASSERT_NE(a.mDirection, b.mDirection);
       // These constraints are for fmtp and rid, which _are_ signaled
       ASSERT_EQ(a.mConstraints, b.mConstraints);
 
-      if (a.mType == SdpMediaSection::kVideo) {
+      if (a.mType == sdp::MediaType::kVideo) {
         SanityCheckRtcpFbs(static_cast<const JsepVideoCodecDescription&>(a),
                            static_cast<const JsepVideoCodecDescription&>(b));
       }
     }
 
     void SanityCheckEncodings(const JsepTrackEncoding& a,
                               const JsepTrackEncoding& b) const
     {
@@ -401,78 +401,78 @@ class JsepTrackTest : public ::testing::
     PtrVector<JsepCodecDescription> mAnsCodecs;
     UniquePtr<Sdp> mOffer;
     UniquePtr<Sdp> mAnswer;
     SsrcGenerator mSsrcGenerator;
 };
 
 TEST_F(JsepTrackTest, CreateDestroy)
 {
-  Init(SdpMediaSection::kAudio);
+  Init(sdp::MediaType::kAudio);
 }
 
 TEST_F(JsepTrackTest, AudioNegotiation)
 {
-  Init(SdpMediaSection::kAudio);
+  Init(sdp::MediaType::kAudio);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 }
 
 TEST_F(JsepTrackTest, VideoNegotiation)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 }
 
 class CheckForCodecType
 {
 public:
-  explicit CheckForCodecType(SdpMediaSection::MediaType type,
+  explicit CheckForCodecType(sdp::MediaType type,
                              bool *result) :
     mResult(result),
     mType(type) {}
 
   void operator()(JsepCodecDescription* codec) {
     if (codec->mType == mType) {
       *mResult = true;
     }
   }
 
 private:
   bool *mResult;
-  SdpMediaSection::MediaType mType;
+  sdp::MediaType mType;
 };
 
 TEST_F(JsepTrackTest, CheckForMismatchedAudioCodecAndVideoTrack)
 {
   PtrVector<JsepCodecDescription> offerCodecs;
 
   // make codecs including telephone-event (an audio codec)
   offerCodecs.values = MakeCodecs(false, false, true);
-  JsepTrack videoTrack(SdpMediaSection::kVideo, sdp::kSend);
+  JsepTrack videoTrack(sdp::MediaType::kVideo, sdp::kSend);
   videoTrack.UpdateTrackIds(std::vector<std::string>(1, "stream_id"), "track_id");
   // populate codecs and then make sure we don't have any audio codecs
   // in the video track
   videoTrack.PopulateCodecs(offerCodecs.values);
 
   bool found = false;
-  videoTrack.ForEachCodec(CheckForCodecType(SdpMediaSection::kAudio, &found));
+  videoTrack.ForEachCodec(CheckForCodecType(sdp::MediaType::kAudio, &found));
   ASSERT_FALSE(found);
 
   found = false;
-  videoTrack.ForEachCodec(CheckForCodecType(SdpMediaSection::kVideo, &found));
+  videoTrack.ForEachCodec(CheckForCodecType(sdp::MediaType::kVideo, &found));
   ASSERT_TRUE(found); // for sanity, make sure we did find video codecs
 }
 
 TEST_F(JsepTrackTest, CheckVideoTrackWithHackedDtmfSdp)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   CreateOffer();
   // make sure we don't find sdp containing telephone-event in video track
   ASSERT_EQ(mOffer->ToString().find("a=rtpmap:101 telephone-event"),
             std::string::npos);
   // force audio codec telephone-event into video m= section of offer
   GetOffer().AddCodec("101", "telephone-event", 8000, 1);
   // make sure we _do_ find sdp containing telephone-event in video track
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:101 telephone-event"),
@@ -492,33 +492,33 @@ TEST_F(JsepTrackTest, CheckVideoTrackWit
   SanityCheck();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   // make sure we still don't find any audio codecs in the video track after
   // hacking the sdp
   bool found = false;
-  mSendOff.ForEachCodec(CheckForCodecType(SdpMediaSection::kAudio, &found));
+  mSendOff.ForEachCodec(CheckForCodecType(sdp::MediaType::kAudio, &found));
   ASSERT_FALSE(found);
-  mRecvOff.ForEachCodec(CheckForCodecType(SdpMediaSection::kAudio, &found));
+  mRecvOff.ForEachCodec(CheckForCodecType(sdp::MediaType::kAudio, &found));
   ASSERT_FALSE(found);
-  mSendAns.ForEachCodec(CheckForCodecType(SdpMediaSection::kAudio, &found));
+  mSendAns.ForEachCodec(CheckForCodecType(sdp::MediaType::kAudio, &found));
   ASSERT_FALSE(found);
-  mRecvAns.ForEachCodec(CheckForCodecType(SdpMediaSection::kAudio, &found));
+  mRecvAns.ForEachCodec(CheckForCodecType(sdp::MediaType::kAudio, &found));
   ASSERT_FALSE(found);
 }
 
 TEST_F(JsepTrackTest, AudioNegotiationOffererDtmf)
 {
   mOffCodecs.values = MakeCodecs(false, false, true);
   mAnsCodecs.values = MakeCodecs(false, false, false);
 
-  InitTracks(SdpMediaSection::kAudio);
-  InitSdp(SdpMediaSection::kAudio);
+  InitTracks(sdp::MediaType::kAudio);
+  InitSdp(sdp::MediaType::kAudio);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:101 telephone-event"),
             std::string::npos);
   ASSERT_EQ(mAnswer->ToString().find("a=rtpmap:101 telephone-event"),
@@ -538,18 +538,18 @@ TEST_F(JsepTrackTest, AudioNegotiationOf
   ASSERT_EQ("1", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, AudioNegotiationAnswererDtmf)
 {
   mOffCodecs.values = MakeCodecs(false, false, false);
   mAnsCodecs.values = MakeCodecs(false, false, true);
 
-  InitTracks(SdpMediaSection::kAudio);
-  InitSdp(SdpMediaSection::kAudio);
+  InitTracks(sdp::MediaType::kAudio);
+  InitSdp(sdp::MediaType::kAudio);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_EQ(mOffer->ToString().find("a=rtpmap:101 telephone-event"),
             std::string::npos);
   ASSERT_EQ(mAnswer->ToString().find("a=rtpmap:101 telephone-event"),
@@ -569,18 +569,18 @@ TEST_F(JsepTrackTest, AudioNegotiationAn
   ASSERT_EQ("1", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, AudioNegotiationOffererAnswererDtmf)
 {
   mOffCodecs.values = MakeCodecs(false, false, true);
   mAnsCodecs.values = MakeCodecs(false, false, true);
 
-  InitTracks(SdpMediaSection::kAudio);
-  InitSdp(SdpMediaSection::kAudio);
+  InitTracks(sdp::MediaType::kAudio);
+  InitSdp(sdp::MediaType::kAudio);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:101 telephone-event"),
             std::string::npos);
   ASSERT_NE(mAnswer->ToString().find("a=rtpmap:101 telephone-event"),
@@ -609,18 +609,18 @@ TEST_F(JsepTrackTest, AudioNegotiationOf
   ASSERT_EQ("101", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, AudioNegotiationDtmfOffererNoFmtpAnswererFmtp)
 {
   mOffCodecs.values = MakeCodecs(false, false, true);
   mAnsCodecs.values = MakeCodecs(false, false, true);
 
-  InitTracks(SdpMediaSection::kAudio);
-  InitSdp(SdpMediaSection::kAudio);
+  InitTracks(sdp::MediaType::kAudio);
+  InitSdp(sdp::MediaType::kAudio);
 
   CreateOffer();
   GetOffer().RemoveFmtp("101");
 
   CreateAnswer();
 
   Negotiate();
   SanityCheck();
@@ -656,18 +656,18 @@ TEST_F(JsepTrackTest, AudioNegotiationDt
   ASSERT_EQ("101", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, AudioNegotiationDtmfOffererFmtpAnswererNoFmtp)
 {
   mOffCodecs.values = MakeCodecs(false, false, true);
   mAnsCodecs.values = MakeCodecs(false, false, true);
 
-  InitTracks(SdpMediaSection::kAudio);
-  InitSdp(SdpMediaSection::kAudio);
+  InitTracks(sdp::MediaType::kAudio);
+  InitSdp(sdp::MediaType::kAudio);
 
   CreateOffer();
 
   CreateAnswer();
   GetAnswer().RemoveFmtp("101");
 
   Negotiate();
   SanityCheck();
@@ -703,18 +703,18 @@ TEST_F(JsepTrackTest, AudioNegotiationDt
   ASSERT_EQ("101", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, AudioNegotiationDtmfOffererNoFmtpAnswererNoFmtp)
 {
   mOffCodecs.values = MakeCodecs(false, false, true);
   mAnsCodecs.values = MakeCodecs(false, false, true);
 
-  InitTracks(SdpMediaSection::kAudio);
-  InitSdp(SdpMediaSection::kAudio);
+  InitTracks(sdp::MediaType::kAudio);
+  InitSdp(sdp::MediaType::kAudio);
 
   CreateOffer();
   GetOffer().RemoveFmtp("101");
 
   CreateAnswer();
   GetAnswer().RemoveFmtp("101");
 
   Negotiate();
@@ -751,18 +751,18 @@ TEST_F(JsepTrackTest, AudioNegotiationDt
   ASSERT_EQ("101", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, VideoNegotationOffererFEC)
 {
   mOffCodecs.values = MakeCodecs(true);
   mAnsCodecs.values = MakeCodecs(false);
 
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:122 red"), std::string::npos);
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:123 ulpfec"), std::string::npos);
   ASSERT_EQ(mAnswer->ToString().find("a=rtpmap:122 red"), std::string::npos);
@@ -782,18 +782,18 @@ TEST_F(JsepTrackTest, VideoNegotationOff
   ASSERT_EQ("120", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, VideoNegotationAnswererFEC)
 {
   mOffCodecs.values = MakeCodecs(false);
   mAnsCodecs.values = MakeCodecs(true);
 
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_EQ(mOffer->ToString().find("a=rtpmap:122 red"), std::string::npos);
   ASSERT_EQ(mOffer->ToString().find("a=rtpmap:123 ulpfec"), std::string::npos);
   ASSERT_EQ(mAnswer->ToString().find("a=rtpmap:122 red"), std::string::npos);
@@ -813,18 +813,18 @@ TEST_F(JsepTrackTest, VideoNegotationAns
   ASSERT_EQ("120", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, VideoNegotationOffererAnswererFEC)
 {
   mOffCodecs.values = MakeCodecs(true);
   mAnsCodecs.values = MakeCodecs(true);
 
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:122 red"), std::string::npos);
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:123 ulpfec"), std::string::npos);
   ASSERT_NE(mAnswer->ToString().find("a=rtpmap:122 red"), std::string::npos);
@@ -844,18 +844,18 @@ TEST_F(JsepTrackTest, VideoNegotationOff
   ASSERT_EQ("120", track->mDefaultPt);
 }
 
 TEST_F(JsepTrackTest, VideoNegotationOffererAnswererFECPreferred)
 {
   mOffCodecs.values = MakeCodecs(true, true);
   mAnsCodecs.values = MakeCodecs(true);
 
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:122 red"), std::string::npos);
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:123 ulpfec"), std::string::npos);
   ASSERT_NE(mAnswer->ToString().find("a=rtpmap:122 red"), std::string::npos);
@@ -879,18 +879,18 @@ TEST_F(JsepTrackTest, VideoNegotationOff
 TEST_F(JsepTrackTest, VideoNegotationOffererAnswererFECMismatch)
 {
   mOffCodecs.values = MakeCodecs(true, true);
   mAnsCodecs.values = MakeCodecs(true);
   // remove h264 from answer codecs
   ASSERT_EQ("H264", mAnsCodecs.values[3]->mName);
   mAnsCodecs.values.erase(mAnsCodecs.values.begin()+3);
 
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:122 red"), std::string::npos);
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:123 ulpfec"), std::string::npos);
   ASSERT_NE(mAnswer->ToString().find("a=rtpmap:122 red"), std::string::npos);
@@ -924,18 +924,18 @@ TEST_F(JsepTrackTest, VideoNegotationOff
       static_cast<JsepVideoCodecDescription*>(mOffCodecs.values[4]);
   ASSERT_EQ("red", red->mName);
   // rebuild the redundant encodings with our newly added "wacky" VP9
   red->mRedundantEncodings.clear();
   red->UpdateRedundantEncodings(mOffCodecs.values);
 
   mAnsCodecs.values = MakeCodecs(true);
 
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:122 red"), std::string::npos);
   ASSERT_NE(mOffer->ToString().find("a=rtpmap:123 ulpfec"), std::string::npos);
   ASSERT_NE(mAnswer->ToString().find("a=rtpmap:122 red"), std::string::npos);
@@ -945,18 +945,18 @@ TEST_F(JsepTrackTest, VideoNegotationOff
   ASSERT_NE(mAnswer->ToString().find("a=fmtp:122 120/126/123\r\n"), std::string::npos);
 }
 
 TEST_F(JsepTrackTest, VideoNegotiationOfferRemb)
 {
   InitCodecs();
   // enable remb on the offer codecs
   ((JsepVideoCodecDescription*)mOffCodecs.values[2])->EnableRemb();
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   // make sure REMB is on offer and not on answer
   ASSERT_NE(mOffer->ToString().find("a=rtcp-fb:120 goog-remb"),
             std::string::npos);
   ASSERT_EQ(mAnswer->ToString().find("a=rtcp-fb:120 goog-remb"),
             std::string::npos);
   CheckOffEncodingCount(1);
@@ -969,18 +969,18 @@ TEST_F(JsepTrackTest, VideoNegotiationOf
   CheckOtherFbsSize(mRecvOff, 0);
 }
 
 TEST_F(JsepTrackTest, VideoNegotiationAnswerRemb)
 {
   InitCodecs();
   // enable remb on the answer codecs
   ((JsepVideoCodecDescription*)mAnsCodecs.values[2])->EnableRemb();
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   // make sure REMB is not on offer and not on answer
   ASSERT_EQ(mOffer->ToString().find("a=rtcp-fb:120 goog-remb"),
             std::string::npos);
   ASSERT_EQ(mAnswer->ToString().find("a=rtcp-fb:120 goog-remb"),
             std::string::npos);
   CheckOffEncodingCount(1);
@@ -994,18 +994,18 @@ TEST_F(JsepTrackTest, VideoNegotiationAn
 }
 
 TEST_F(JsepTrackTest, VideoNegotiationOfferAnswerRemb)
 {
   InitCodecs();
   // enable remb on the offer and answer codecs
   ((JsepVideoCodecDescription*)mOffCodecs.values[2])->EnableRemb();
   ((JsepVideoCodecDescription*)mAnsCodecs.values[2])->EnableRemb();
-  InitTracks(SdpMediaSection::kVideo);
-  InitSdp(SdpMediaSection::kVideo);
+  InitTracks(sdp::MediaType::kVideo);
+  InitSdp(sdp::MediaType::kVideo);
   OfferAnswer();
 
   // make sure REMB is on offer and on answer
   ASSERT_NE(mOffer->ToString().find("a=rtcp-fb:120 goog-remb"),
             std::string::npos);
   ASSERT_NE(mAnswer->ToString().find("a=rtcp-fb:120 goog-remb"),
             std::string::npos);
   CheckOffEncodingCount(1);
@@ -1019,93 +1019,93 @@ TEST_F(JsepTrackTest, VideoNegotiationOf
   CheckOtherFbsSize(mSendAns, 1);
   CheckOtherFbsSize(mRecvOff, 1);
   CheckOtherFbExists(mSendAns, SdpRtcpFbAttributeList::kRemb);
   CheckOtherFbExists(mRecvOff, SdpRtcpFbAttributeList::kRemb);
 }
 
 TEST_F(JsepTrackTest, AudioOffSendonlyAnsRecvonly)
 {
-  Init(SdpMediaSection::kAudio);
+  Init(sdp::MediaType::kAudio);
   GetOffer().SetDirection(SdpDirectionAttribute::kSendonly);
   GetAnswer().SetDirection(SdpDirectionAttribute::kRecvonly);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(0);
 }
 
 TEST_F(JsepTrackTest, VideoOffSendonlyAnsRecvonly)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   GetOffer().SetDirection(SdpDirectionAttribute::kSendonly);
   GetAnswer().SetDirection(SdpDirectionAttribute::kRecvonly);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(0);
 }
 
 TEST_F(JsepTrackTest, AudioOffSendrecvAnsRecvonly)
 {
-  Init(SdpMediaSection::kAudio);
+  Init(sdp::MediaType::kAudio);
   GetAnswer().SetDirection(SdpDirectionAttribute::kRecvonly);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(0);
 }
 
 TEST_F(JsepTrackTest, VideoOffSendrecvAnsRecvonly)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   GetAnswer().SetDirection(SdpDirectionAttribute::kRecvonly);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(0);
 }
 
 TEST_F(JsepTrackTest, AudioOffRecvonlyAnsSendonly)
 {
-  Init(SdpMediaSection::kAudio);
+  Init(sdp::MediaType::kAudio);
   GetOffer().SetDirection(SdpDirectionAttribute::kRecvonly);
   GetAnswer().SetDirection(SdpDirectionAttribute::kSendonly);
   OfferAnswer();
   CheckOffEncodingCount(0);
   CheckAnsEncodingCount(1);
 }
 
 TEST_F(JsepTrackTest, VideoOffRecvonlyAnsSendonly)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   GetOffer().SetDirection(SdpDirectionAttribute::kRecvonly);
   GetAnswer().SetDirection(SdpDirectionAttribute::kSendonly);
   OfferAnswer();
   CheckOffEncodingCount(0);
   CheckAnsEncodingCount(1);
 }
 
 TEST_F(JsepTrackTest, AudioOffSendrecvAnsSendonly)
 {
-  Init(SdpMediaSection::kAudio);
+  Init(sdp::MediaType::kAudio);
   GetAnswer().SetDirection(SdpDirectionAttribute::kSendonly);
   OfferAnswer();
   CheckOffEncodingCount(0);
   CheckAnsEncodingCount(1);
 }
 
 TEST_F(JsepTrackTest, VideoOffSendrecvAnsSendonly)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   GetAnswer().SetDirection(SdpDirectionAttribute::kSendonly);
   OfferAnswer();
   CheckOffEncodingCount(0);
   CheckAnsEncodingCount(1);
 }
 
 TEST_F(JsepTrackTest, DataChannelDraft05)
 {
-  Init(SdpMediaSection::kApplication);
+  Init(sdp::MediaType::kApplication);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(std::string::npos,
             mOffer->ToString().find("a=sctpmap:5999 webrtc-datachannel 256"));
   ASSERT_NE(std::string::npos,
             mAnswer->ToString().find("a=sctpmap:5999 webrtc-datachannel 256"));
@@ -1127,18 +1127,18 @@ TEST_F(JsepTrackTest, DataChannelDraft05
   mOffCodecs.values.push_back(
           new JsepApplicationCodecDescription(
             "webrtc-datachannel",
             256,
             4555,
             10544
             ));
 
-  InitTracks(SdpMediaSection::kApplication);
-  InitSdp(SdpMediaSection::kApplication);
+  InitTracks(sdp::MediaType::kApplication);
+  InitSdp(sdp::MediaType::kApplication);
   OfferAnswer();
 
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 
   ASSERT_NE(std::string::npos,
             mOffer->ToString().find("a=sctpmap:4555 webrtc-datachannel 256"));
   ASSERT_NE(std::string::npos,
@@ -1151,29 +1151,29 @@ TEST_F(JsepTrackTest, DataChannelDraft05
   ASSERT_EQ(std::string::npos, mOffer->ToString().find("a=sctp-port"));
   ASSERT_EQ(std::string::npos, mAnswer->ToString().find("a=sctp-port"));
 }
 
 TEST_F(JsepTrackTest, DataChannelDraft21)
 {
   mOffCodecs.values = MakeCodecs(false, false, false);
   mAnsCodecs.values = MakeCodecs(false, false, false);
-  InitTracks(SdpMediaSection::kApplication);
+  InitTracks(sdp::MediaType::kApplication);
 
   mOffer.reset(new SipccSdp(SdpOrigin("", 0, 0, sdp::kIPv4, "")));
   mOffer->AddMediaSection(
-      SdpMediaSection::kApplication,
+      sdp::MediaType::kApplication,
       SdpDirectionAttribute::kSendrecv,
       0,
       SdpMediaSection::kUdpDtlsSctp,
       sdp::kIPv4,
       "0.0.0.0");
   mAnswer.reset(new SipccSdp(SdpOrigin("", 0, 0, sdp::kIPv4, "")));
   mAnswer->AddMediaSection(
-      SdpMediaSection::kApplication,
+      sdp::MediaType::kApplication,
       SdpDirectionAttribute::kSendrecv,
       0,
       SdpMediaSection::kUdpDtlsSctp,
       sdp::kIPv4,
       "0.0.0.0");
 
   OfferAnswer();
   CheckOffEncodingCount(1);
@@ -1193,41 +1193,41 @@ MakeConstraints(const std::string& rid, 
   JsepTrack::JsConstraints constraints;
   constraints.rid = rid;
   constraints.constraints.maxBr = maxBitrate;
   return constraints;
 }
 
 TEST_F(JsepTrackTest, SimulcastRejected)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   std::vector<JsepTrack::JsConstraints> constraints;
   constraints.push_back(MakeConstraints("foo", 40000));
   constraints.push_back(MakeConstraints("bar", 10000));
   mSendOff.SetJsConstraints(constraints);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 }
 
 TEST_F(JsepTrackTest, SimulcastPrevented)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   std::vector<JsepTrack::JsConstraints> constraints;
   constraints.push_back(MakeConstraints("foo", 40000));
   constraints.push_back(MakeConstraints("bar", 10000));
   mSendAns.SetJsConstraints(constraints);
   OfferAnswer();
   CheckOffEncodingCount(1);
   CheckAnsEncodingCount(1);
 }
 
 TEST_F(JsepTrackTest, SimulcastOfferer)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   std::vector<JsepTrack::JsConstraints> constraints;
   constraints.push_back(MakeConstraints("foo", 40000));
   constraints.push_back(MakeConstraints("bar", 10000));
   mSendOff.SetJsConstraints(constraints);
   CreateOffer();
   CreateAnswer();
   // Add simulcast/rid to answer
   mRecvAns.AddToMsection(
@@ -1248,17 +1248,17 @@ TEST_F(JsepTrackTest, SimulcastOfferer)
   ASSERT_NE(std::string::npos, mOffer->ToString().find("a=rid:foo send"));
   ASSERT_NE(std::string::npos, mOffer->ToString().find("a=rid:bar send"));
   ASSERT_NE(std::string::npos, mAnswer->ToString().find("a=rid:foo recv"));
   ASSERT_NE(std::string::npos, mAnswer->ToString().find("a=rid:bar recv"));
 }
 
 TEST_F(JsepTrackTest, SimulcastAnswerer)
 {
-  Init(SdpMediaSection::kVideo);
+  Init(sdp::MediaType::kVideo);
   std::vector<JsepTrack::JsConstraints> constraints;
   constraints.push_back(MakeConstraints("foo", 40000));
   constraints.push_back(MakeConstraints("bar", 10000));
   mSendAns.SetJsConstraints(constraints);
   CreateOffer();
   // Add simulcast/rid to offer
   mRecvOff.AddToMsection(
       constraints, sdp::kRecv, mSsrcGenerator, &GetOffer());
@@ -1308,17 +1308,17 @@ TEST_F(JsepTrackTest, SimulcastAnswerer)
       /* gtest has some compiler warnings when using ASSERT_EQ with booleans. */ \
       ASSERT_EQ((int)(expected), (int)audioCodec->mForceMono);  \
     }  \
   };  \
 }
 
 TEST_F(JsepTrackTest, DefaultOpusParameters)
 {
-  Init(SdpMediaSection::kAudio);
+  Init(sdp::MediaType::kAudio);
   OfferAnswer();
 
   VERIFY_OPUS_MAX_PLAYBACK_RATE(mSendOff,
       SdpFmtpAttributeList::OpusParameters::kDefaultMaxPlaybackRate);
   VERIFY_OPUS_MAX_PLAYBACK_RATE(mSendAns,
       SdpFmtpAttributeList::OpusParameters::kDefaultMaxPlaybackRate);
   VERIFY_OPUS_MAX_PLAYBACK_RATE(mRecvOff, 0U);
   VERIFY_OPUS_FORCE_MONO(mRecvOff, false);
@@ -1332,18 +1332,18 @@ TEST_F(JsepTrackTest, NonDefaultOpusPara
   for (auto& codec : mAnsCodecs.values) {
     if (codec->mName == "opus") {
       JsepAudioCodecDescription* audioCodec =
         static_cast<JsepAudioCodecDescription*>(codec);
       audioCodec->mMaxPlaybackRate = 16000;
       audioCodec->mForceMono = true;
     }
   }
-  InitTracks(SdpMediaSection::kAudio);
-  InitSdp(SdpMediaSection::kAudio);
+  InitTracks(sdp::MediaType::kAudio);
+  InitSdp(sdp::MediaType::kAudio);
   OfferAnswer();
 
   VERIFY_OPUS_MAX_PLAYBACK_RATE(mSendOff, 16000U);
   VERIFY_OPUS_FORCE_MONO(mSendOff, true);
   VERIFY_OPUS_MAX_PLAYBACK_RATE(mSendAns,
       SdpFmtpAttributeList::OpusParameters::kDefaultMaxPlaybackRate);
   VERIFY_OPUS_FORCE_MONO(mSendAns, false);
   VERIFY_OPUS_MAX_PLAYBACK_RATE(mRecvOff, 0U);
--- a/media/webrtc/signaling/gtest/sdp_unittests.cpp
+++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp
@@ -1747,17 +1747,17 @@ TEST_P(NewSdpTest, CheckGetBandwidth) {
 TEST_P(NewSdpTest, CheckGetMediaSectionsCount) {
   ParseSdp(kVideoSdp);
   ASSERT_EQ(1U, mSdp->GetMediaSectionCount())
     << "Wrong number of media sections";
 }
 
 TEST_P(NewSdpTest, CheckMediaSectionGetMediaType) {
   ParseSdp(kVideoSdp);
-  ASSERT_EQ(SdpMediaSection::kVideo, mSdp->GetMediaSection(0).GetMediaType())
+  ASSERT_EQ(sdp::MediaType::kVideo, mSdp->GetMediaSection(0).GetMediaType())
     << "Wrong type for first media section";
 }
 
 TEST_P(NewSdpTest, CheckMediaSectionGetProtocol) {
   ParseSdp(kVideoSdp);
   ASSERT_EQ(SdpMediaSection::kRtpSavpf, mSdp->GetMediaSection(0).GetProtocol())
     << "Wrong protocol for video";
 }
@@ -2090,42 +2090,42 @@ TEST_P(NewSdpTest, CheckNumberOfMediaSec
   ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
   ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
 }
 
 TEST_P(NewSdpTest, CheckMlines) {
   ParseSdp(kBasicAudioVideoOffer);
   ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
   ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
-  ASSERT_EQ(SdpMediaSection::kAudio, mSdp->GetMediaSection(0).GetMediaType())
+  ASSERT_EQ(sdp::MediaType::kAudio, mSdp->GetMediaSection(0).GetMediaType())
     << "Wrong type for first media section";
   ASSERT_EQ(SdpMediaSection::kRtpSavpf,
             mSdp->GetMediaSection(0).GetProtocol())
     << "Wrong protocol for audio";
   auto audio_formats = mSdp->GetMediaSection(0).GetFormats();
   ASSERT_EQ(5U, audio_formats.size()) << "Wrong number of formats for audio";
   ASSERT_EQ("109", audio_formats[0]);
   ASSERT_EQ("9",   audio_formats[1]);
   ASSERT_EQ("0",   audio_formats[2]);
   ASSERT_EQ("8",   audio_formats[3]);
   ASSERT_EQ("101", audio_formats[4]);
 
-  ASSERT_EQ(SdpMediaSection::kVideo, mSdp->GetMediaSection(1).GetMediaType())
+  ASSERT_EQ(sdp::MediaType::kVideo, mSdp->GetMediaSection(1).GetMediaType())
     << "Wrong type for second media section";
   ASSERT_EQ(SdpMediaSection::kRtpSavpf,
             mSdp->GetMediaSection(1).GetProtocol())
     << "Wrong protocol for video";
   auto video_formats = mSdp->GetMediaSection(1).GetFormats();
   ASSERT_EQ(4U, video_formats.size()) << "Wrong number of formats for video";
   ASSERT_EQ("120", video_formats[0]);
   ASSERT_EQ("121", video_formats[1]);
   ASSERT_EQ("122", video_formats[2]);
   ASSERT_EQ("123", video_formats[3]);
 
-  ASSERT_EQ(SdpMediaSection::kAudio, mSdp->GetMediaSection(2).GetMediaType())
+  ASSERT_EQ(sdp::MediaType::kAudio, mSdp->GetMediaSection(2).GetMediaType())
     << "Wrong type for third media section";
 }
 
 TEST_P(NewSdpTest, CheckSetup) {
   ParseSdp(kBasicAudioVideoOffer);
   ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
   ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
 
@@ -3059,21 +3059,21 @@ TEST_P(NewSdpTest, BasicAudioVideoDataSd
   ASSERT_EQ(0U, mSdpErrorHolder->GetParseErrors().size()) <<
     "Got parse errors: " << GetParseErrors();
 }
 
 TEST_P(NewSdpTest, CheckApplicationParameters) {
   ParseSdp(kBasicAudioVideoDataOffer);
   ASSERT_TRUE(!!mSdp);
   ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
-  ASSERT_EQ(SdpMediaSection::kAudio, mSdp->GetMediaSection(0).GetMediaType())
+  ASSERT_EQ(sdp::MediaType::kAudio, mSdp->GetMediaSection(0).GetMediaType())
     << "Wrong type for first media section";
-  ASSERT_EQ(SdpMediaSection::kVideo, mSdp->GetMediaSection(1).GetMediaType())
+  ASSERT_EQ(sdp::MediaType::kVideo, mSdp->GetMediaSection(1).GetMediaType())
     << "Wrong type for second media section";
-  ASSERT_EQ(SdpMediaSection::kApplication, mSdp->GetMediaSection(2).GetMediaType())
+  ASSERT_EQ(sdp::MediaType::kApplication, mSdp->GetMediaSection(2).GetMediaType())
     << "Wrong type for third media section";
 
   ASSERT_EQ(SdpMediaSection::kDtlsSctp,
             mSdp->GetMediaSection(2).GetProtocol())
     << "Wrong protocol for application";
   auto app_formats = mSdp->GetMediaSection(2).GetFormats();
   ASSERT_EQ(1U, app_formats.size()) << "Wrong number of formats for audio";
   ASSERT_EQ("5000", app_formats[0]);
@@ -3993,75 +3993,75 @@ TEST_P(NewSdpTest, CheckClearCodecs) {
 
 TEST_P(NewSdpTest, CheckAddMediaSection) {
   ParseSdp(kBasicAudioVideoOffer);
 
   ASSERT_TRUE(!!mSdp) << "Parse failed: " << GetParseErrors();
   ASSERT_EQ(3U, mSdp->GetMediaSectionCount())
     << "Wrong number of media sections";
 
-  mSdp->AddMediaSection(SdpMediaSection::kVideo,
+  mSdp->AddMediaSection(sdp::MediaType::kVideo,
                         SdpDirectionAttribute::Direction::kSendrecv,
                         58000, SdpMediaSection::kUdpDtlsSctp,sdp::kIPv4,
                         "127.0.0.1");
 
   ASSERT_EQ(4U, mSdp->GetMediaSectionCount())
     << "Wrong number of media sections after adding media section";
 
   const SdpMediaSection& newMediaSection = mSdp->GetMediaSection(3);
 
-  ASSERT_EQ(SdpMediaSection::kVideo, newMediaSection.GetMediaType());
+  ASSERT_EQ(sdp::MediaType::kVideo, newMediaSection.GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::Direction::kSendrecv,
             newMediaSection.GetDirectionAttribute().mValue);
   ASSERT_EQ(58000U, newMediaSection.GetPort());
   ASSERT_EQ(SdpMediaSection::kUdpDtlsSctp, newMediaSection.GetProtocol());
   ASSERT_EQ(sdp::kIPv4, newMediaSection.GetConnection().GetAddrType());
   ASSERT_EQ("127.0.0.1", newMediaSection.GetConnection().GetAddress());
 
 
-  mSdp->AddMediaSection(SdpMediaSection::kAudio,
+  mSdp->AddMediaSection(sdp::MediaType::kAudio,
                         SdpDirectionAttribute::Direction::kSendonly,
                         14006, SdpMediaSection::kTcpTlsRtpSavpf, sdp::kIPv6,
                         "2607:f8b0:4004:801::2013");
 
   ASSERT_EQ(5U, mSdp->GetMediaSectionCount())
     << "Wrong number of media sections after adding media section";
 
   const SdpMediaSection& nextNewMediaSection = mSdp->GetMediaSection(4);
 
-  ASSERT_EQ(SdpMediaSection::kAudio, nextNewMediaSection.GetMediaType());
+  ASSERT_EQ(sdp::MediaType::kAudio, nextNewMediaSection.GetMediaType());
   ASSERT_EQ(SdpDirectionAttribute::Direction::kSendonly,
             nextNewMediaSection.GetDirectionAttribute().mValue);
   ASSERT_EQ(14006U, nextNewMediaSection.GetPort());
   ASSERT_EQ(SdpMediaSection::kTcpTlsRtpSavpf,
             nextNewMediaSection.GetProtocol());
   ASSERT_EQ(sdp::kIPv6, nextNewMediaSection.GetConnection().GetAddrType());
   ASSERT_EQ("2607:f8b0:4004:801::2013",
             nextNewMediaSection.GetConnection().GetAddress());
 
   if(!IsParsingWithSipccParser()) {
     // All following AddMediaSection calls are expected to fail
     // SdpMediaSection::kDccpRtpAvp is expected to cause a failure
-    mSdp->AddMediaSection(SdpMediaSection::kAudio,
+    mSdp->AddMediaSection(sdp::MediaType::kAudio,
                           SdpDirectionAttribute::Direction::kSendonly,
                           14006, SdpMediaSection::kDccpRtpAvp, sdp::kIPv6,
                           "2607:f8b0:4004:801::2013");
     ASSERT_EQ(5U, mSdp->GetMediaSectionCount())
       << "Wrong number of media sections after adding media section";
 
     // sdp::kAddrTypeNone is expected to cause a failure
-    mSdp->AddMediaSection(SdpMediaSection::kAudio,
+    mSdp->AddMediaSection(sdp::MediaType::kAudio,
                           SdpDirectionAttribute::Direction::kSendonly,
                           14006, SdpMediaSection::kDtlsSctp, sdp::kAddrTypeNone,
                           "2607:f8b0:4004:801::2013");
     ASSERT_EQ(5U, mSdp->GetMediaSectionCount())
       << "Wrong number of media sections after adding media section";
 
     // "NOT:AN.IP.ADDRESS" is expected to cause a failure
-    mSdp->AddMediaSection(SdpMediaSection::kAudio,
+    mSdp->AddMediaSection(sdp::MediaType::kAudio,
                           SdpDirectionAttribute::Direction::kSendonly,
                           14006, SdpMediaSection::kTcpTlsRtpSavpf, sdp::kIPv6,
                           "NOT:AN.IP.ADDRESS");
     ASSERT_EQ(5U, mSdp->GetMediaSectionCount())
       << "Wrong number of media sections after adding media section";
   }
 }
 
--- a/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
+++ b/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
@@ -17,17 +17,17 @@ namespace mozilla {
   virtual JsepCodecDescription* Clone() const override                         \
   {                                                                            \
     return new T(*this);                                                       \
   }
 
 // A single entry in our list of known codecs.
 class JsepCodecDescription {
  public:
-  JsepCodecDescription(mozilla::SdpMediaSection::MediaType type,
+  JsepCodecDescription(sdp::MediaType type,
                        const std::string& defaultPt,
                        const std::string& name,
                        uint32_t clock,
                        uint32_t channels,
                        bool enabled)
       : mType(type),
         mDefaultPt(defaultPt),
         mName(name),
@@ -98,17 +98,17 @@ class JsepCodecDescription {
       }
 
       AddParametersToMSection(msection);
     }
   }
 
   virtual void AddParametersToMSection(SdpMediaSection& msection) const {}
 
-  mozilla::SdpMediaSection::MediaType mType;
+  sdp::MediaType mType;
   std::string mDefaultPt;
   std::string mName;
   uint32_t mClock;
   uint32_t mChannels;
   bool mEnabled;
   bool mStronglyPreferred;
   sdp::Direction mDirection;
   // Will hold constraints from both fmtp and rid
@@ -119,17 +119,17 @@ class JsepAudioCodecDescription : public
  public:
   JsepAudioCodecDescription(const std::string& defaultPt,
                             const std::string& name,
                             uint32_t clock,
                             uint32_t channels,
                             uint32_t packetSize,
                             uint32_t bitRate,
                             bool enabled = true)
-      : JsepCodecDescription(mozilla::SdpMediaSection::kAudio, defaultPt, name,
+      : JsepCodecDescription(sdp::MediaType::kAudio, defaultPt, name,
                              clock, channels, enabled),
         mPacketSize(packetSize),
         mBitrate(bitRate),
         mMaxPlaybackRate(0),
         mForceMono(false),
         mFECEnabled(false),
         mDtmfEnabled(false)
   {
@@ -226,17 +226,17 @@ class JsepAudioCodecDescription : public
 };
 
 class JsepVideoCodecDescription : public JsepCodecDescription {
  public:
   JsepVideoCodecDescription(const std::string& defaultPt,
                             const std::string& name,
                             uint32_t clock,
                             bool enabled = true)
-      : JsepCodecDescription(mozilla::SdpMediaSection::kVideo, defaultPt, name,
+      : JsepCodecDescription(sdp::MediaType::kVideo, defaultPt, name,
                              clock, 0, enabled),
         mTmmbrEnabled(false),
         mRembEnabled(false),
         mFECEnabled(false),
         mREDPayloadType(0),
         mULPFECPayloadType(0),
         mProfileLevelId(0),
         mPacketizationMode(0)
@@ -717,17 +717,17 @@ class JsepVideoCodecDescription : public
     }
     return false;
   }
 
   virtual void
   UpdateRedundantEncodings(std::vector<JsepCodecDescription*> codecs)
   {
     for (const auto codec : codecs) {
-      if (codec->mType == SdpMediaSection::kVideo &&
+      if (codec->mType == sdp::MediaType::kVideo &&
           codec->mEnabled &&
           codec->mName != "red") {
         uint16_t pt;
         if (!SdpHelper::GetPtAsInt(codec->mDefaultPt, &pt)) {
           continue;
         }
         mRedundantEncodings.push_back(pt);
       }
@@ -756,17 +756,17 @@ class JsepVideoCodecDescription : public
 class JsepApplicationCodecDescription : public JsepCodecDescription {
   // This is the new draft-21 implementation
  public:
   JsepApplicationCodecDescription(const std::string& name,
                                   uint16_t channels,
                                   uint16_t localPort,
                                   uint32_t localMaxMessageSize,
                                   bool enabled = true)
-      : JsepCodecDescription(mozilla::SdpMediaSection::kApplication, "",
+      : JsepCodecDescription(sdp::MediaType::kApplication, "",
                              name, 0, channels, enabled),
         mLocalPort(localPort),
         mLocalMaxMessageSize(localMaxMessageSize),
         mRemotePort(0),
         mRemoteMaxMessageSize(0),
         mRemoteMMSSet(false)
   {
   }
--- a/media/webrtc/signaling/src/jsep/JsepSession.h
+++ b/media/webrtc/signaling/src/jsep/JsepSession.h
@@ -198,29 +198,33 @@ public:
                                     "have-remote-pranswer", "closed" };
 
     return states[state];
   }
 
   virtual bool CheckNegotiationNeeded() const = 0;
 
   void
-  CountTracks(uint16_t (&receiving)[SdpMediaSection::kMediaTypes],
-              uint16_t (&sending)[SdpMediaSection::kMediaTypes]) const
+  CountTracks(uint16_t (&receiving)[sdp::kMediaTypes],
+              uint16_t (&sending)[sdp::kMediaTypes]) const
   {
     memset(receiving, 0, sizeof(receiving));
     memset(sending, 0, sizeof(sending));
 
     for (const auto& transceiver : GetTransceivers()) {
       if (!transceiver->mRecvTrack.GetTrackId().empty()) {
-        receiving[transceiver->mRecvTrack.GetMediaType()]++;
+        auto index =
+          static_cast<size_t>(transceiver->mRecvTrack.GetMediaType());
+        receiving[index]++;
       }
 
       if (!transceiver->mSendTrack.GetTrackId().empty()) {
-        sending[transceiver->mSendTrack.GetMediaType()]++;
+        auto index =
+          static_cast<size_t>(transceiver->mSendTrack.GetMediaType());
+        sending[index]++;
       }
     }
   }
 
 protected:
 
   const std::string mName;
   JsepSignalingState mState;
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -73,17 +73,17 @@ JsepSessionImpl::Init()
 }
 
 nsresult
 JsepSessionImpl::AddTransceiver(RefPtr<JsepTransceiver> transceiver)
 {
   mLastError.clear();
   MOZ_MTLOG(ML_DEBUG, "[" << mName << "]: Adding transceiver.");
 
-  if (transceiver->GetMediaType() != SdpMediaSection::kApplication) {
+  if (transceiver->GetMediaType() != sdp::MediaType::kApplication) {
     // Make sure we have an ssrc. Might already be set.
     transceiver->mSendTrack.EnsureSsrcs(mSsrcGenerator);
     transceiver->mSendTrack.SetCNAME(mCNAME);
 
     // Make sure we have identifiers for send track, just in case.
     // (man I hate this)
     if (transceiver->mSendTrack.GetTrackId().empty()) {
       std::string trackId;
@@ -292,17 +292,17 @@ JsepSessionImpl::CreateOfferMsection(con
 
   return NS_OK;
 }
 
 void
 JsepSessionImpl::SetupBundle(Sdp* sdp) const
 {
   std::vector<std::string> mids;
-  std::set<SdpMediaSection::MediaType> observedTypes;
+  std::set<sdp::MediaType> observedTypes;
 
   // This has the effect of changing the bundle level if the first m-section
   // goes from disabled to enabled. This is kinda inefficient.
 
   for (size_t i = 0; i < sdp->GetMediaSectionCount(); ++i) {
     auto& attrs = sdp->GetMediaSection(i).GetAttributeList();
     if ((sdp->GetMediaSection(i).GetPort() != 0) &&
         attrs.HasAttribute(SdpAttribute::kMidAttribute)) {
@@ -507,20 +507,20 @@ JsepSessionImpl::AddMid(const std::strin
 }
 
 std::vector<SdpExtmapAttributeList::Extmap>
 JsepSessionImpl::GetRtpExtensions(const SdpMediaSection& msection)
 {
   std::vector<SdpExtmapAttributeList::Extmap> result;
   JsepMediaType mediaType = JsepMediaType::kNone;
   switch (msection.GetMediaType()) {
-    case SdpMediaSection::kAudio:
+    case sdp::MediaType::kAudio:
       mediaType = JsepMediaType::kAudio;
       break;
-    case SdpMediaSection::kVideo:
+    case sdp::MediaType::kVideo:
       mediaType = JsepMediaType::kVideo;
       if (msection.GetAttributeList().HasAttribute(
             SdpAttribute::kRidAttribute)) {
         // We need RID support
         // TODO: Would it be worth checking that the direction is sane?
         AddVideoRtpExtension(webrtc::RtpExtension::kRtpStreamIdUri,
                              SdpDirectionAttribute::kSendonly);
       }
@@ -1098,32 +1098,32 @@ JsepSessionImpl::MakeNegotiatedTransceiv
   transceiver->mSendTrack.Negotiate(answer, remote);
 
   JsepTrack& recvTrack = transceiver->mRecvTrack;
   recvTrack.SetActive(receiving);
   recvTrack.Negotiate(answer, remote);
 
   if (transceiver->HasBundleLevel() &&
       recvTrack.GetSsrcs().empty() &&
-      recvTrack.GetMediaType() != SdpMediaSection::kApplication) {
+      recvTrack.GetMediaType() != sdp::MediaType::kApplication) {
     // TODO(bug 1105005): Once we have urn:ietf:params:rtp-hdrext:sdes:mid
     // support, we should only fire this warning if that extension was not
     // negotiated.
     MOZ_MTLOG(ML_ERROR, "[" << mName << "]: Bundled m-section has no ssrc "
                         "attributes. This may cause media packets to be "
                         "dropped.");
   }
 
   if (transceiver->mTransport->mComponents == 2) {
     // RTCP MUX or not.
     // TODO(bug 1095743): verify that the PTs are consistent with mux.
     MOZ_MTLOG(ML_DEBUG, "[" << mName << "]: RTCP-MUX is off");
   }
 
-  if (local.GetMediaType() != SdpMediaSection::kApplication) {
+  if (local.GetMediaType() != sdp::MediaType::kApplication) {
     Telemetry::Accumulate(Telemetry::WEBRTC_RTCP_MUX,
         transceiver->mTransport->mComponents == 1);
   }
 
   return NS_OK;
 }
 
 void
@@ -1346,18 +1346,18 @@ JsepSessionImpl::ParseSdp(const std::str
         mediaAttrs.GetSetup().mRole == SdpSetupAttribute::kHoldconn) {
       JSEP_SET_ERROR("Description has illegal setup attribute "
                      "\"holdconn\" in m-section at level "
                      << i);
       return NS_ERROR_INVALID_ARG;
     }
 
     static const std::bitset<128> forbidden = GetForbiddenSdpPayloadTypes();
-    if (msection.GetMediaType() == SdpMediaSection::kAudio ||
-        msection.GetMediaType() == SdpMediaSection::kVideo) {
+    if (msection.GetMediaType() == sdp::MediaType::kAudio ||
+        msection.GetMediaType() == sdp::MediaType::kVideo) {
       // Sanity-check that payload type can work with RTP
       for (const std::string& fmt : msection.GetFormats()) {
         uint16_t payloadType;
         if (!SdpHelper::GetPtAsInt(fmt, &payloadType)) {
           JSEP_SET_ERROR("Payload type \"" << fmt <<
                          "\" is not a 16-bit unsigned int at level " << i);
           return NS_ERROR_INVALID_ARG;
         }
@@ -1445,17 +1445,17 @@ JsepSessionImpl::GetTransceiverForLocal(
 
     return transceiver;
   }
 
   // There is no transceiver for |level| right now.
 
   // Look for an RTP transceiver
   for (RefPtr<JsepTransceiver>& transceiver : mTransceivers) {
-    if (transceiver->GetMediaType() != SdpMediaSection::kApplication &&
+    if (transceiver->GetMediaType() != sdp::MediaType::kApplication &&
         !transceiver->IsStopped() && !transceiver->HasLevel()) {
       transceiver->SetLevel(level);
       return transceiver.get();
     }
   }
 
   // Ok, look for a datachannel
   for (RefPtr<JsepTransceiver>& transceiver : mTransceivers) {
@@ -1517,17 +1517,17 @@ JsepSessionImpl::UpdateTransceiversFromR
       transceiver->Associate(msection.GetAttributeList().GetMid());
     } else {
       transceiver->Disassociate();
       // This cannot be rolled back.
       transceiver->Stop();
       continue;
     }
 
-    if (msection.GetMediaType() == SdpMediaSection::MediaType::kApplication) {
+    if (msection.GetMediaType() == sdp::MediaType::kApplication) {
       continue;
     }
 
     // Interop workaround for endpoints that don't support msid.
     // Ensures that there is a default track id set.
     // TODO(bug 1426005): Remove this
     if (msection.IsSending() && transceiver->mRecvTrack.GetTrackId().empty()) {
       std::vector<std::string> streamIds;
@@ -1554,17 +1554,17 @@ JsepSessionImpl::WasMsectionDisabledLast
     return mSdpHelper.MsectionIsDisabled(answer->GetMediaSection(level));
   }
 
   return false;
 }
 
 JsepTransceiver*
 JsepSessionImpl::FindUnassociatedTransceiver(
-    SdpMediaSection::MediaType type, bool magic)
+    sdp::MediaType type, bool magic)
 {
   // Look through transceivers that are not mapped to an m-section
   for (RefPtr<JsepTransceiver>& transceiver : mTransceivers) {
     if (!transceiver->IsStopped() &&
         !transceiver->HasLevel() &&
         (!magic || transceiver->HasAddTrackMagic()) &&
         (transceiver->GetMediaType() == type)) {
       return transceiver.get();
@@ -2360,17 +2360,17 @@ JsepSessionImpl::CheckNegotiationNeeded(
       continue;
     }
 
     if (!transceiver->HasLevel()) {
       MOZ_CRASH("Associated transceivers should always have a level.");
       continue;
     }
 
-    if (transceiver->GetMediaType() == SdpMediaSection::kApplication) {
+    if (transceiver->GetMediaType() == sdp::MediaType::kApplication) {
       continue;
     }
 
     size_t level = transceiver->GetLevel();
     const SdpMediaSection& local =
       mCurrentLocalDescription->GetMediaSection(level);
     const SdpMediaSection& remote =
       mCurrentRemoteDescription->GetMediaSection(level);
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.h
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.h
@@ -200,17 +200,17 @@ private:
   nsresult UpdateTransceiversFromRemoteDescription(const Sdp& remote);
   bool WasMsectionDisabledLastNegotiation(size_t level) const;
   JsepTransceiver* GetTransceiverForLevel(size_t level);
   JsepTransceiver* GetTransceiverForLocal(size_t level);
   JsepTransceiver* GetTransceiverForRemote(const SdpMediaSection& msection);
   // The w3c and IETF specs have a lot of "magical" behavior that happens when
   // addTrack is used. This was a deliberate design choice. Sadface.
   JsepTransceiver* FindUnassociatedTransceiver(
-      SdpMediaSection::MediaType type, bool magic);
+      sdp::MediaType type, bool magic);
   // Called for rollback of local description
   void RollbackLocalOffer();
   // Called for rollback of remote description
   void RollbackRemoteOffer();
   nsresult HandleNegotiatedSession(const UniquePtr<Sdp>& local,
                                    const UniquePtr<Sdp>& remote);
   nsresult AddTransportAttributes(SdpMediaSection* msection,
                                   SdpSetupAttribute::Role dtlsRole);
--- a/media/webrtc/signaling/src/jsep/JsepTrack.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepTrack.cpp
@@ -170,17 +170,17 @@ JsepTrack::AddToMsection(const std::vect
   MOZ_ASSERT(msection->GetMediaType() == mType);
   MOZ_ASSERT(!codecs.empty());
 
   for (const JsepCodecDescription* codec : codecs) {
     codec->AddToMediaSection(*msection);
   }
 
   if ((mDirection == sdp::kSend) &&
-      (mType != SdpMediaSection::kApplication) &&
+      (mType != sdp::MediaType::kApplication) &&
       msection->IsSending()) {
     if (mStreamIds.empty()) {
       msection->AddMsid("-", mTrackId);
     } else {
       for (const std::string& streamId : mStreamIds) {
         msection->AddMsid(streamId, mTrackId);
         // TODO(bug 1402912) Interop hack; older Firefox barfs if there is more
         // than one msid. Remove when safe.
@@ -206,17 +206,17 @@ JsepTrack::NegotiateRids(const std::vect
     }
   }
 }
 
 void
 JsepTrack::UpdateSsrcs(SsrcGenerator& ssrcGenerator, size_t encodings)
 {
   MOZ_ASSERT(mDirection == sdp::kSend);
-  MOZ_ASSERT(mType != SdpMediaSection::kApplication);
+  MOZ_ASSERT(mType != sdp::MediaType::kApplication);
   size_t numSsrcs = std::max<size_t>(encodings, 1U);
 
   // Right now, the spec does not permit changing the number of encodings after
   // the initial creation of the sender, so we don't need to worry about things
   // like a new encoding inserted in between two pre-existing encodings.
   while (mSsrcs.size() < numSsrcs) {
     uint32_t ssrc;
     if (!ssrcGenerator.GenerateSsrc(&ssrc)) {
@@ -254,17 +254,17 @@ JsepTrack::AddToMsection(const std::vect
     }
   }
 
   if (rids->mRids.size() > 1) {
     msection->GetAttributeList().SetAttribute(simulcast.release());
     msection->GetAttributeList().SetAttribute(rids.release());
   }
 
-  if (mType != SdpMediaSection::kApplication && mDirection == sdp::kSend) {
+  if (mType != sdp::MediaType::kApplication && mDirection == sdp::kSend) {
     UpdateSsrcs(ssrcGenerator, constraintsList.size());
     msection->SetSsrcs(mSsrcs, mCNAME);
   }
 }
 
 void
 JsepTrack::GetRids(const SdpMediaSection& msection,
                    sdp::Direction direction,
@@ -567,17 +567,17 @@ JsepTrack::Negotiate(const SdpMediaSecti
 void
 JsepTrack::SetUniquePayloadTypes(std::vector<JsepTrack*>& tracks)
 {
   // Maps to track details if no other track contains the payload type,
   // otherwise maps to nullptr.
   std::map<uint16_t, JsepTrackNegotiatedDetails*> payloadTypeToDetailsMap;
 
   for (JsepTrack* track : tracks) {
-    if (track->GetMediaType() == SdpMediaSection::kApplication) {
+    if (track->GetMediaType() == sdp::MediaType::kApplication) {
       continue;
     }
 
     auto* details = track->GetNegotiatedDetails();
     if (!details) {
       // Can happen if negotiation fails on a track
       continue;
     }
--- a/media/webrtc/signaling/src/jsep/JsepTrack.h
+++ b/media/webrtc/signaling/src/jsep/JsepTrack.h
@@ -89,17 +89,17 @@ private:
   std::vector<uint8_t> mUniquePayloadTypes;
   PtrVector<JsepTrackEncoding> mEncodings;
   uint32_t mTias; // bits per second
 };
 
 class JsepTrack
 {
 public:
-  JsepTrack(mozilla::SdpMediaSection::MediaType type,
+  JsepTrack(sdp::MediaType type,
             sdp::Direction direction)
       : mType(type),
         mDirection(direction),
         mActive(false),
         mRemoteSetSendBit(false)
   {
   }
 
@@ -117,17 +117,17 @@ public:
     mStreamIds.clear();
     mTrackId.clear();
   }
 
   void UpdateRecvTrack(const Sdp& sdp, const SdpMediaSection& msection)
   {
     MOZ_ASSERT(mDirection == sdp::kRecv);
     MOZ_ASSERT(
-        msection.GetMediaType() != SdpMediaSection::MediaType::kApplication);
+        msection.GetMediaType() != sdp::MediaType::kApplication);
     std::string error;
     SdpHelper helper(&error);
 
     mRemoteSetSendBit = msection.IsSending();
 
     if (msection.IsSending()) {
       (void)helper.GetIdsFromMsid(sdp, msection, &mStreamIds, &mTrackId);
     } else {
@@ -172,17 +172,17 @@ public:
       if (rhs.mNegotiatedDetails) {
         mNegotiatedDetails.reset(
           new JsepTrackNegotiatedDetails(*rhs.mNegotiatedDetails));
       }
     }
     return *this;
   }
 
-  virtual mozilla::SdpMediaSection::MediaType
+  virtual sdp::MediaType
   GetMediaType() const
   {
     return mType;
   }
 
   virtual const std::vector<std::string>&
   GetStreamIds() const
   {
@@ -343,17 +343,17 @@ private:
 
   JsConstraints* FindConstraints(
       const std::string& rid,
       std::vector<JsConstraints>& constraintsList) const;
   void NegotiateRids(const std::vector<SdpRidAttributeList::Rid>& rids,
                      std::vector<JsConstraints>* constraints) const;
   void UpdateSsrcs(SsrcGenerator& ssrcGenerator, size_t encodings);
 
-  mozilla::SdpMediaSection::MediaType mType;
+  sdp::MediaType mType;
   // These are the ids that everyone outside of JsepSession care about
   std::vector<std::string> mStreamIds;
   std::string mTrackId;
   std::string mCNAME;
   sdp::Direction mDirection;
   PtrVector<JsepCodecDescription> mPrototypeCodecs;
   // Holds encoding params/constraints from JS. Simulcast happens when there are
   // multiple of these. If there are none, we assume unconstrained unicast with
--- a/media/webrtc/signaling/src/jsep/JsepTransceiver.h
+++ b/media/webrtc/signaling/src/jsep/JsepTransceiver.h
@@ -19,17 +19,17 @@
 
 namespace mozilla {
 
 class JsepTransceiver {
   private:
     ~JsepTransceiver() {};
 
   public:
-    explicit JsepTransceiver(SdpMediaSection::MediaType type,
+    explicit JsepTransceiver(sdp::MediaType type,
                              SdpDirectionAttribute::Direction jsDirection =
                                  SdpDirectionAttribute::kSendrecv) :
       mJsDirection(jsDirection),
       mSendTrack(type, sdp::kSend),
       mRecvTrack(type, sdp::kRecv),
       mTransport(*(new JsepTransport)),
       mLevel(SIZE_MAX),
       mBundleLevel(SIZE_MAX),
@@ -197,17 +197,17 @@ class JsepTransceiver {
     }
 
     bool IsNegotiated() const
     {
       return mNegotiated;
     }
 
     // Convenience function
-    SdpMediaSection::MediaType GetMediaType() const
+    sdp::MediaType GetMediaType() const
     {
       return mRecvTrack.GetMediaType();
     }
 
     // This is the direction JS wants. It might not actually happen.
     SdpDirectionAttribute::Direction mJsDirection;
 
     JsepTrack mSendTrack;
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -874,28 +874,28 @@ class ConfigureCodec {
       // media.peerconnection.dtmf.enabled controls both sdp generation for
       // DTMF support as well as DTMF exposure to DOM
       branch->GetBoolPref("media.peerconnection.dtmf.enabled", &mDtmfEnabled);
     }
 
     void operator()(JsepCodecDescription* codec) const
     {
       switch (codec->mType) {
-        case SdpMediaSection::kAudio:
+        case sdp::MediaType::kAudio:
           {
             JsepAudioCodecDescription& audioCodec =
               static_cast<JsepAudioCodecDescription&>(*codec);
             if (audioCodec.mName == "opus") {
               audioCodec.mFECEnabled = mUseAudioFec;
             } else if (audioCodec.mName == "telephone-event") {
               audioCodec.mEnabled = mDtmfEnabled;
             }
           }
           break;
-        case SdpMediaSection::kVideo:
+        case sdp::MediaType::kVideo:
           {
             JsepVideoCodecDescription& videoCodec =
               static_cast<JsepVideoCodecDescription&>(*codec);
 
             if (videoCodec.mName == "H264") {
               // Override level
               videoCodec.mProfileLevelId &= 0xFFFF00;
               videoCodec.mProfileLevelId |= mH264Level;
@@ -937,19 +937,19 @@ class ConfigureCodec {
             if (mUseTmmbr) {
               videoCodec.EnableTmmbr();
             }
             if (mUseRemb) {
               videoCodec.EnableRemb();
             }
           }
           break;
-        case SdpMediaSection::kText:
-        case SdpMediaSection::kApplication:
-        case SdpMediaSection::kMessage:
+        case sdp::MediaType::kText:
+        case sdp::MediaType::kApplication:
+        case sdp::MediaType::kMessage:
           {} // Nothing to configure for these.
       }
     }
 
   private:
     bool mHardwareH264Supported;
     bool mSoftwareH264Enabled;
     bool mH264Enabled;
@@ -975,17 +975,17 @@ class ConfigureRedCodec {
     {
       // if we wanted to override or modify which encodings are considered
       // for redundant encodings, we'd probably want to handle it here by
       // checking prefs modifying the operator() code below
     }
 
     void operator()(JsepCodecDescription* codec) const
     {
-      if (codec->mType == SdpMediaSection::kVideo &&
+      if (codec->mType == sdp::MediaType::kVideo &&
           codec->mEnabled == false) {
         uint8_t pt = (uint8_t)strtoul(codec->mDefaultPt.c_str(), nullptr, 10);
         // don't search for the codec payload type unless we have a valid
         // conversion (non-zero)
         if (pt != 0) {
           std::vector<uint8_t>::iterator it =
             std::find(mRedundantEncodings->begin(),
                       mRedundantEncodings->end(),
@@ -1096,32 +1096,32 @@ PeerConnectionImpl::GetDatachannelParame
     uint16_t* localport,
     uint16_t* remoteport,
     uint32_t* remotemaxmessagesize,
     bool*     mmsset,
     uint16_t* level) const {
 
   for (const auto& transceiver : mJsepSession->GetTransceivers()) {
     bool dataChannel =
-      transceiver->GetMediaType() == SdpMediaSection::kApplication;
+      transceiver->GetMediaType() == sdp::MediaType::kApplication;
 
     if (dataChannel && transceiver->mSendTrack.GetNegotiatedDetails()) {
       // This will release assert if there is no such index, and that's ok
       const JsepTrackEncoding& encoding =
         transceiver->mSendTrack.GetNegotiatedDetails()->GetEncoding(0);
 
       if (encoding.GetCodecs().empty()) {
         CSFLogError(LOGTAG, "%s: Negotiated m=application with no codec. "
                             "This is likely to be broken.",
                             __FUNCTION__);
         return NS_ERROR_FAILURE;
       }
 
       for (const JsepCodecDescription* codec : encoding.GetCodecs()) {
-        if (codec->mType != SdpMediaSection::kApplication) {
+        if (codec->mType != sdp::MediaType::kApplication) {
           CSFLogError(LOGTAG, "%s: Codec type for m=application was %u, this "
                               "is a bug.",
                               __FUNCTION__,
                               static_cast<unsigned>(codec->mType));
           MOZ_ASSERT(false, "Codec for m=application was not \"application\"");
           return NS_ERROR_FAILURE;
         }
 
@@ -1176,17 +1176,17 @@ PeerConnectionImpl::AddRtpTransceiverToJ
   }
 
   res = mJsepSession->AddTransceiver(transceiver);
 
   if (NS_FAILED(res)) {
     std::string errorString = mJsepSession->GetLastError();
     CSFLogError(LOGTAG, "%s (%s) : pc = %s, error = %s",
                 __FUNCTION__,
-                transceiver->GetMediaType() == SdpMediaSection::kAudio ?
+                transceiver->GetMediaType() == sdp::MediaType::kAudio ?
                   "audio" : "video",
                 mHandle.c_str(),
                 errorString.c_str());
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
@@ -1216,21 +1216,21 @@ PeerConnectionImpl::CreateTransceiverImp
 }
 
 already_AddRefed<TransceiverImpl>
 PeerConnectionImpl::CreateTransceiverImpl(
     const nsAString& aKind,
     dom::MediaStreamTrack* aSendTrack,
     ErrorResult& jrv)
 {
-  SdpMediaSection::MediaType type;
+  sdp::MediaType type;
   if (aKind.EqualsASCII("audio")) {
-    type = SdpMediaSection::MediaType::kAudio;
+    type = sdp::MediaType::kAudio;
   } else if (aKind.EqualsASCII("video")) {
-    type = SdpMediaSection::MediaType::kVideo;
+    type = sdp::MediaType::kVideo;
   } else {
     MOZ_ASSERT(false);
     jrv = NS_ERROR_INVALID_ARG;
     return nullptr;
   }
 
   RefPtr<JsepTransceiver> jsepTransceiver = new JsepTransceiver(type);
 
@@ -1359,17 +1359,17 @@ PeerConnectionImpl::CreateDataChannel(co
     nullptr, nullptr, aExternalNegotiated, aStream
   );
   NS_ENSURE_TRUE(dataChannel,NS_ERROR_FAILURE);
 
   CSFLogDebug(LOGTAG, "%s: making DOMDataChannel", __FUNCTION__);
 
   if (!mHaveDataStream) {
     mJsepSession->AddTransceiver(
-        new JsepTransceiver(SdpMediaSection::MediaType::kApplication));
+        new JsepTransceiver(sdp::MediaType::kApplication));
     mHaveDataStream = true;
   }
   RefPtr<nsDOMDataChannel> retval;
   rv = NS_NewDOMDataChannel(dataChannel.forget(), mWindow,
 			    getter_AddRefs(retval));
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -1890,36 +1890,36 @@ PeerConnectionImpl::SetRemoteDescription
     // Iterate over the JSEP transceivers that were just created
     for (size_t i = originalTransceiverCount;
          i < mJsepSession->GetTransceivers().size();
          ++i) {
       RefPtr<JsepTransceiver> jsepTransceiver =
         mJsepSession->GetTransceivers()[i];
 
       if (jsepTransceiver->GetMediaType() ==
-          SdpMediaSection::MediaType::kApplication) {
+          sdp::MediaType::kApplication) {
         continue;
       }
 
       // Audio or video transceiver, need to tell JS about it.
       RefPtr<TransceiverImpl> transceiverImpl =
         CreateTransceiverImpl(jsepTransceiver, nullptr, jrv);
       if (jrv.Failed()) {
         return NS_ERROR_FAILURE;
       }
 
       const JsepTrack& receiving(jsepTransceiver->mRecvTrack);
       CSFLogInfo(LOGTAG, "%s: pc = %s, asking JS to create transceiver for %s",
                   __FUNCTION__, mHandle.c_str(), receiving.GetTrackId().c_str());
       switch (receiving.GetMediaType()) {
-        case SdpMediaSection::MediaType::kAudio:
+        case sdp::MediaType::kAudio:
           pco->OnTransceiverNeeded(
               NS_ConvertASCIItoUTF16("audio"), *transceiverImpl, jrv);
           break;
-        case SdpMediaSection::MediaType::kVideo:
+        case sdp::MediaType::kVideo:
           pco->OnTransceiverNeeded(
               NS_ConvertASCIItoUTF16("video"), *transceiverImpl, jrv);
           break;
         default:
           MOZ_RELEASE_ASSERT(false);
       }
 
       if (jrv.Failed()) {
@@ -2332,19 +2332,19 @@ static int GetDTMFToneCode(uint16_t c)
   }
 
   const char* i = strchr(DTMF_TONECODES, c);
   MOZ_ASSERT(i);
   return i - DTMF_TONECODES;
 }
 
 OwningNonNull<dom::MediaStreamTrack>
-PeerConnectionImpl::CreateReceiveTrack(SdpMediaSection::MediaType type)
+PeerConnectionImpl::CreateReceiveTrack(sdp::MediaType type)
 {
-  bool audio = (type == SdpMediaSection::MediaType::kAudio);
+  bool audio = (type == sdp::MediaType::kAudio);
 
   MediaStreamGraph* graph = MediaStreamGraph::GetInstance(
       audio ?
         MediaStreamGraph::AUDIO_THREAD_DRIVER :
         MediaStreamGraph::SYSTEM_THREAD_DRIVER,
       GetWindow(),
       MediaStreamGraph::REQUEST_DEFAULT_SAMPLE_RATE);
 
@@ -2714,39 +2714,42 @@ PeerConnectionImpl::RecordEndOfCallTelem
   static const uint32_t kVideoTypeMask = 2;
   static const uint32_t kDataChannelTypeMask = 4;
 
   // Report end-of-call Telemetry
   if (mJsepSession->GetNegotiations() > 0) {
     Telemetry::Accumulate(Telemetry::WEBRTC_RENEGOTIATIONS,
                           mJsepSession->GetNegotiations()-1);
   }
+  constexpr auto videoIndex = static_cast<size_t>(sdp::MediaType::kVideo);
+  constexpr auto audioIndex = static_cast<size_t>(sdp::MediaType::kAudio);
+  constexpr auto appIndex = static_cast<size_t>(sdp::MediaType::kApplication);
   Telemetry::Accumulate(Telemetry::WEBRTC_MAX_VIDEO_SEND_TRACK,
-                        mMaxSending[SdpMediaSection::MediaType::kVideo]);
+                        mMaxSending[videoIndex]);
   Telemetry::Accumulate(Telemetry::WEBRTC_MAX_VIDEO_RECEIVE_TRACK,
-                        mMaxReceiving[SdpMediaSection::MediaType::kVideo]);
+                        mMaxReceiving[videoIndex]);
   Telemetry::Accumulate(Telemetry::WEBRTC_MAX_AUDIO_SEND_TRACK,
-                        mMaxSending[SdpMediaSection::MediaType::kAudio]);
+                        mMaxSending[audioIndex]);
   Telemetry::Accumulate(Telemetry::WEBRTC_MAX_AUDIO_RECEIVE_TRACK,
-                        mMaxReceiving[SdpMediaSection::MediaType::kAudio]);
+                        mMaxReceiving[audioIndex]);
   // DataChannels appear in both Sending and Receiving
   Telemetry::Accumulate(Telemetry::WEBRTC_DATACHANNEL_NEGOTIATED,
-                        mMaxSending[SdpMediaSection::MediaType::kApplication]);
+                        mMaxSending[appIndex]);
   // Enumerated/bitmask: 1 = Audio, 2 = Video, 4 = DataChannel
   // A/V = 3, A/V/D = 7, etc
   uint32_t type = 0;
-  if (mMaxSending[SdpMediaSection::MediaType::kAudio] ||
-      mMaxReceiving[SdpMediaSection::MediaType::kAudio]) {
+  if (mMaxSending[audioIndex] ||
+      mMaxReceiving[audioIndex]) {
     type = kAudioTypeMask;
   }
-  if (mMaxSending[SdpMediaSection::MediaType::kVideo] ||
-      mMaxReceiving[SdpMediaSection::MediaType::kVideo]) {
+  if (mMaxSending[videoIndex] ||
+      mMaxReceiving[videoIndex]) {
     type |= kVideoTypeMask;
   }
-  if (mMaxSending[SdpMediaSection::MediaType::kApplication]) {
+  if (mMaxSending[audioIndex]) {
     type |= kDataChannelTypeMask;
   }
   Telemetry::Accumulate(Telemetry::WEBRTC_CALL_TYPE,
                         type);
 }
 
 nsresult
 PeerConnectionImpl::CloseInt()
@@ -2856,20 +2859,20 @@ PeerConnectionImpl::SetSignalingState_m(
       InitializeDataChannel();
       mMedia->StartIceChecks(*mJsepSession);
     }
 
     // Telemetry: record info on the current state of streams/renegotiations/etc
     // Note: this code gets run on rollbacks as well!
 
     // Update the max channels used with each direction for each type
-    uint16_t receiving[SdpMediaSection::kMediaTypes];
-    uint16_t sending[SdpMediaSection::kMediaTypes];
+    uint16_t receiving[sdp::kMediaTypes];
+    uint16_t sending[sdp::kMediaTypes];
     mJsepSession->CountTracks(receiving, sending);
-    for (size_t i = 0; i < SdpMediaSection::kMediaTypes; i++) {
+    for (size_t i = 0; i < sdp::kMediaTypes; i++) {
       if (mMaxReceiving[i] < receiving[i]) {
         mMaxReceiving[i] = receiving[i];
       }
       if (mMaxSending[i] < sending[i]) {
         mMaxSending[i] = sending[i];
       }
     }
   }
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -394,17 +394,17 @@ public:
   }
 
   already_AddRefed<TransceiverImpl> CreateTransceiverImpl(
       const nsAString& aKind,
       dom::MediaStreamTrack* aSendTrack,
       ErrorResult& rv);
 
   OwningNonNull<dom::MediaStreamTrack> CreateReceiveTrack(
-      SdpMediaSection::MediaType type);
+      sdp::MediaType type);
 
   bool CheckNegotiationNeeded(ErrorResult &rv);
 
   NS_IMETHODIMP_TO_ERRORRESULT(InsertDTMF, ErrorResult &rv,
                                TransceiverImpl& transceiver,
                                const nsAString& tones,
                                uint32_t duration, uint32_t interToneGap) {
     rv = InsertDTMF(transceiver, tones, duration, interToneGap);
@@ -812,18 +812,18 @@ private:
   bool mTrickle;
 
   bool mPrivateWindow;
 
   // Whether this PeerConnection is being counted as active by mWindow
   bool mActiveOnWindow;
 
   // storage for Telemetry data
-  uint16_t mMaxReceiving[SdpMediaSection::kMediaTypes];
-  uint16_t mMaxSending[SdpMediaSection::kMediaTypes];
+  uint16_t mMaxReceiving[sdp::kMediaTypes];
+  uint16_t mMaxSending[sdp::kMediaTypes];
 
   // DTMF
   class DTMFState : public nsITimerCallback {
       virtual ~DTMFState();
     public:
       DTMFState();
 
       NS_DECL_NSITIMERCALLBACK
--- a/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
@@ -660,18 +660,18 @@ GetCodecs(const JsepTrackNegotiatedDetai
   }
   return std::vector<JsepCodecDescription*>();
 }
 
 static nsresult
 JsepCodecDescToAudioCodecConfig(const JsepCodecDescription& aCodec,
                                 AudioCodecConfig** aConfig)
 {
-  MOZ_ASSERT(aCodec.mType == SdpMediaSection::kAudio);
-  if (aCodec.mType != SdpMediaSection::kAudio)
+  MOZ_ASSERT(aCodec.mType == sdp::MediaType::kAudio);
+  if (aCodec.mType != sdp::MediaType::kAudio)
     return NS_ERROR_INVALID_ARG;
 
   const JsepAudioCodecDescription& desc =
       static_cast<const JsepAudioCodecDescription&>(aCodec);
 
   uint16_t pt;
 
   if (!desc.GetPtAsInt(&pt)) {
@@ -775,18 +775,18 @@ TransceiverImpl::UpdateAudioConduit()
 
   return NS_OK;
 }
 
 static nsresult
 JsepCodecDescToVideoCodecConfig(const JsepCodecDescription& aCodec,
                                 VideoCodecConfig** aConfig)
 {
-  MOZ_ASSERT(aCodec.mType == SdpMediaSection::kVideo);
-  if (aCodec.mType != SdpMediaSection::kVideo) {
+  MOZ_ASSERT(aCodec.mType == sdp::MediaType::kVideo);
+  if (aCodec.mType != sdp::MediaType::kVideo) {
     MOZ_ASSERT(false, "JsepCodecDescription has wrong type");
     return NS_ERROR_INVALID_ARG;
   }
 
   const JsepVideoCodecDescription& desc =
       static_cast<const JsepVideoCodecDescription&>(aCodec);
 
   uint16_t pt;
@@ -1012,17 +1012,17 @@ TransceiverImpl::Stop()
   // Make sure that stats queries stop working on this transceiver.
   UpdateSendTrack(nullptr);
   mHaveStartedReceiving = false;
 }
 
 bool
 TransceiverImpl::IsVideo() const
 {
-  return mJsepTransceiver->GetMediaType() == SdpMediaSection::MediaType::kVideo;
+  return mJsepTransceiver->GetMediaType() == sdp::MediaType::kVideo;
 }
 
 void TransceiverImpl::GetRtpSources(const int64_t aTimeNow,
     nsTArray<dom::RTCRtpSourceEntry>& outSources) const
 {
   if (IsVideo()) {
     return;
   }
--- a/media/webrtc/signaling/src/sdp/RsdparsaSdp.cpp
+++ b/media/webrtc/signaling/src/sdp/RsdparsaSdp.cpp
@@ -75,25 +75,26 @@ RsdparsaSdp::GetMediaSection(size_t leve
 {
   if (level > mMediaSections.values.size()) {
     MOZ_CRASH();
   }
   return *mMediaSections.values[level];
 }
 
 SdpMediaSection&
-RsdparsaSdp::AddMediaSection(SdpMediaSection::MediaType mediaType,
+RsdparsaSdp::AddMediaSection(sdp::MediaType mediaType,
                              SdpDirectionAttribute::Direction dir,
                              uint16_t port,
                              SdpMediaSection::Protocol protocol,
                              sdp::AddrType addrType, const std::string& addr)
 {
   StringView rustAddr{addr.c_str(),addr.size()};
-  auto nr = sdp_add_media_section(mSession.get(),mediaType,dir,port,
-                                                 protocol,addrType,rustAddr);
+  auto mediaTypeInt = static_cast<uint32_t>(mediaType);
+  auto nr = sdp_add_media_section(mSession.get(), mediaTypeInt, dir, port,
+                                                 protocol, addrType, rustAddr);
 
   if (NS_SUCCEEDED(nr)) {
     std::cout << "Hello World" << std::endl;
     size_t level = mMediaSections.values.size();
     RsdparsaSessionHandle newSessHandle(sdp_new_reference(mSession.get()));
 
     auto rustMediaSection = sdp_get_media_section(mSession.get(), level);
     auto mediaSection = new RsdparsaSdpMediaSection(level,
--- a/media/webrtc/signaling/src/sdp/RsdparsaSdp.h
+++ b/media/webrtc/signaling/src/sdp/RsdparsaSdp.h
@@ -57,17 +57,17 @@ public:
   }
 
   const SdpMediaSection& GetMediaSection(size_t level) const
       override;
 
   SdpMediaSection& GetMediaSection(size_t level) override;
 
   SdpMediaSection& AddMediaSection(
-      SdpMediaSection::MediaType media, SdpDirectionAttribute::Direction dir,
+      sdp::MediaType media, SdpDirectionAttribute::Direction dir,
       uint16_t port, SdpMediaSection::Protocol proto, sdp::AddrType addrType,
       const std::string& addr) override;
 
   void Serialize(std::ostream&) const override;
 
 private:
   RsdparsaSdp() : mOrigin("", 0, 0, sdp::kIPv4, "") {}
 
--- a/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.cpp
+++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.cpp
@@ -26,23 +26,23 @@ namespace mozilla
 RsdparsaSdpMediaSection::RsdparsaSdpMediaSection(size_t level,
       RsdparsaSessionHandle session, const RustMediaSection* const section,
       const RsdparsaSdpAttributeList* sessionLevel)
   : SdpMediaSection(level), mSession(std::move(session)),
     mSection(section)
 {
   switch(sdp_rust_get_media_type(section)) {
     case RustSdpMediaValue::kRustAudio:
-      mMediaType = kAudio;
+      mMediaType = sdp::MediaType::kAudio;
       break;
     case RustSdpMediaValue::kRustVideo:
-      mMediaType = kVideo;
+      mMediaType = sdp::MediaType::kVideo;
       break;
     case RustSdpMediaValue::kRustApplication:
-      mMediaType = kApplication;
+      mMediaType = sdp::MediaType::kApplication;
       break;
   }
 
   RsdparsaSessionHandle attributeSession(sdp_new_reference(mSession.get()));
   mAttributeList.reset(new RsdparsaSdpAttributeList(std::move(attributeSession),
                                                     section,
                                                     sessionLevel));
 
--- a/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.h
+++ b/media/webrtc/signaling/src/sdp/RsdparsaSdpMediaSection.h
@@ -24,17 +24,17 @@ class SdpErrorHolder;
 
 class RsdparsaSdpMediaSection final : public SdpMediaSection
 {
   friend class RsdparsaSdp;
 
 public:
   ~RsdparsaSdpMediaSection() {}
 
-  MediaType
+  sdp::MediaType
   GetMediaType() const override
   {
     return mMediaType;
   }
 
   unsigned int GetPort() const override;
   void SetPort(unsigned int port) override;
   unsigned int GetPortCount() const override;
@@ -64,17 +64,17 @@ private:
                           const RsdparsaSdpAttributeList* sessionLevel);
 
   void LoadFormats();
   void LoadConnection();
 
   RsdparsaSessionHandle mSession;
   const RustMediaSection* mSection;
 
-  MediaType mMediaType;
+  sdp::MediaType mMediaType;
   std::vector<std::string> mFormats;
 
   UniquePtr<SdpConnection> mConnection;
 
   UniquePtr<RsdparsaSdpAttributeList> mAttributeList;
 };
 }
 
--- a/media/webrtc/signaling/src/sdp/Sdp.h
+++ b/media/webrtc/signaling/src/sdp/Sdp.h
@@ -94,17 +94,17 @@ public:
 
   virtual const SdpAttributeList& GetAttributeList() const = 0;
   virtual SdpAttributeList& GetAttributeList() = 0;
 
   virtual size_t GetMediaSectionCount() const = 0;
   virtual const SdpMediaSection& GetMediaSection(size_t level) const = 0;
   virtual SdpMediaSection& GetMediaSection(size_t level) = 0;
 
-  virtual SdpMediaSection& AddMediaSection(SdpMediaSection::MediaType media,
+  virtual SdpMediaSection& AddMediaSection(sdp::MediaType media,
                                            SdpDirectionAttribute::Direction dir,
                                            uint16_t port,
                                            SdpMediaSection::Protocol proto,
                                            sdp::AddrType addrType,
                                            const std::string& addr) = 0;
 
   virtual void Serialize(std::ostream&) const = 0;
 
--- a/media/webrtc/signaling/src/sdp/SdpEnum.h
+++ b/media/webrtc/signaling/src/sdp/SdpEnum.h
@@ -58,13 +58,35 @@ inline std::ostream& operator<<(std::ost
     case sdp::kSend:
       return os << "send";
     case sdp::kRecv:
       return os << "recv";
   }
   MOZ_CRASH("Unknown Direction");
 }
 
+enum class MediaType { kAudio, kVideo, kText, kApplication, kMessage };
+// don't add to enum to avoid warnings about unhandled enum values
+constexpr size_t kMediaTypes = static_cast<size_t>(MediaType::kMessage) + 1;
+
+inline std::ostream& operator<<(std::ostream& os, MediaType t)
+{
+  switch (t) {
+    case MediaType::kAudio:
+      return os << "audio";
+    case MediaType::kVideo:
+      return os << "video";
+    case MediaType::kText:
+      return os << "text";
+    case MediaType::kApplication:
+      return os << "application";
+    case MediaType::kMessage:
+      return os << "message";
+  }
+  MOZ_ASSERT(false, "Unknown MediaType");
+  return os << "?";
+}
+
 } // namespace sdp
 
 } // namespace mozilla
 
 #endif
--- a/media/webrtc/signaling/src/sdp/SdpHelper.cpp
+++ b/media/webrtc/signaling/src/sdp/SdpHelper.cpp
@@ -164,23 +164,23 @@ SdpHelper::DisableMsection(Sdp* sdp, Sdp
     msection->GetAttributeList().SetAttribute(new SdpStringAttribute(
           SdpAttribute::kMidAttribute, mid));
   }
 
   msection->ClearCodecs();
 
   auto mediaType = msection->GetMediaType();
   switch (mediaType) {
-    case SdpMediaSection::kAudio:
+    case sdp::MediaType::kAudio:
       msection->AddCodec("0", "PCMU", 8000, 1);
       break;
-    case SdpMediaSection::kVideo:
+    case sdp::MediaType::kVideo:
       msection->AddCodec("120", "VP8", 90000, 1);
       break;
-    case SdpMediaSection::kApplication:
+    case sdp::MediaType::kApplication:
       msection->AddDataChannel("rejected", 0, 0, 0);
       break;
     default:
       // We need to have something here to fit the grammar, this seems safe
       // and 19 is a reserved payload type which should not be used by anyone.
       msection->AddCodec("19", "reserved", 8000, 1);
   }
 }
@@ -708,19 +708,19 @@ SdpHelper::HasRtcp(SdpMediaSection::Prot
     case SdpMediaSection::kUdpDtlsSctp:
     case SdpMediaSection::kTcpDtlsSctp:
       return false;
   }
   MOZ_CRASH("Unknown protocol, probably corruption.");
 }
 
 SdpMediaSection::Protocol
-SdpHelper::GetProtocolForMediaType(SdpMediaSection::MediaType type)
+SdpHelper::GetProtocolForMediaType(sdp::MediaType type)
 {
-  if (type == SdpMediaSection::kApplication) {
+  if (type == sdp::MediaType::kApplication) {
     return SdpMediaSection::kDtlsSctp;
     // TODO switch to offer the new SCTP SDP (Bug 1335206)
     //return SdpMediaSection::kUdpDtlsSctp;
   }
 
   return SdpMediaSection::kUdpTlsRtpSavpf;
 }
 
--- a/media/webrtc/signaling/src/sdp/SdpHelper.h
+++ b/media/webrtc/signaling/src/sdp/SdpHelper.h
@@ -103,17 +103,17 @@ class SdpHelper {
 
     const SdpMediaSection* FindMsectionByMid(const Sdp& sdp,
                                              const std::string& mid) const;
 
     nsresult CopyStickyParams(const SdpMediaSection& source,
                               SdpMediaSection* dest);
     bool HasRtcp(SdpMediaSection::Protocol proto) const;
     static SdpMediaSection::Protocol GetProtocolForMediaType(
-        SdpMediaSection::MediaType type);
+        sdp::MediaType type);
     void appendSdpParseErrors(
           const std::vector<std::pair<size_t, std::string> >& aErrors,
           std::string* aErrorString);
 
     static bool GetPtAsInt(const std::string& ptString, uint16_t* ptOutparam);
 
     void AddCommonExtmaps(
         const SdpMediaSection& remoteMsection,
--- a/media/webrtc/signaling/src/sdp/SdpMediaSection.h
+++ b/media/webrtc/signaling/src/sdp/SdpMediaSection.h
@@ -19,19 +19,16 @@ namespace mozilla
 
 class SdpAttributeList;
 
 class SdpConnection;
 
 class SdpMediaSection
 {
 public:
-  enum MediaType { kAudio, kVideo, kText, kApplication, kMessage };
-  // don't add to enum to avoid warnings about unhandled enum values
-  static const size_t kMediaTypes = static_cast<size_t>(kMessage) + 1;
 
   enum Protocol {
     kRtpAvp,            // RTP/AVP [RFC4566]
     kUdp,               // udp [RFC4566]
     kVat,               // vat [historic]
     kRtp,               // rtp [historic]
     kUdptl,             // udptl [ITU-T]
     kTcp,               // TCP [RFC4145]
@@ -68,17 +65,17 @@ public:
     kSctp,              // SCTP [draft-ietf-mmusic-sctp-sdp-07]
     kDtlsSctp,          // DTLS/SCTP [draft-ietf-mmusic-sctp-sdp-07]
     kUdpDtlsSctp,       // UDP/DTLS/SCTP [draft-ietf-mmusic-sctp-sdp-21]
     kTcpDtlsSctp        // TCP/DTLS/SCTP [draft-ietf-mmusic-sctp-sdp-21]
   };
 
   explicit SdpMediaSection(size_t level) : mLevel(level) {}
 
-  virtual MediaType GetMediaType() const = 0;
+  virtual sdp::MediaType GetMediaType() const = 0;
   virtual unsigned int GetPort() const = 0;
   virtual void SetPort(unsigned int port) = 0;
   virtual unsigned int GetPortCount() const = 0;
   virtual Protocol GetProtocol() const = 0;
   virtual const SdpConnection& GetConnection() const = 0;
   virtual SdpConnection& GetConnection() = 0;
   virtual uint32_t GetBandwidth(const std::string& type) const = 0;
   virtual const std::vector<std::string>& GetFormats() const = 0;
@@ -184,34 +181,16 @@ private:
 };
 
 inline std::ostream& operator<<(std::ostream& os, const SdpMediaSection& ms)
 {
   ms.Serialize(os);
   return os;
 }
 
-inline std::ostream& operator<<(std::ostream& os, SdpMediaSection::MediaType t)
-{
-  switch (t) {
-    case SdpMediaSection::kAudio:
-      return os << "audio";
-    case SdpMediaSection::kVideo:
-      return os << "video";
-    case SdpMediaSection::kText:
-      return os << "text";
-    case SdpMediaSection::kApplication:
-      return os << "application";
-    case SdpMediaSection::kMessage:
-      return os << "message";
-  }
-  MOZ_ASSERT(false, "Unknown MediaType");
-  return os << "?";
-}
-
 inline std::ostream& operator<<(std::ostream& os, SdpMediaSection::Protocol p)
 {
   switch (p) {
     case SdpMediaSection::kRtpAvp:
       return os << "RTP/AVP";
     case SdpMediaSection::kUdp:
       return os << "udp";
     case SdpMediaSection::kVat:
--- a/media/webrtc/signaling/src/sdp/SipccSdp.cpp
+++ b/media/webrtc/signaling/src/sdp/SipccSdp.cpp
@@ -47,17 +47,17 @@ SipccSdp::GetMediaSection(size_t level)
 {
   if (level > mMediaSections.values.size()) {
     MOZ_CRASH();
   }
   return *mMediaSections.values[level];
 }
 
 SdpMediaSection&
-SipccSdp::AddMediaSection(SdpMediaSection::MediaType mediaType,
+SipccSdp::AddMediaSection(sdp::MediaType mediaType,
                           SdpDirectionAttribute::Direction dir, uint16_t port,
                           SdpMediaSection::Protocol protocol,
                           sdp::AddrType addrType, const std::string& addr)
 {
   size_t level = mMediaSections.values.size();
   SipccSdpMediaSection* media =
       new SipccSdpMediaSection(level, &mAttributeList);
   media->mMediaType = mediaType;
--- a/media/webrtc/signaling/src/sdp/SipccSdp.h
+++ b/media/webrtc/signaling/src/sdp/SipccSdp.h
@@ -60,17 +60,17 @@ public:
   }
 
   virtual const SdpMediaSection& GetMediaSection(size_t level) const
       override;
 
   virtual SdpMediaSection& GetMediaSection(size_t level) override;
 
   virtual SdpMediaSection& AddMediaSection(
-      SdpMediaSection::MediaType media, SdpDirectionAttribute::Direction dir,
+      sdp::MediaType media, SdpDirectionAttribute::Direction dir,
       uint16_t port, SdpMediaSection::Protocol proto, sdp::AddrType addrType,
       const std::string& addr) override;
 
   virtual void Serialize(std::ostream&) const override;
 
 private:
   SipccSdp() : mOrigin("", 0, 0, sdp::kIPv4, ""), mAttributeList(nullptr) {}
 
--- a/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.cpp
+++ b/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.cpp
@@ -88,26 +88,26 @@ SipccSdpMediaSection::GetDirectionAttrib
 }
 
 bool
 SipccSdpMediaSection::Load(sdp_t* sdp, uint16_t level,
                            SdpErrorHolder& errorHolder)
 {
   switch (sdp_get_media_type(sdp, level)) {
     case SDP_MEDIA_AUDIO:
-      mMediaType = kAudio;
+      mMediaType = sdp::MediaType::kAudio;
       break;
     case SDP_MEDIA_VIDEO:
-      mMediaType = kVideo;
+      mMediaType = sdp::MediaType::kVideo;
       break;
     case SDP_MEDIA_APPLICATION:
-      mMediaType = kApplication;
+      mMediaType = sdp::MediaType::kApplication;
       break;
     case SDP_MEDIA_TEXT:
-      mMediaType = kText;
+      mMediaType = sdp::MediaType::kText;
       break;
 
     default:
       errorHolder.AddParseError(sdp_get_media_line_number(sdp, level),
                                 "Unsupported media section type");
       return false;
   }
 
--- a/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h
+++ b/media/webrtc/signaling/src/sdp/SipccSdpMediaSection.h
@@ -33,17 +33,17 @@ public:
 
 class SipccSdpMediaSection final : public SdpMediaSection
 {
   friend class SipccSdp;
 
 public:
   ~SipccSdpMediaSection() {}
 
-  virtual MediaType
+  virtual sdp::MediaType
   GetMediaType() const override
   {
     return mMediaType;
   }
 
   virtual unsigned int GetPort() const override;
   virtual void SetPort(unsigned int port) override;
   virtual unsigned int GetPortCount() const override;
@@ -64,17 +64,17 @@ public:
   virtual void AddDataChannel(const std::string& name, uint16_t port,
                               uint16_t streams, uint32_t message_size) override;
 
   virtual void Serialize(std::ostream&) const override;
 
 private:
   SipccSdpMediaSection(size_t level, const SipccSdpAttributeList* sessionLevel)
       : SdpMediaSection(level),
-        mMediaType(static_cast<MediaType>(0)),
+        mMediaType(static_cast<sdp::MediaType>(0)),
         mPort(0),
         mPortCount(0),
         mProtocol(static_cast<Protocol>(0)),
         mAttributeList(sessionLevel)
   {
   }
 
   bool Load(sdp_t* sdp, uint16_t level, SdpErrorHolder& errorHolder);
@@ -86,17 +86,17 @@ private:
   bool ValidateSimulcastVersions(
       sdp_t* sdp,
       uint16_t level,
       const SdpSimulcastAttribute::Versions& versions,
       sdp::Direction direction,
       SdpErrorHolder& errorHolder) const;
 
   // the following values are cached on first get
-  MediaType mMediaType;
+  sdp::MediaType mMediaType;
   uint16_t mPort;
   uint16_t mPortCount;
   Protocol mProtocol;
   std::vector<std::string> mFormats;
 
   UniquePtr<SdpConnection> mConnection;
   SipccSdpBandwidths mBandwidths;
 
--- a/media/webrtc/signaling/test/signaling_unittests.cpp
+++ b/media/webrtc/signaling/test/signaling_unittests.cpp
@@ -1128,54 +1128,54 @@ class SignalingAgent {
     domMediaStream->GetTracks(tracks);
     for (uint32_t i = 0; i < tracks.Length(); i++) {
       Msid msid = {domMediaStream->GetId(), tracks[i]->GetId()};
 
       ASSERT_FALSE(mAddedTracks.count(msid))
         << msid.streamId << "/" << msid.trackId << " already added";
 
       mAddedTracks[msid] = (tracks[i]->AsVideoStreamTrack() ?
-                            SdpMediaSection::kVideo :
-                            SdpMediaSection::kAudio);
+                            sdp::MediaType::kVideo :
+                            sdp::MediaType::kAudio);
 
       ASSERT_EQ(pc->AddTrack(tracks[i], domMediaStream), NS_OK);
     }
     domMediaStreams_.push_back(domMediaStream);
   }
 
   // I would love to make this an overload of operator<<, but there's no way to
   // declare it in a way that works with gtest's header files.
   std::string DumpTracks(
-      const std::map<Msid, SdpMediaSection::MediaType>& tracks) const
+      const std::map<Msid, sdp::MediaType>& tracks) const
   {
     std::ostringstream oss;
     for (const auto& track : tracks) {
       oss << track.first.streamId << "/" << track.first.trackId
           << " (" << track.second << ")" << std::endl;
     }
 
     return oss.str();
   }
 
-  void ExpectMissingTracks(SdpMediaSection::MediaType type)
+  void ExpectMissingTracks(sdp::MediaType type)
   {
     for (auto it = mAddedTracks.begin(); it != mAddedTracks.end();) {
       if (it->second == type) {
         auto temp = it;
         ++it;
         mAddedTracks.erase(temp);
       } else {
         ++it;
       }
     }
   }
 
   void CheckLocalPipeline(const std::string& streamId,
                           const std::string& trackId,
-                          SdpMediaSection::MediaType type,
+                          sdp::MediaType type,
                           int pipelineCheckFlags = 0) const
   {
     LocalSourceStreamInfo* info;
     mozilla::SyncRunnable::DispatchToThread(
       gMainThread, WrapRunnableRet(&info,
         pc->media(), &PeerConnectionMedia::GetLocalStreamById,
         streamId));
 
@@ -1186,17 +1186,17 @@ class SignalingAgent {
     mozilla::SyncRunnable::DispatchToThread(
         gMainThread,
         WrapRunnableRet(&pipeline, info,
                         &SourceStreamInfo::GetPipelineByTrackId_m,
                         trackId));
 
     ASSERT_TRUE(pipeline) << "No such local track id: " << trackId;
 
-    if (type == SdpMediaSection::kVideo) {
+    if (type == sdp::MediaType::kVideo) {
       ASSERT_TRUE(pipeline->IsVideo()) << "Local track " << trackId
                                        << " was not video";
       ASSERT_EQ(mExpectRtcpMuxVideo, pipeline->IsDoingRtcpMux())
         << "Pipeline for remote track " << trackId
         << " is" << (mExpectRtcpMuxVideo ? " not " : " ") << "using rtcp-mux";
       // No checking for video RTP yet, since we don't have support for fake
       // video here yet. (bug 1142320)
     } else {
@@ -1212,17 +1212,17 @@ class SignalingAgent {
       ASSERT_EQ(mExpectRtcpMuxAudio, pipeline->IsDoingRtcpMux())
         << "Pipeline for remote track " << trackId
         << " is" << (mExpectRtcpMuxAudio ? " not " : " ") << "using rtcp-mux";
     }
   }
 
   void CheckRemotePipeline(const std::string& streamId,
                            const std::string& trackId,
-                           SdpMediaSection::MediaType type,
+                           sdp::MediaType type,
                            int pipelineCheckFlags = 0) const
   {
     RemoteSourceStreamInfo* info;
     mozilla::SyncRunnable::DispatchToThread(
       gMainThread, WrapRunnableRet(&info,
         pc->media(), &PeerConnectionMedia::GetRemoteStreamById,
         streamId));
 
@@ -1233,17 +1233,17 @@ class SignalingAgent {
     mozilla::SyncRunnable::DispatchToThread(
         gMainThread,
         WrapRunnableRet(&pipeline, info,
                         &SourceStreamInfo::GetPipelineByTrackId_m,
                         trackId));
 
     ASSERT_TRUE(pipeline) << "No such remote track id: " << trackId;
 
-    if (type == SdpMediaSection::kVideo) {
+    if (type == sdp::MediaType::kVideo) {
       ASSERT_TRUE(pipeline->IsVideo()) << "Remote track " << trackId
                                        << " was not video";
       mozilla::MediaSessionConduit *conduit = pipeline->Conduit();
       ASSERT_TRUE(conduit);
       ASSERT_EQ(conduit->type(), mozilla::MediaSessionConduit::VIDEO);
       mozilla::VideoSessionConduit *video_conduit =
         static_cast<mozilla::VideoSessionConduit*>(conduit);
       ASSERT_EQ(mExpectNack, video_conduit->UsingNackBasic());
@@ -1593,17 +1593,17 @@ public:
   const std::string name;
   bool mBundleEnabled;
   VideoSessionConduit::FrameRequestType mExpectedFrameRequestType;
   bool mExpectNack;
   bool mExpectRtcpMuxAudio;
   bool mExpectRtcpMuxVideo;
   bool mRemoteDescriptionSet;
 
-  std::map<Msid, SdpMediaSection::MediaType> mAddedTracks;
+  std::map<Msid, sdp::MediaType> mAddedTracks;
 
   typedef struct {
     std::string candidate;
     std::string mid;
     uint16_t level;
     bool expectSuccess;
   } DeferredCandidate;
 
@@ -1840,17 +1840,17 @@ public:
 
   void CheckStreams(SignalingAgent& sender, SignalingAgent& receiver)
   {
     for (auto it = sender.mAddedTracks.begin();
          it != sender.mAddedTracks.end();
          ++it) {
       // No checking for video yet, since we don't have support for fake video
       // here yet. (bug 1142320)
-      if (it->second == SdpMediaSection::kAudio) {
+      if (it->second == sdp::MediaType::kAudio) {
         int sendExpect = sender.GetPacketsSent(it->first.streamId) + 2;
         int receiveExpect = receiver.GetPacketsReceived(it->first.streamId) + 2;
 
         // TODO: Once we support more than one of each track type per stream,
         // this will need to be updated.
         WAIT(sender.GetPacketsSent(it->first.streamId) >= sendExpect &&
              receiver.GetPacketsReceived(it->first.streamId) >= receiveExpect,
              kDefaultTimeout);
@@ -1968,17 +1968,17 @@ public:
   {
     SipccSdpParser parser;
     UniquePtr<Sdp> parsed = parser.Parse(sdp);
 
     SdpMediaSection* previousMsection = nullptr;
     bool swapped = false;
     for (size_t i = 0; i < parsed->GetMediaSectionCount(); ++i) {
       SdpMediaSection* currentMsection = &parsed->GetMediaSection(i);
-      bool isVideo = currentMsection->GetMediaType() == SdpMediaSection::kVideo;
+      bool isVideo = currentMsection->GetMediaType() == sdp::MediaType::kVideo;
       if (swapVideo == isVideo) {
         if (previousMsection) {
           UniquePtr<SdpMsidAttributeList> prevMsid(
             new SdpMsidAttributeList(
                 previousMsection->GetAttributeList().GetMsid()));
           UniquePtr<SdpMsidAttributeList> currMsid(
             new SdpMsidAttributeList(
                 currentMsection->GetAttributeList().GetMsid()));
@@ -3363,18 +3363,18 @@ TEST_P(SignalingTest, VideoNegotiationFa
   ASSERT_EQ(a2_->pObserver->lastStatusCode,
             PeerConnectionImpl::kNoError);
 
   a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
 
   ASSERT_EQ(a1_->pObserver->lastStatusCode,
             PeerConnectionImpl::kNoError);
 
-  a1_->ExpectMissingTracks(SdpMediaSection::kVideo);
-  a2_->ExpectMissingTracks(SdpMediaSection::kVideo);
+  a1_->ExpectMissingTracks(sdp::MediaType::kVideo);
+  a2_->ExpectMissingTracks(sdp::MediaType::kVideo);
 
   WaitForCompleted();
 
   CheckPipelines();
   // TODO: (bug 1140089) a2 is not seeing audio segments in this test.
   // CheckStreams();
 
   CloseStreams();
@@ -3403,18 +3403,18 @@ TEST_P(SignalingTest, AudioNegotiationFa
   ASSERT_EQ(a2_->pObserver->lastStatusCode,
             PeerConnectionImpl::kNoError);
 
   a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
 
   ASSERT_EQ(a1_->pObserver->lastStatusCode,
             PeerConnectionImpl::kNoError);
 
-  a1_->ExpectMissingTracks(SdpMediaSection::kAudio);
-  a2_->ExpectMissingTracks(SdpMediaSection::kAudio);
+  a1_->ExpectMissingTracks(sdp::MediaType::kAudio);
+  a2_->ExpectMissingTracks(sdp::MediaType::kAudio);
 
   WaitForCompleted();
 
   CheckPipelines();
   CheckStreams();
 
   CloseStreams();
 }
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,35 +8,35 @@
       "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.6.2.tgz",
       "integrity": "sha512-zUzo1E5dI2Ey8+82egfnttyMlMZ2y0D8xOCO3PNPPlYXpl8NZvF6Qk9L9BEtJs+43FqEmfBViDqc5d1ckRDguw=="
     },
     "acorn-jsx": {
       "version": "3.0.1",
       "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz",
       "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=",
       "requires": {
-        "acorn": "^3.0.4"
+        "acorn": "3.3.0"
       },
       "dependencies": {
         "acorn": {
           "version": "3.3.0",
           "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz",
           "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo="
         }
       }
     },
     "ajv": {
       "version": "5.5.2",
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
       "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
       "requires": {
-        "co": "^4.6.0",
-        "fast-deep-equal": "^1.0.0",
-        "fast-json-stable-stringify": "^2.0.0",
-        "json-schema-traverse": "^0.3.0"
+        "co": "4.6.0",
+        "fast-deep-equal": "1.1.0",
+        "fast-json-stable-stringify": "2.0.0",
+        "json-schema-traverse": "0.3.1"
       }
     },
     "ajv-keywords": {
       "version": "2.1.1",
       "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
       "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I="
     },
     "ansi-escapes": {
@@ -54,25 +54,25 @@
       "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
       "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
     },
     "argparse": {
       "version": "1.0.10",
       "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
       "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
       "requires": {
-        "sprintf-js": "~1.0.2"
+        "sprintf-js": "1.0.3"
       }
     },
     "array-union": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
       "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
       "requires": {
-        "array-uniq": "^1.0.1"
+        "array-uniq": "1.0.3"
       }
     },
     "array-uniq": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
       "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY="
     },
     "arrify": {
@@ -80,99 +80,99 @@
       "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
       "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0="
     },
     "babel-code-frame": {
       "version": "6.26.0",
       "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
       "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
       "requires": {
-        "chalk": "^1.1.3",
-        "esutils": "^2.0.2",
-        "js-tokens": "^3.0.2"
+        "chalk": "1.1.3",
+        "esutils": "2.0.2",
+        "js-tokens": "3.0.2"
       },
       "dependencies": {
         "chalk": {
           "version": "1.1.3",
           "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
           "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
           "requires": {
-            "ansi-styles": "^2.2.1",
-            "escape-string-regexp": "^1.0.2",
-            "has-ansi": "^2.0.0",
-            "strip-ansi": "^3.0.0",
-            "supports-color": "^2.0.0"
+            "ansi-styles": "2.2.1",
+            "escape-string-regexp": "1.0.5",
+            "has-ansi": "2.0.0",
+            "strip-ansi": "3.0.1",
+            "supports-color": "2.0.0"
           }
         },
         "strip-ansi": {
           "version": "3.0.1",
           "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
           "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
           "requires": {
-            "ansi-regex": "^2.0.0"
+            "ansi-regex": "2.1.1"
           }
         }
       }
     },
     "balanced-match": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
       "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
     },
     "brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
       "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
       "requires": {
-        "balanced-match": "^1.0.0",
+        "balanced-match": "1.0.0",
         "concat-map": "0.0.1"
       }
     },
     "buffer-from": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz",
       "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ=="
     },
     "caller-path": {
       "version": "0.1.0",
       "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz",
       "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=",
       "requires": {
-        "callsites": "^0.2.0"
+        "callsites": "0.2.0"
       }
     },
     "callsites": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
       "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo="
     },
     "chalk": {
       "version": "2.4.1",
       "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
       "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
       "requires": {
-        "ansi-styles": "^3.2.1",
-        "escape-string-regexp": "^1.0.5",
-        "supports-color": "^5.3.0"
+        "ansi-styles": "3.2.1",
+        "escape-string-regexp": "1.0.5",
+        "supports-color": "5.4.0"
       },
       "dependencies": {
         "ansi-styles": {
           "version": "3.2.1",
           "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
           "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
           "requires": {
-            "color-convert": "^1.9.0"
+            "color-convert": "1.9.2"
           }
         },
         "supports-color": {
           "version": "5.4.0",
           "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
           "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
           "requires": {
-            "has-flag": "^3.0.0"
+            "has-flag": "3.0.0"
           }
         }
       }
     },
     "chardet": {
       "version": "0.4.2",
       "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
       "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I="
@@ -182,17 +182,17 @@
       "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
       "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A=="
     },
     "cli-cursor": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
       "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
       "requires": {
-        "restore-cursor": "^2.0.0"
+        "restore-cursor": "2.0.0"
       }
     },
     "cli-width": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
       "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk="
     },
     "co": {
@@ -218,35 +218,35 @@
       "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
       "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
     },
     "concat-stream": {
       "version": "1.6.2",
       "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
       "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
       "requires": {
-        "buffer-from": "^1.0.0",
-        "inherits": "^2.0.3",
-        "readable-stream": "^2.2.2",
-        "typedarray": "^0.0.6"
+        "buffer-from": "1.1.0",
+        "inherits": "2.0.3",
+        "readable-stream": "2.3.6",
+        "typedarray": "0.0.6"
       }
     },
     "core-util-is": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
       "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
     },
     "cross-spawn": {
       "version": "5.1.0",
       "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
       "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
       "requires": {
-        "lru-cache": "^4.0.1",
-        "shebang-command": "^1.2.0",
-        "which": "^1.2.9"
+        "lru-cache": "4.1.3",
+        "shebang-command": "1.2.0",
+        "which": "1.3.1"
       }
     },
     "debug": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
       "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
       "requires": {
         "ms": "2.0.0"
@@ -257,40 +257,40 @@
       "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
       "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
     },
     "del": {
       "version": "2.2.2",
       "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz",
       "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=",
       "requires": {
-        "globby": "^5.0.0",
-        "is-path-cwd": "^1.0.0",
-        "is-path-in-cwd": "^1.0.0",
-        "object-assign": "^4.0.1",
-        "pify": "^2.0.0",
-        "pinkie-promise": "^2.0.0",
-        "rimraf": "^2.2.8"
+        "globby": "5.0.0",
+        "is-path-cwd": "1.0.0",
+        "is-path-in-cwd": "1.0.1",
+        "object-assign": "4.1.1",
+        "pify": "2.3.0",
+        "pinkie-promise": "2.0.1",
+        "rimraf": "2.6.2"
       }
     },
     "doctrine": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
       "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
       "requires": {
-        "esutils": "^2.0.2"
+        "esutils": "2.0.2"
       }
     },
     "dom-serializer": {
       "version": "0.1.0",
       "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz",
       "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=",
       "requires": {
-        "domelementtype": "~1.1.1",
-        "entities": "~1.1.1"
+        "domelementtype": "1.1.3",
+        "entities": "1.1.1"
       },
       "dependencies": {
         "domelementtype": {
           "version": "1.1.3",
           "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
           "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs="
         }
       }
@@ -300,26 +300,26 @@
       "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
       "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI="
     },
     "domhandler": {
       "version": "2.4.2",
       "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz",
       "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==",
       "requires": {
-        "domelementtype": "1"
+        "domelementtype": "1.3.0"
       }
     },
     "domutils": {
       "version": "1.7.0",
       "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
       "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
       "requires": {
-        "dom-serializer": "0",
-        "domelementtype": "1"
+        "dom-serializer": "0.1.0",
+        "domelementtype": "1.3.0"
       }
     },
     "entities": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
       "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA="
     },
     "escape-string-regexp": {
@@ -327,62 +327,62 @@
       "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
       "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
     },
     "eslint": {
       "version": "4.19.1",
       "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz",
       "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==",
       "requires": {
-        "ajv": "^5.3.0",
-        "babel-code-frame": "^6.22.0",
-        "chalk": "^2.1.0",
-        "concat-stream": "^1.6.0",
-        "cross-spawn": "^5.1.0",
-        "debug": "^3.1.0",
-        "doctrine": "^2.1.0",
-        "eslint-scope": "^3.7.1",
-        "eslint-visitor-keys": "^1.0.0",
-        "espree": "^3.5.4",
-        "esquery": "^1.0.0",
-        "esutils": "^2.0.2",
-        "file-entry-cache": "^2.0.0",
-        "functional-red-black-tree": "^1.0.1",
-        "glob": "^7.1.2",
-        "globals": "^11.0.1",
-        "ignore": "^3.3.3",
-        "imurmurhash": "^0.1.4",
-        "inquirer": "^3.0.6",
-        "is-resolvable": "^1.0.0",
-        "js-yaml": "^3.9.1",
-        "json-stable-stringify-without-jsonify": "^1.0.1",
-        "levn": "^0.3.0",
-        "lodash": "^4.17.4",
-        "minimatch": "^3.0.2",
-        "mkdirp": "^0.5.1",
-        "natural-compare": "^1.4.0",
-        "optionator": "^0.8.2",
-        "path-is-inside": "^1.0.2",
-        "pluralize": "^7.0.0",
-        "progress": "^2.0.0",
-        "regexpp": "^1.0.1",
-        "require-uncached": "^1.0.3",
-        "semver": "^5.3.0",
-        "strip-ansi": "^4.0.0",
-        "strip-json-comments": "~2.0.1",
+        "ajv": "5.5.2",
+        "babel-code-frame": "6.26.0",
+        "chalk": "2.4.1",
+        "concat-stream": "1.6.2",
+        "cross-spawn": "5.1.0",
+        "debug": "3.1.0",
+        "doctrine": "2.1.0",
+        "eslint-scope": "3.7.1",
+        "eslint-visitor-keys": "1.0.0",
+        "espree": "3.5.4",
+        "esquery": "1.0.1",
+        "esutils": "2.0.2",
+        "file-entry-cache": "2.0.0",
+        "functional-red-black-tree": "1.0.1",
+        "glob": "7.1.2",
+        "globals": "11.5.0",
+        "ignore": "3.3.8",
+        "imurmurhash": "0.1.4",
+        "inquirer": "3.3.0",
+        "is-resolvable": "1.1.0",
+        "js-yaml": "3.12.0",
+        "json-stable-stringify-without-jsonify": "1.0.1",
+        "levn": "0.3.0",
+        "lodash": "4.17.10",
+        "minimatch": "3.0.4",
+        "mkdirp": "0.5.1",
+        "natural-compare": "1.4.0",
+        "optionator": "0.8.2",
+        "path-is-inside": "1.0.2",
+        "pluralize": "7.0.0",
+        "progress": "2.0.0",
+        "regexpp": "1.1.0",
+        "require-uncached": "1.0.3",
+        "semver": "5.5.0",
+        "strip-ansi": "4.0.0",
+        "strip-json-comments": "2.0.1",
         "table": "4.0.2",
-        "text-table": "~0.2.0"
+        "text-table": "0.2.0"
       }
     },
     "eslint-plugin-html": {
       "version": "4.0.3",
       "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-4.0.3.tgz",
       "integrity": "sha512-ArFnlfQxwYSz/CP0zvk8Cy3MUhcDpT3o6jgO8eKD/b8ezcLVBrgkYzmMv+7S/ya+Yl9pN+Cz2tsgYp/zElkQzA==",
       "requires": {
-        "htmlparser2": "^3.8.2"
+        "htmlparser2": "3.9.2"
       }
     },
     "eslint-plugin-mozilla": {
       "version": "file:tools/lint/eslint/eslint-plugin-mozilla",
       "requires": {
         "htmlparser2": "3.9.2",
         "ini-parser": "0.0.2",
         "sax": "1.2.4"
@@ -393,66 +393,66 @@
       "resolved": "https://registry.npmjs.org/eslint-plugin-no-unsanitized/-/eslint-plugin-no-unsanitized-3.0.2.tgz",
       "integrity": "sha512-JnwpoH8Sv4QOjrTDutENBHzSnyYtspdjtglYtqUtAHe6f6LLKqykJle+UwFPg23GGwt5hI3amS9CRDezW8GAww=="
     },
     "eslint-plugin-react": {
       "version": "7.1.0",
       "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.1.0.tgz",
       "integrity": "sha1-J3cKzzn1/UnNCvQIPOWBBOs5DUw=",
       "requires": {
-        "doctrine": "^2.0.0",
-        "has": "^1.0.1",
-        "jsx-ast-utils": "^1.4.1"
+        "doctrine": "2.1.0",
+        "has": "1.0.3",
+        "jsx-ast-utils": "1.4.1"
       }
     },
     "eslint-plugin-spidermonkey-js": {
       "version": "file:tools/lint/eslint/eslint-plugin-spidermonkey-js"
     },
     "eslint-scope": {
       "version": "3.7.1",
       "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz",
       "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=",
       "requires": {
-        "esrecurse": "^4.1.0",
-        "estraverse": "^4.1.1"
+        "esrecurse": "4.2.1",
+        "estraverse": "4.2.0"
       }
     },
     "eslint-visitor-keys": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
       "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ=="
     },
     "espree": {
       "version": "3.5.4",
       "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz",
       "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==",
       "requires": {
-        "acorn": "^5.5.0",
-        "acorn-jsx": "^3.0.0"
+        "acorn": "5.6.2",
+        "acorn-jsx": "3.0.1"
       }
     },
     "esprima": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
       "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw=="
     },
     "esquery": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz",
       "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==",
       "requires": {
-        "estraverse": "^4.0.0"
+        "estraverse": "4.2.0"
       }
     },
     "esrecurse": {
       "version": "4.2.1",
       "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
       "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
       "requires": {
-        "estraverse": "^4.1.0"
+        "estraverse": "4.2.0"
       }
     },
     "estraverse": {
       "version": "4.2.0",
       "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
       "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM="
     },
     "esutils": {
@@ -460,19 +460,19 @@
       "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
       "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs="
     },
     "external-editor": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
       "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
       "requires": {
-        "chardet": "^0.4.0",
-        "iconv-lite": "^0.4.17",
-        "tmp": "^0.0.33"
+        "chardet": "0.4.2",
+        "iconv-lite": "0.4.23",
+        "tmp": "0.0.33"
       }
     },
     "fast-deep-equal": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
       "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
     },
     "fast-json-stable-stringify": {
@@ -485,37 +485,37 @@
       "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
       "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
     },
     "figures": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
       "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
       "requires": {
-        "escape-string-regexp": "^1.0.5"
+        "escape-string-regexp": "1.0.5"
       }
     },
     "file-entry-cache": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz",
       "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=",
       "requires": {
-        "flat-cache": "^1.2.1",
-        "object-assign": "^4.0.1"
+        "flat-cache": "1.3.0",
+        "object-assign": "4.1.1"
       }
     },
     "flat-cache": {
       "version": "1.3.0",
       "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz",
       "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=",
       "requires": {
-        "circular-json": "^0.3.1",
-        "del": "^2.0.2",
-        "graceful-fs": "^4.1.2",
-        "write": "^0.2.1"
+        "circular-json": "0.3.3",
+        "del": "2.2.2",
+        "graceful-fs": "4.1.11",
+        "write": "0.2.1"
       }
     },
     "fs.realpath": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
       "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
     },
     "function-bind": {
@@ -528,87 +528,87 @@
       "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
       "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc="
     },
     "glob": {
       "version": "7.1.2",
       "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
       "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
       "requires": {
-        "fs.realpath": "^1.0.0",
-        "inflight": "^1.0.4",
-        "inherits": "2",
-        "minimatch": "^3.0.4",
-        "once": "^1.3.0",
-        "path-is-absolute": "^1.0.0"
+        "fs.realpath": "1.0.0",
+        "inflight": "1.0.6",
+        "inherits": "2.0.3",
+        "minimatch": "3.0.4",
+        "once": "1.4.0",
+        "path-is-absolute": "1.0.1"
       }
     },
     "globals": {
       "version": "11.5.0",
       "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz",
       "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ=="
     },
     "globby": {
       "version": "5.0.0",
       "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
       "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
       "requires": {
-        "array-union": "^1.0.1",
-        "arrify": "^1.0.0",
-        "glob": "^7.0.3",
-        "object-assign": "^4.0.1",
-        "pify": "^2.0.0",
-        "pinkie-promise": "^2.0.0"
+        "array-union": "1.0.2",
+        "arrify": "1.0.1",
+        "glob": "7.1.2",
+        "object-assign": "4.1.1",
+        "pify": "2.3.0",
+        "pinkie-promise": "2.0.1"
       }
     },
     "graceful-fs": {
       "version": "4.1.11",
       "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
       "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
     },
     "has": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
       "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
       "requires": {
-        "function-bind": "^1.1.1"
+        "function-bind": "1.1.1"
       }
     },
     "has-ansi": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
       "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
       "requires": {
-        "ansi-regex": "^2.0.0"
+        "ansi-regex": "2.1.1"
       }
     },
     "has-flag": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
       "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
     },
     "htmlparser2": {
       "version": "3.9.2",
       "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz",
       "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=",
       "requires": {
-        "domelementtype": "^1.3.0",
-        "domhandler": "^2.3.0",
-        "domutils": "^1.5.1",
-        "entities": "^1.1.1",
-        "inherits": "^2.0.1",
-        "readable-stream": "^2.0.2"
+        "domelementtype": "1.3.0",
+        "domhandler": "2.4.2",
+        "domutils": "1.7.0",
+        "entities": "1.1.1",
+        "inherits": "2.0.3",
+        "readable-stream": "2.3.6"
       }
     },
     "iconv-lite": {
       "version": "0.4.23",
       "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
       "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
       "requires": {
-        "safer-buffer": ">= 2.1.2 < 3"
+        "safer-buffer": "2.1.2"
       }
     },
     "ignore": {
       "version": "3.3.8",
       "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz",
       "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg=="
     },
     "imurmurhash": {
@@ -616,18 +616,18 @@
       "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
       "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
     },
     "inflight": {
       "version": "1.0.6",
       "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
       "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
       "requires": {
-        "once": "^1.3.0",
-        "wrappy": "1"
+        "once": "1.4.0",
+        "wrappy": "1.0.2"
       }
     },
     "inherits": {
       "version": "2.0.3",
       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
       "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
     },
     "ini-parser": {
@@ -635,30 +635,30 @@
       "resolved": "https://registry.npmjs.org/ini-parser/-/ini-parser-0.0.2.tgz",
       "integrity": "sha1-+kF4flZ3Y7P/Zdel2alO23QHh+8="
     },
     "inquirer": {
       "version": "3.3.0",
       "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
       "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
       "requires": {
-        "ansi-escapes": "^3.0.0",
-        "chalk": "^2.0.0",
-        "cli-cursor": "^2.1.0",
-        "cli-width": "^2.0.0",
-        "external-editor": "^2.0.4",
-        "figures": "^2.0.0",
-        "lodash": "^4.3.0",
+        "ansi-escapes": "3.1.0",
+        "chalk": "2.4.1",
+        "cli-cursor": "2.1.0",
+        "cli-width": "2.2.0",
+        "external-editor": "2.2.0",
+        "figures": "2.0.0",
+        "lodash": "4.17.10",
         "mute-stream": "0.0.7",
-        "run-async": "^2.2.0",
-        "rx-lite": "^4.0.8",
-        "rx-lite-aggregates": "^4.0.8",
-        "string-width": "^2.1.0",
-        "strip-ansi": "^4.0.0",
-        "through": "^2.3.6"
+        "run-async": "2.3.0",
+        "rx-lite": "4.0.8",
+        "rx-lite-aggregates": "4.0.8",
+        "string-width": "2.1.1",
+        "strip-ansi": "4.0.0",
+        "through": "2.3.8"
       }
     },
     "is-fullwidth-code-point": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
       "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
     },
     "is-path-cwd": {
@@ -666,25 +666,25 @@
       "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz",
       "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0="
     },
     "is-path-in-cwd": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz",
       "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==",
       "requires": {
-        "is-path-inside": "^1.0.0"
+        "is-path-inside": "1.0.1"
       }
     },
     "is-path-inside": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
       "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
       "requires": {
-        "path-is-inside": "^1.0.1"
+        "path-is-inside": "1.0.2"
       }
     },
     "is-promise": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
       "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o="
     },
     "is-resolvable": {
@@ -707,18 +707,18 @@
       "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
       "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls="
     },
     "js-yaml": {
       "version": "3.12.0",
       "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
       "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
       "requires": {
-        "argparse": "^1.0.7",
-        "esprima": "^4.0.0"
+        "argparse": "1.0.10",
+        "esprima": "4.0.0"
       }
     },
     "json-schema-traverse": {
       "version": "0.3.1",
       "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
       "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
     },
     "json-stable-stringify-without-jsonify": {
@@ -731,45 +731,45 @@
       "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz",
       "integrity": "sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE="
     },
     "levn": {
       "version": "0.3.0",
       "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
       "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
       "requires": {
-        "prelude-ls": "~1.1.2",
-        "type-check": "~0.3.2"
+        "prelude-ls": "1.1.2",
+        "type-check": "0.3.2"
       }
     },
     "lodash": {
       "version": "4.17.10",
       "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
       "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
     },
     "lru-cache": {
       "version": "4.1.3",
       "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz",
       "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==",
       "requires": {
-        "pseudomap": "^1.0.2",
-        "yallist": "^2.1.2"
+        "pseudomap": "1.0.2",
+        "yallist": "2.1.2"
       }
     },
     "mimic-fn": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
       "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
     },
     "minimatch": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
       "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
       "requires": {
-        "brace-expansion": "^1.1.7"
+        "brace-expansion": "1.1.11"
       }
     },
     "minimist": {
       "version": "0.0.8",
       "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
       "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
     },
     "mkdirp": {
@@ -800,38 +800,38 @@
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
       "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
     },
     "once": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
       "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
       "requires": {
-        "wrappy": "1"
+        "wrappy": "1.0.2"
       }
     },
     "onetime": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
       "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
       "requires": {
-        "mimic-fn": "^1.0.0"
+        "mimic-fn": "1.2.0"
       }
     },
     "optionator": {
       "version": "0.8.2",
       "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
       "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
       "requires": {
-        "deep-is": "~0.1.3",
-        "fast-levenshtein": "~2.0.4",
-        "levn": "~0.3.0",
-        "prelude-ls": "~1.1.2",
-        "type-check": "~0.3.2",
-        "wordwrap": "~1.0.0"
+        "deep-is": "0.1.3",
+        "fast-levenshtein": "2.0.6",
+        "levn": "0.3.0",
+        "prelude-ls": "1.1.2",
+        "type-check": "0.3.2",
+        "wordwrap": "1.0.0"
       }
     },
     "os-tmpdir": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
       "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
     },
     "path-is-absolute": {
@@ -854,17 +854,17 @@
       "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
       "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
     },
     "pinkie-promise": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
       "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
       "requires": {
-        "pinkie": "^2.0.0"
+        "pinkie": "2.0.4"
       }
     },
     "pluralize": {
       "version": "7.0.0",
       "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
       "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow=="
     },
     "prelude-ls": {
@@ -887,80 +887,80 @@
       "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
       "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
     },
     "readable-stream": {
       "version": "2.3.6",
       "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
       "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
       "requires": {
-        "core-util-is": "~1.0.0",
-        "inherits": "~2.0.3",
-        "isarray": "~1.0.0",
-        "process-nextick-args": "~2.0.0",
-        "safe-buffer": "~5.1.1",
-        "string_decoder": "~1.1.1",
-        "util-deprecate": "~1.0.1"
+        "core-util-is": "1.0.2",
+        "inherits": "2.0.3",
+        "isarray": "1.0.0",
+        "process-nextick-args": "2.0.0",
+        "safe-buffer": "5.1.2",
+        "string_decoder": "1.1.1",
+        "util-deprecate": "1.0.2"
       }
     },
     "regexpp": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz",
       "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw=="
     },
     "require-uncached": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
       "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
       "requires": {
-        "caller-path": "^0.1.0",
-        "resolve-from": "^1.0.0"
+        "caller-path": "0.1.0",
+        "resolve-from": "1.0.1"
       }
     },
     "resolve-from": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz",
       "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY="
     },
     "restore-cursor": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
       "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
       "requires": {
-        "onetime": "^2.0.0",
-        "signal-exit": "^3.0.2"
+        "onetime": "2.0.1",
+        "signal-exit": "3.0.2"
       }
     },
     "rimraf": {
       "version": "2.6.2",
       "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
       "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
       "requires": {
-        "glob": "^7.0.5"
+        "glob": "7.1.2"
       }
     },
     "run-async": {
       "version": "2.3.0",
       "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
       "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
       "requires": {
-        "is-promise": "^2.1.0"
+        "is-promise": "2.1.0"
       }
     },
     "rx-lite": {
       "version": "4.0.8",
       "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
       "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ="
     },
     "rx-lite-aggregates": {
       "version": "4.0.8",
       "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz",
       "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
       "requires": {
-        "rx-lite": "*"
+        "rx-lite": "4.0.8"
       }
     },
     "safe-buffer": {
       "version": "5.1.2",
       "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
       "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
     },
     "safer-buffer": {
@@ -978,17 +978,17 @@
       "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
       "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA=="
     },
     "shebang-command": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
       "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
       "requires": {
-        "shebang-regex": "^1.0.0"
+        "shebang-regex": "1.0.0"
       }
     },
     "shebang-regex": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
       "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
     },
     "signal-exit": {
@@ -996,47 +996,47 @@
       "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
       "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
     },
     "slice-ansi": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz",
       "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==",
       "requires": {
-        "is-fullwidth-code-point": "^2.0.0"
+        "is-fullwidth-code-point": "2.0.0"
       }
     },
     "sprintf-js": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
       "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
     },
     "string-width": {
       "version": "2.1.1",
       "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
       "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
       "requires": {
-        "is-fullwidth-code-point": "^2.0.0",
-        "strip-ansi": "^4.0.0"
+        "is-fullwidth-code-point": "2.0.0",
+        "strip-ansi": "4.0.0"
       }
     },
     "string_decoder": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
       "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
       "requires": {
-        "safe-buffer": "~5.1.0"
+        "safe-buffer": "5.1.2"
       }
     },
     "strip-ansi": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
       "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
       "requires": {
-        "ansi-regex": "^3.0.0"
+        "ansi-regex": "3.0.0"
       },
       "dependencies": {
         "ansi-regex": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
           "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
         }
       }
@@ -1051,22 +1051,22 @@
       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
       "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
     },
     "table": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
       "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
       "requires": {
-        "ajv": "^5.2.3",
-        "ajv-keywords": "^2.1.0",
-        "chalk": "^2.1.0",
-        "lodash": "^4.17.4",
+        "ajv": "5.5.2",
+        "ajv-keywords": "2.1.1",
+        "chalk": "2.4.1",
+        "lodash": "4.17.10",
         "slice-ansi": "1.0.0",
-        "string-width": "^2.1.1"
+        "string-width": "2.1.1"
       }
     },
     "text-table": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
       "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ="
     },
     "through": {
@@ -1074,25 +1074,25 @@
       "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
       "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
     },
     "tmp": {
       "version": "0.0.33",
       "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
       "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
       "requires": {
-        "os-tmpdir": "~1.0.2"
+        "os-tmpdir": "1.0.2"
       }
     },
     "type-check": {
       "version": "0.3.2",
       "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
       "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
       "requires": {
-        "prelude-ls": "~1.1.2"
+        "prelude-ls": "1.1.2"
       }
     },
     "typedarray": {
       "version": "0.0.6",
       "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
       "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
     },
     "util-deprecate": {
@@ -1100,17 +1100,17 @@
       "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
       "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
     },
     "which": {
       "version": "1.3.1",
       "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
       "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
       "requires": {
-        "isexe": "^2.0.0"
+        "isexe": "2.0.0"
       }
     },
     "wordwrap": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
       "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus="
     },
     "wrappy": {
@@ -1118,17 +1118,17 @@
       "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
       "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
     },
     "write": {
       "version": "0.2.1",
       "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz",
       "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=",
       "requires": {
-        "mkdirp": "^0.5.1"
+        "mkdirp": "0.5.1"
       }
     },
     "yallist": {
       "version": "2.1.2",
       "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
       "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
     }
   }