Bug 1290948 - Part 6: Remove some unused code. r+drno r=drno

MozReview-Commit-ID: G1uxg77wO78

--HG--
extra : rebase_source : 565120ee7722ac357b682aa2689517f2898e5c7a
This commit is contained in:
Byron Campen [:bwc] 2017-08-23 16:15:11 -05:00
Родитель 486760074a
Коммит 6771ce65da
7 изменённых файлов: 7 добавлений и 173 удалений

Просмотреть файл

@ -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<std::queue<mozilla::TransportLayer *> > layers(

Просмотреть файл

@ -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<NrIceCtx> ctx,
RefPtr<NrIceMediaStream> stream,
void TransportLayerIce::SetParameters(RefPtr<NrIceMediaStream> 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<NrIceCtx> ctx,
<< old_stream_->name() << ")");
}
ctx_ = ctx;
stream_ = stream;
component_ = component;
@ -129,8 +126,6 @@ void TransportLayerIce::SetParameters(RefPtr<NrIceCtx> ctx,
}
void TransportLayerIce::PostSetup() {
target_ = ctx_->thread();
stream_->SignalReady.connect(this, &TransportLayerIce::IceReady);
stream_->SignalFailed.connect(this, &TransportLayerIce::IceFailed);
stream_->SignalPacketReceived.connect(this,

Просмотреть файл

@ -30,12 +30,11 @@ namespace mozilla {
class TransportLayerIce : public TransportLayer {
public:
explicit TransportLayerIce(const std::string& name);
TransportLayerIce();
virtual ~TransportLayerIce();
void SetParameters(RefPtr<NrIceCtx> ctx,
RefPtr<NrIceMediaStream> stream,
void SetParameters(RefPtr<NrIceMediaStream> 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<NrIceCtx> ctx_;
RefPtr<NrIceMediaStream> stream_;
int component_;

Просмотреть файл

@ -1608,20 +1608,6 @@ nsresult MediaPipelineTransmit::ReplaceTrack(RefPtr<MediaStreamTrack>& 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<TransportLayerDtls *>(
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_);

Просмотреть файл

@ -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);

Просмотреть файл

@ -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<JSObject*> aGivenProto)
{
return MediaStreamListBinding::Wrap(cx, this, aGivenProto);
}
nsISupports*
MediaStreamList::GetParentObject()
{
return mPeerConnection->GetWindow();
}
template<class T>
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

Просмотреть файл

@ -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<JSObject*> aGivenProto)
override;
nsISupports* GetParentObject();
DOMMediaStream* IndexedGetter(uint32_t index, bool& found);
uint32_t Length();
private:
virtual ~MediaStreamList();
RefPtr<PeerConnectionImpl> mPeerConnection;
StreamType mType;
};
} // namespace dom
} // namespace mozilla
#endif // MediaStreamList_h__