Bug 1437832 - Part 4: Remove unused function from PeerConnectionImpl r=jib a=lizzard
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 13 Feb 2018 14:40:49 -0600
changeset 452463 88e30cb3bd258505364122c3d166a194ebb73f51
parent 452462 9f0b85bbc92d2cf70d6559220535d8aa115fce72
child 452464 73e1a43624953a13ccefbd63bddc512ebc7960fc
push id8730
push userncsoregi@mozilla.com
push dateMon, 19 Feb 2018 10:18:40 +0000
treeherdermozilla-beta@88e30cb3bd25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, lizzard
bugs1437832
milestone59.0
Bug 1437832 - Part 4: Remove unused function from PeerConnectionImpl r=jib a=lizzard MozReview-Commit-ID: DJPLOWdm2IA
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -2323,51 +2323,16 @@ PeerConnectionImpl::DisablePacketDump(un
   MutexAutoLock lock(mPacketDumpFlagsMutex);
   if (level < packetDumpFlags->size()) {
     (*packetDumpFlags)[level] &= ~flag;
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-PeerConnectionImpl::RemoveTrack(MediaStreamTrack& aTrack) {
-  PC_AUTO_ENTER_API_CALL(true);
-
-  std::vector<RefPtr<TransceiverImpl>>& transceivers =
-    mMedia->GetTransceivers();
-
-  nsresult rv = NS_ERROR_INVALID_ARG;
-
-  for (RefPtr<TransceiverImpl>& transceiver : transceivers) {
-    if (transceiver->HasSendTrack(&aTrack)) {
-      // TODO(bug 1401983): Move DTMF stuff to TransceiverImpl
-      for (size_t i = 0; i < mDTMFStates.Length(); ++i) {
-        if (mDTMFStates[i]->mTransceiver.get() == transceiver.get()) {
-          mDTMFStates[i]->mSendTimer->Cancel();
-          mDTMFStates.RemoveElementAt(i);
-          break;
-        }
-      }
-
-      rv = transceiver->UpdateSendTrack(nullptr);
-      break;
-    }
-  }
-
-  if (NS_FAILED(rv)) {
-    CSFLogError(LOGTAG, "Error updating send track on transceiver");
-    return rv;
-  }
-
-  aTrack.RemovePrincipalChangeObserver(this);
-
-  return NS_OK;
-}
-
 static int GetDTMFToneCode(uint16_t c)
 {
   const char* DTMF_TONECODES = "0123456789*#ABCD";
 
   if (c == ',') {
     // , is a special character indicating a 2 second delay
     return -1;
   }
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -388,22 +388,16 @@ public:
 
   NS_IMETHODIMP CloseStreams();
 
   void CloseStreams(ErrorResult &rv)
   {
     rv = CloseStreams();
   }
 
-  NS_IMETHODIMP_TO_ERRORRESULT(RemoveTrack, ErrorResult &rv,
-                               mozilla::dom::MediaStreamTrack& aTrack)
-  {
-    rv = RemoveTrack(aTrack);
-  }
-
   already_AddRefed<TransceiverImpl> CreateTransceiverImpl(
       const nsAString& aKind,
       dom::MediaStreamTrack* aSendTrack,
       ErrorResult& rv);
 
   OwningNonNull<dom::MediaStreamTrack> CreateReceiveTrack(
       SdpMediaSection::MediaType type);