Bug 1301675 - Remove MediaStreamTrackSource::mIsRemote. r=jib

MediaStreamTrack.remote is no longer part of the spec.

MozReview-Commit-ID: BgHJ1zNIoWN

--HG--
extra : rebase_source : 11022eb420cbdb0c7aa5aa7814cf35330f4170b9
This commit is contained in:
Andreas Pehrson 2016-09-12 15:59:58 +02:00
Родитель 9b3a88c7d4
Коммит 159d4ead9e
5 изменённых файлов: 15 добавлений и 30 удалений

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

@ -2205,7 +2205,6 @@ public:
explicit StreamCaptureTrackSource(MediaStreamTrackSource* aCapturedTrackSource)
: MediaStreamTrackSource(aCapturedTrackSource->GetPrincipal(),
true,
nsString())
, mCapturedTrackSource(aCapturedTrackSource)
{
@ -2239,6 +2238,7 @@ public:
void Stop() override
{
// XXX fix in later patch
NS_ERROR("We're reporting remote=true to not be stoppable. "
"Stop() should not be called.");
}
@ -2276,7 +2276,6 @@ public:
explicit DecoderCaptureTrackSource(HTMLMediaElement* aElement)
: MediaStreamTrackSource(nsCOMPtr<nsIPrincipal>(aElement->GetCurrentPrincipal()).get(),
true,
nsString())
, mElement(aElement)
{
@ -2315,6 +2314,7 @@ public:
void Stop() override
{
// XXX Fix in later patch.
NS_ERROR("We're reporting remote=true to not be stoppable. "
"Stop() should not be called.");
}

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

@ -1170,7 +1170,7 @@ public:
const MediaSourceEnum aSource,
const TrackID aTrackID,
const PeerIdentity* aPeerIdentity)
: MediaStreamTrackSource(aPrincipal, false, aLabel), mListener(aListener),
: MediaStreamTrackSource(aPrincipal, aLabel), mListener(aListener),
mSource(aSource), mTrackID(aTrackID), mPeerIdentity(aPeerIdentity) {}
MediaSourceEnum GetMediaSource() const override

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

@ -124,8 +124,7 @@ MediaStreamTrack::MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID,
mInputTrackID(aInputTrackID), mSource(aSource),
mPrincipal(aSource->GetPrincipal()),
mReadyState(MediaStreamTrackState::Live),
mEnabled(true), mRemote(aSource->IsRemote()),
mConstraints(aConstraints)
mEnabled(true), mConstraints(aConstraints)
{
GetSource().RegisterSink(this);
@ -236,11 +235,6 @@ MediaStreamTrack::Stop()
return;
}
if (mRemote) {
LOG(LogLevel::Warning, ("MediaStreamTrack %p is remote. Can't be stopped.", this));
return;
}
if (!mSource) {
MOZ_ASSERT(false);
return;

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

@ -61,10 +61,8 @@ public:
};
MediaStreamTrackSource(nsIPrincipal* aPrincipal,
const bool aIsRemote,
const nsString& aLabel)
: mPrincipal(aPrincipal),
mIsRemote(aIsRemote),
mLabel(aLabel),
mStopped(false)
{
@ -106,12 +104,6 @@ public:
*/
virtual const PeerIdentity* GetPeerIdentity() const { return nullptr; }
/**
* Indicates whether the track is remote or not per the MediaCapture and
* Streams spec.
*/
virtual bool IsRemote() const { return mIsRemote; }
/**
* MediaStreamTrack::GetLabel (see spec) calls through to here.
*/
@ -164,7 +156,7 @@ public:
void UnregisterSink(Sink* aSink)
{
MOZ_ASSERT(NS_IsMainThread());
if (mSinks.RemoveElement(aSink) && mSinks.IsEmpty() && !IsRemote()) {
if (mSinks.RemoveElement(aSink) && mSinks.IsEmpty()) {
Stop();
mStopped = true;
}
@ -193,14 +185,11 @@ protected:
// Currently registered sinks.
nsTArray<Sink*> mSinks;
// True if this is a remote track source, i.e., a PeerConnection.
const bool mIsRemote;
// The label of the track we are the source of per the MediaStreamTrack spec.
const nsString mLabel;
// True if this source is not remote, all MediaStreamTrack users have
// unregistered from this source and Stop() has been called.
// True if all MediaStreamTrack users have unregistered from this source and
// Stop() has been called.
bool mStopped;
};
@ -213,14 +202,13 @@ public:
explicit BasicUnstoppableTrackSource(nsIPrincipal* aPrincipal,
const MediaSourceEnum aMediaSource =
MediaSourceEnum::Other)
: MediaStreamTrackSource(aPrincipal, true, nsString())
: MediaStreamTrackSource(aPrincipal, nsString())
, mMediaSource(aMediaSource)
{}
MediaSourceEnum GetMediaSource() const override { return mMediaSource; }
void
GetSettings(dom::MediaTrackSettings& aResult) override {}
void GetSettings(dom::MediaTrackSettings& aResult) override {}
void Stop() override {}
@ -485,7 +473,6 @@ protected:
nsString mID;
MediaStreamTrackState mReadyState;
bool mEnabled;
const bool mRemote;
dom::MediaTrackConstraints mConstraints;
};

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

@ -161,7 +161,7 @@ class RemoteTrackSource : public dom::MediaStreamTrackSource
{
public:
explicit RemoteTrackSource(nsIPrincipal* aPrincipal, const nsString& aLabel)
: dom::MediaStreamTrackSource(aPrincipal, true, aLabel) {}
: dom::MediaStreamTrackSource(aPrincipal, aLabel) {}
dom::MediaSourceEnum GetMediaSource() const override
{
@ -172,7 +172,11 @@ public:
ApplyConstraints(nsPIDOMWindowInner* aWindow,
const dom::MediaTrackConstraints& aConstraints) override;
void Stop() override { NS_ERROR("Can't stop a remote source!"); }
void Stop() override
{
// XXX Fix in later patch.
NS_ERROR("Can't stop a remote source!");
}
void SetPrincipal(nsIPrincipal* aPrincipal)
{