diff --git a/media/mtransport/test/transport_unittests.cpp b/media/mtransport/test/transport_unittests.cpp index 49184e7d5cdd..01ec1cf1eb76 100644 --- a/media/mtransport/test/transport_unittests.cpp +++ b/media/mtransport/test/transport_unittests.cpp @@ -614,8 +614,8 @@ class TransportTestPeer : public sigslot::has_slots<> { connect(this, &TransportTestPeer::GotCandidate); // Create the transport layer - ice_ = new TransportLayerIce(name); - ice_->SetParameters(ice_ctx_->ctx(), stream, 1); + ice_ = new TransportLayerIce(); + ice_->SetParameters(stream, 1); // Assemble the stack nsAutoPtr > layers( diff --git a/media/mtransport/transportlayerice.cpp b/media/mtransport/transportlayerice.cpp index df4456bdd08a..b8e59ab2fac9 100644 --- a/media/mtransport/transportlayerice.cpp +++ b/media/mtransport/transportlayerice.cpp @@ -84,9 +84,8 @@ namespace mozilla { MOZ_MTLOG_MODULE("mtransport") -TransportLayerIce::TransportLayerIce(const std::string& name) - : name_(name), - ctx_(nullptr), stream_(nullptr), component_(0), +TransportLayerIce::TransportLayerIce() + : stream_(nullptr), component_(0), old_stream_(nullptr) { // setup happens later @@ -96,8 +95,7 @@ TransportLayerIce::~TransportLayerIce() { // No need to do anything here, since we use smart pointers } -void TransportLayerIce::SetParameters(RefPtr ctx, - RefPtr stream, +void TransportLayerIce::SetParameters(RefPtr stream, int component) { // Stream could be null in the case of some badly written js that causes // us to be in an ICE restart case, but not have valid streams due to @@ -121,7 +119,6 @@ void TransportLayerIce::SetParameters(RefPtr ctx, << old_stream_->name() << ")"); } - ctx_ = ctx; stream_ = stream; component_ = component; @@ -129,8 +126,6 @@ void TransportLayerIce::SetParameters(RefPtr ctx, } void TransportLayerIce::PostSetup() { - target_ = ctx_->thread(); - stream_->SignalReady.connect(this, &TransportLayerIce::IceReady); stream_->SignalFailed.connect(this, &TransportLayerIce::IceFailed); stream_->SignalPacketReceived.connect(this, diff --git a/media/mtransport/transportlayerice.h b/media/mtransport/transportlayerice.h index 64b33b43110e..9f18c02b49a9 100644 --- a/media/mtransport/transportlayerice.h +++ b/media/mtransport/transportlayerice.h @@ -30,12 +30,11 @@ namespace mozilla { class TransportLayerIce : public TransportLayer { public: - explicit TransportLayerIce(const std::string& name); + TransportLayerIce(); virtual ~TransportLayerIce(); - void SetParameters(RefPtr ctx, - RefPtr stream, + void SetParameters(RefPtr stream, int component); void ResetOldStream(); // called after successful ice restart @@ -57,8 +56,6 @@ class TransportLayerIce : public TransportLayer { DISALLOW_COPY_ASSIGN(TransportLayerIce); void PostSetup(); - const std::string name_; - RefPtr ctx_; RefPtr stream_; int component_; diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp index 55c8e9a314f3..63d57b6a0c1c 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp @@ -1608,20 +1608,6 @@ nsresult MediaPipelineTransmit::ReplaceTrack(RefPtr& domtrack) return NS_OK; } -void MediaPipeline::DisconnectTransport_s(TransportInfo &info) { - MOZ_ASSERT(info.transport_); - ASSERT_ON_THREAD(sts_thread_); - - info.transport_->SignalStateChange.disconnect(this); - // We do this even if we're a transmitter, since we are still possibly - // registered to receive RTCP. - TransportLayerDtls *dtls = static_cast( - info.transport_->GetLayer(TransportLayerDtls::ID())); - MOZ_ASSERT(dtls); // DTLS is mandatory - MOZ_ASSERT(dtls->downward()); - dtls->downward()->SignalPacketReceived.disconnect(this); -} - nsresult MediaPipeline::ConnectTransport_s(TransportInfo &info) { MOZ_ASSERT(info.transport_); ASSERT_ON_THREAD(sts_thread_); diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h index dd8d1baac60b..6242e6cd68b9 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h @@ -234,8 +234,6 @@ class MediaPipeline : public sigslot::has_slots<> { virtual nsresult TransportReady_s(TransportInfo &info); void UpdateRtcpMuxState(TransportInfo &info); - // Unhooks from signals - void DisconnectTransport_s(TransportInfo &info); nsresult ConnectTransport_s(TransportInfo &info); TransportInfo* GetTransportInfo_s(TransportFlow *flow); diff --git a/media/webrtc/signaling/src/peerconnection/MediaStreamList.cpp b/media/webrtc/signaling/src/peerconnection/MediaStreamList.cpp deleted file mode 100644 index a2e646e3b27e..000000000000 --- a/media/webrtc/signaling/src/peerconnection/MediaStreamList.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "CSFLog.h" -#include "base/basictypes.h" -#include "MediaStreamList.h" -#include "mozilla/dom/MediaStreamListBinding.h" -#include "nsIScriptGlobalObject.h" -#include "PeerConnectionImpl.h" -#include "PeerConnectionMedia.h" - -namespace mozilla { -namespace dom { - -MediaStreamList::MediaStreamList(PeerConnectionImpl* peerConnection, - StreamType type) - : mPeerConnection(peerConnection), - mType(type) -{ -} - -MediaStreamList::~MediaStreamList() -{ -} - -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(MediaStreamList) - -NS_IMPL_CYCLE_COLLECTING_ADDREF(MediaStreamList) -NS_IMPL_CYCLE_COLLECTING_RELEASE(MediaStreamList) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MediaStreamList) - NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END - -JSObject* -MediaStreamList::WrapObject(JSContext* cx, JS::Handle aGivenProto) -{ - return MediaStreamListBinding::Wrap(cx, this, aGivenProto); -} - -nsISupports* -MediaStreamList::GetParentObject() -{ - return mPeerConnection->GetWindow(); -} - -template -static DOMMediaStream* -GetStreamFromInfo(T* info, bool& found) -{ - if (!info) { - found = false; - return nullptr; - } - - found = true; - return info->GetMediaStream(); -} - -DOMMediaStream* -MediaStreamList::IndexedGetter(uint32_t index, bool& found) -{ - if (!mPeerConnection->media()) { // PeerConnection closed - found = false; - return nullptr; - } - if (mType == Local) { - return GetStreamFromInfo(mPeerConnection->media()-> - GetLocalStreamByIndex(index), found); - } - - return GetStreamFromInfo(mPeerConnection->media()-> - GetRemoteStreamByIndex(index), found); -} - -uint32_t -MediaStreamList::Length() -{ - if (!mPeerConnection->media()) { // PeerConnection closed - return 0; - } - return mType == Local ? mPeerConnection->media()->LocalStreamsLength() : - mPeerConnection->media()->RemoteStreamsLength(); -} - -} // namespace dom -} // namespace mozilla diff --git a/media/webrtc/signaling/src/peerconnection/MediaStreamList.h b/media/webrtc/signaling/src/peerconnection/MediaStreamList.h deleted file mode 100644 index de9040227d2c..000000000000 --- a/media/webrtc/signaling/src/peerconnection/MediaStreamList.h +++ /dev/null @@ -1,54 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef MediaStreamList_h__ -#define MediaStreamList_h__ - -#include "mozilla/ErrorResult.h" -#include "nsISupportsImpl.h" -#include "nsAutoPtr.h" -#include "nsWrapperCache.h" - -#ifdef USE_FAKE_MEDIA_STREAMS -#include "FakeMediaStreams.h" -#else -#include "DOMMediaStream.h" -#endif - -namespace mozilla { -class PeerConnectionImpl; -namespace dom { - -class MediaStreamList : public nsISupports, - public nsWrapperCache -{ -public: - enum StreamType { - Local, - Remote - }; - - MediaStreamList(PeerConnectionImpl* peerConnection, StreamType type); - - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaStreamList) - - virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) - override; - nsISupports* GetParentObject(); - - DOMMediaStream* IndexedGetter(uint32_t index, bool& found); - uint32_t Length(); - -private: - virtual ~MediaStreamList(); - - RefPtr mPeerConnection; - StreamType mType; -}; - -} // namespace dom -} // namespace mozilla - -#endif // MediaStreamList_h__