Bug 1237909 part 1 - Remove unused TransportLayer::RunOnThread function. r=bwc
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 25 Jan 2016 14:52:34 +1100
changeset 303682 37f845dd11e7365a469c0316fe56685a641dd071
parent 303681 62b5f4684fa94c890beae19ef7e47fa9159ff151
child 303683 e9e0aaa18f4a1875532889c4a8033afa581ecfd4
push id8978
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 14:05:32 +0000
treeherdermozilla-aurora@b9a803752a2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1237909
milestone46.0a1
Bug 1237909 part 1 - Remove unused TransportLayer::RunOnThread function. r=bwc
media/mtransport/transportlayer.cpp
media/mtransport/transportlayer.h
--- a/media/mtransport/transportlayer.cpp
+++ b/media/mtransport/transportlayer.cpp
@@ -44,24 +44,9 @@ void TransportLayer::SetState(State stat
     MOZ_MTLOG(state == TS_ERROR ? ML_ERROR : ML_DEBUG,
               file << ":" << line << ": " <<
               LAYER_INFO << "state " << state_ << "->" << state);
     state_ = state;
     SignalStateChange(this, state);
   }
 }
 
-nsresult TransportLayer::RunOnThread(nsIRunnable *event) {
-  if (target_) {
-    nsIThread *thr;
-
-    DebugOnly<nsresult> rv = NS_GetCurrentThread(&thr);
-    MOZ_ASSERT(NS_SUCCEEDED(rv));
-
-    if (target_ != thr) {
-      return target_->Dispatch(event, NS_DISPATCH_SYNC);
-    }
-  }
-
-  return event->Run();
-}
-
 }  // close namespace
--- a/media/mtransport/transportlayer.h
+++ b/media/mtransport/transportlayer.h
@@ -52,20 +52,16 @@ class TransportLayer : public sigslot::h
   virtual nsresult InitInternal() { return NS_OK; } // Called by Init
 
   // Called when inserted into a flow
   virtual void Inserted(TransportFlow *flow, TransportLayer *downward);
 
   // Downward interface
   TransportLayer *downward() { return downward_; }
 
-  // Dispatch a call onto our thread (or run on the same thread if
-  // thread is not set). This is always synchronous.
-  nsresult RunOnThread(nsIRunnable *event);
-
   // Get the state
   State state() const { return state_; }
   // Must be implemented by derived classes
   virtual TransportResult SendPacket(const unsigned char *data, size_t len) = 0;
 
   // Get the thread.
   const nsCOMPtr<nsIEventTarget> GetThread() const {
     return target_;