Backed out changeset 9fa64e0224e2 (bug 1204099) for bustage JsepSessionImpl.cpp
authorIris Hsiao <ihsiao@mozilla.com>
Thu, 21 Jul 2016 16:13:50 +0800
changeset 331111 37e87a7c3771ffa468c1f50f810d331dfd53877c
parent 331110 90c6741cda5d9ae5cc472bfe2e819b2f9501e8cc
child 331112 79b1ba1f1f4bcc68801315438fa632e6c916549e
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1204099
milestone50.0a1
backs out9fa64e0224e2c16a8097d1d3b3c7d17cc2d59a1a
Backed out changeset 9fa64e0224e2 (bug 1204099) for bustage JsepSessionImpl.cpp
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
media/webrtc/signaling/test/jsep_session_unittest.cpp
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -32,27 +32,16 @@ MOZ_MTLOG_MODULE("jsep")
 #define JSEP_SET_ERROR(error)                                                  \
   do {                                                                         \
     std::ostringstream os;                                                     \
     os << error;                                                               \
     mLastError = os.str();                                                     \
     MOZ_MTLOG(ML_ERROR, mLastError);                                           \
   } while (0);
 
-static std::bitset<128> GetForbiddenSdpPayloadTypes() {
-  std::bitset<128> forbidden(0);
-  forbidden[1] = true;
-  forbidden[2] = true;
-  forbidden[19] = true;
-  for (uint16_t i = 64; i < 96; ++i) {
-    forbidden[i] = true;
-  }
-  return forbidden;
-}
-
 nsresult
 JsepSessionImpl::Init()
 {
   mLastError.clear();
 
   MOZ_ASSERT(!mSessionId, "Init called more than once");
 
   nsresult rv = SetupIds();
@@ -1664,31 +1653,26 @@ JsepSessionImpl::ParseSdp(const std::str
       }
 
       trackIds.insert(trackId);
     } else if (rv != NS_ERROR_NOT_AVAILABLE) {
       // Error has already been set
       return rv;
     }
 
-    static const std::bitset<128> forbidden = GetForbiddenSdpPayloadTypes();
     if (msection.GetMediaType() == SdpMediaSection::kAudio ||
         msection.GetMediaType() == SdpMediaSection::kVideo) {
       // Sanity-check that payload type can work with RTP
       for (const std::string& fmt : msection.GetFormats()) {
         uint16_t payloadType;
         // TODO (bug 1204099): Make this check for reserved ranges.
         if (!SdpHelper::GetPtAsInt(fmt, &payloadType) || payloadType > 127) {
           JSEP_SET_ERROR("audio/video payload type is too large: " << fmt);
           return NS_ERROR_INVALID_ARG;
         }
-	if (forbidden.test(payloadType)) {
-	  JSEP_SET_ERROR("Illegal audio/video payload type: " << fmt);
-          return NS_ERROR_INVALID_ARG;
-	}
       }
     }
   }
 
   *parsedp = Move(parsed);
   return NS_OK;
 }
 
--- a/media/webrtc/signaling/test/jsep_session_unittest.cpp
+++ b/media/webrtc/signaling/test/jsep_session_unittest.cpp
@@ -2115,31 +2115,16 @@ TEST_P(JsepSessionTest, RenegotiationAns
   }
 
   ASSERT_NE(newOffererPairs[0].mRtpTransport.get(),
             offererPairs[0].mRtpTransport.get());
   ASSERT_NE(newAnswererPairs[0].mRtpTransport.get(),
             answererPairs[0].mRtpTransport.get());
 }
 
-TEST_P(JsepSessionTest, ParseRejectsBadMediaFormat)
-{
-  if (GetParam() == "datachannel") {
-    return;
-  }
-  AddTracks(mSessionOff);
-  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);
-  ASSERT_EQ(NS_ERROR_INVALID_ARG, rv);
-}
-
 TEST_P(JsepSessionTest, FullCallWithCandidates)
 {
   AddTracks(mSessionOff);
   std::string offer = CreateOffer();
   SetLocalOffer(offer);
   mOffCandidates.Gather(mSessionOff, types);
 
   UniquePtr<Sdp> localOffer(Parse(mSessionOff.GetLocalDescription()));