Bug 1196974: remove mozDontOfferDataChannel from code and test. r=bwc
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Tue, 18 Jul 2017 14:24:33 +0200
changeset 418605 fc51c31a950a196209c917803620e6b950466df9
parent 418604 532785204f7bcfbcb992e01816c6566716ba9638
child 418606 05e27c93b3b4157b54ec56295bb0cc733a845272
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1196974
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1196974: remove mozDontOfferDataChannel from code and test. r=bwc MozReview-Commit-ID: 1CW3TaSMVZw
media/webrtc/signaling/gtest/jsep_session_unittest.cpp
media/webrtc/signaling/src/jsep/JsepSession.h
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
+++ b/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
@@ -2948,17 +2948,16 @@ INSTANTIATE_TEST_CASE_P(
 
 // offerToReceiveXxx variants
 
 TEST_F(JsepSessionTest, OfferAnswerRecvOnlyLines)
 {
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(1U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(2U));
-  options.mDontOfferDataChannel = Some(true);
   std::string offer = CreateOffer(Some(options));
 
   UniquePtr<Sdp> parsedOffer(Parse(offer));
   ASSERT_TRUE(!!parsedOffer);
 
   ASSERT_EQ(3U, parsedOffer->GetMediaSectionCount());
   ASSERT_EQ(SdpMediaSection::kAudio,
             parsedOffer->GetMediaSection(0).GetMediaType());
@@ -3025,17 +3024,16 @@ TEST_F(JsepSessionTest, OfferAnswerRecvO
 
 TEST_F(JsepSessionTest, OfferAnswerSendOnlyLines)
 {
   AddTracks(*mSessionOff, "audio,video,video");
 
   JsepOfferOptions options;
   options.mOfferToReceiveAudio = Some(static_cast<size_t>(0U));
   options.mOfferToReceiveVideo = Some(static_cast<size_t>(1U));
-  options.mDontOfferDataChannel = Some(true);
   std::string offer = CreateOffer(Some(options));
 
   UniquePtr<Sdp> outputSdp(Parse(offer));
   ASSERT_TRUE(!!outputSdp);
 
   ASSERT_EQ(3U, outputSdp->GetMediaSectionCount());
   ASSERT_EQ(SdpMediaSection::kAudio,
             outputSdp->GetMediaSection(0).GetMediaType());
--- a/media/webrtc/signaling/src/jsep/JsepSession.h
+++ b/media/webrtc/signaling/src/jsep/JsepSession.h
@@ -44,17 +44,16 @@ enum JsepDescriptionPendingOrCurrent {
   kJsepDescriptionPending,
   kJsepDescriptionPendingOrCurrent
 };
 
 struct JsepOAOptions {};
 struct JsepOfferOptions : public JsepOAOptions {
   Maybe<size_t> mOfferToReceiveAudio;
   Maybe<size_t> mOfferToReceiveVideo;
-  Maybe<bool> mDontOfferDataChannel;
   Maybe<bool> mIceRestart; // currently ignored by JsepSession
 };
 struct JsepAnswerOptions : public JsepOAOptions {};
 
 enum JsepBundlePolicy {
   kBundleBalanced,
   kBundleMaxCompat,
   kBundleMaxBundle
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -423,23 +423,20 @@ JsepSessionImpl::SetupOfferMSections(con
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = SetupOfferMSectionsByType(
       SdpMediaSection::kVideo, options.mOfferToReceiveVideo, sdp);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
-  if (!(options.mDontOfferDataChannel.isSome() &&
-        *options.mDontOfferDataChannel)) {
-    rv = SetupOfferMSectionsByType(
-        SdpMediaSection::kApplication, Maybe<size_t>(), sdp);
-
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
+  rv = SetupOfferMSectionsByType(
+      SdpMediaSection::kApplication, Maybe<size_t>(), sdp);
+
+  NS_ENSURE_SUCCESS(rv, rv);
 
   if (!sdp->GetMediaSectionCount()) {
     JSEP_SET_ERROR("Cannot create an offer with no local tracks, "
                    "no offerToReceiveAudio/Video, and no DataChannel.");
     return NS_ERROR_INVALID_ARG;
   }
 
   return NS_OK;
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -1456,20 +1456,16 @@ PeerConnectionImpl::CreateOffer(const RT
 
   if (aOptions.mOfferToReceiveVideo.WasPassed()) {
     options.mOfferToReceiveVideo =
         mozilla::Some(size_t(aOptions.mOfferToReceiveVideo.Value()));
   }
 
   options.mIceRestart = mozilla::Some(aOptions.mIceRestart);
 
-  if (aOptions.mMozDontOfferDataChannel.WasPassed()) {
-    options.mDontOfferDataChannel =
-      mozilla::Some(aOptions.mMozDontOfferDataChannel.Value());
-  }
   return CreateOffer(options);
 }
 
 static void DeferredCreateOffer(const std::string& aPcHandle,
                                 const JsepOfferOptions& aOptions) {
   PeerConnectionWrapper wrapper(aPcHandle);
 
   if (wrapper.impl()) {