Bug 906986 - Rework fix for Bug 1241690 to avoid reliance on NrIceCtx inside NrIceMediaStream. r=bwc, r=drno
authorMichael Froman <mfroman@mozilla.com>
Thu, 31 Mar 2016 09:24:17 -0500
changeset 316249 0786093c2c50c407c70a855f0880d17abe590316
parent 316248 a392a2f7b117b054be9ab85b283a58a926f09e62
child 316250 b752c6a3ed5abe6ac112701d0537724323a7c3a2
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc, drno
bugs906986, 1241690
milestone48.0a1
Bug 906986 - Rework fix for Bug 1241690 to avoid reliance on NrIceCtx inside NrIceMediaStream. r=bwc, r=drno MozReview-Commit-ID: 1QCfbZUGdwM
media/mtransport/nricemediastream.cpp
--- a/media/mtransport/nricemediastream.cpp
+++ b/media/mtransport/nricemediastream.cpp
@@ -301,17 +301,17 @@ nsresult NrIceMediaStream::GetActivePair
 nsresult NrIceMediaStream::GetCandidatePairs(std::vector<NrIceCandidatePair>*
                                              out_pairs) const {
   MOZ_ASSERT(out_pairs);
   if (!stream_) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   // If we haven't at least started checking then there is nothing to report
-  if (ctx_->connection_state() == NrIceCtx::ICE_CTX_INIT) {
+  if (ctx_->peer()->state != NR_ICE_PEER_STATE_PAIRED) {
     return NS_OK;
   }
 
   // Get the check_list on the peer stream (this is where the check_list
   // actually lives, not in stream_)
   nr_ice_media_stream* peer_stream;
   int r = nr_ice_peer_ctx_find_pstream(ctx_->peer(), stream_, &peer_stream);
   if (r != 0) {
@@ -485,17 +485,17 @@ nsresult NrIceMediaStream::GetLocalCandi
 
 nsresult NrIceMediaStream::GetRemoteCandidates(
     std::vector<NrIceCandidate>* candidates) const {
   if (!stream_) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   // If we haven't at least started checking then there is nothing to report
-  if (ctx_->connection_state() == NrIceCtx::ICE_CTX_INIT) {
+  if (ctx_->peer()->state != NR_ICE_PEER_STATE_PAIRED) {
     return NS_OK;
   }
 
   nr_ice_media_stream* peer_stream;
   int r = nr_ice_peer_ctx_find_pstream(ctx_->peer(), stream_, &peer_stream);
   if (r != 0) {
     return NS_ERROR_FAILURE;
   }