Bug 1301675 - Rename BasicUnstoppableTrackSource to BasicTrackSource. r=jib

They are not unstoppable any longer. We just don't forward Stop() to the real source.

MozReview-Commit-ID: FdFccMsD3eb

--HG--
extra : rebase_source : e29a1abb8f2060cb72399d61d91ca3a00128f08c
This commit is contained in:
Andreas Pehrson 2016-09-16 15:19:28 +02:00
Родитель ee5849fc81
Коммит 825d513165
4 изменённых файлов: 11 добавлений и 35 удалений

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

@ -2263,17 +2263,6 @@ public:
return mCapturedTrackSource->GetCORSMode();
}
already_AddRefed<PledgeVoid>
ApplyConstraints(nsPIDOMWindowInner* aWindow,
const dom::MediaTrackConstraints& aConstraints) override
{
RefPtr<PledgeVoid> p = new PledgeVoid();
p->Reject(new dom::MediaStreamError(aWindow,
NS_LITERAL_STRING("OverconstrainedError"),
NS_LITERAL_STRING("")));
return p.forget();
}
void Stop() override
{
if (mElement && mElement->mSrcStream) {
@ -2350,17 +2339,6 @@ public:
return mElement->GetCORSMode();
}
already_AddRefed<PledgeVoid>
ApplyConstraints(nsPIDOMWindowInner* aWindow,
const dom::MediaTrackConstraints& aConstraints) override
{
RefPtr<PledgeVoid> p = new PledgeVoid();
p->Reject(new dom::MediaStreamError(aWindow,
NS_LITERAL_STRING("OverconstrainedError"),
NS_LITERAL_STRING("")));
return p.forget();
}
void Stop() override
{
// We don't notify the source that a track was stopped since it will keep

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

@ -176,7 +176,7 @@ public:
nsPIDOMWindowInner* window = mStream->GetParentObject();
nsIDocument* doc = window ? window->GetExtantDoc() : nullptr;
nsIPrincipal* principal = doc ? doc->NodePrincipal() : nullptr;
source = new BasicUnstoppableTrackSource(principal);
source = new BasicTrackSource(principal);
}
RefPtr<MediaStreamTrack> newTrack =
@ -859,8 +859,8 @@ DOMMediaStream::InitAudioCaptureStream(nsIPrincipal* aPrincipal, MediaStreamGrap
{
const TrackID AUDIO_TRACK = 1;
RefPtr<BasicUnstoppableTrackSource> audioCaptureSource =
new BasicUnstoppableTrackSource(aPrincipal, MediaSourceEnum::AudioCapture);
RefPtr<BasicTrackSource> audioCaptureSource =
new BasicTrackSource(aPrincipal, MediaSourceEnum::AudioCapture);
AudioCaptureStream* audioCaptureStream =
static_cast<AudioCaptureStream*>(aGraph->CreateAudioCaptureStream(AUDIO_TRACK));

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

@ -134,7 +134,7 @@ GetMediaManagerLog()
}
#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg)
using dom::BasicUnstoppableTrackSource;
using dom::BasicTrackSource;
using dom::ConstrainDOMStringParameters;
using dom::File;
using dom::GetUserMediaRequest;
@ -1022,7 +1022,7 @@ public:
"Only fake tracks should appear dynamically");
NS_ASSERTION(kVideoTrack != aInputTrackID,
"Only fake tracks should appear dynamically");
return do_AddRef(new BasicUnstoppableTrackSource(mPrincipal));
return do_AddRef(new BasicTrackSource(mPrincipal));
}
protected:

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

@ -194,12 +194,12 @@ protected:
};
/**
* Basic implementation of MediaStreamTrackSource that ignores Stop().
* Basic implementation of MediaStreamTrackSource that doesn't forward Stop().
*/
class BasicUnstoppableTrackSource : public MediaStreamTrackSource
class BasicTrackSource : public MediaStreamTrackSource
{
public:
explicit BasicUnstoppableTrackSource(nsIPrincipal* aPrincipal,
explicit BasicTrackSource(nsIPrincipal* aPrincipal,
const MediaSourceEnum aMediaSource =
MediaSourceEnum::Other)
: MediaStreamTrackSource(aPrincipal, nsString())
@ -208,12 +208,10 @@ public:
MediaSourceEnum GetMediaSource() const override { return mMediaSource; }
void GetSettings(dom::MediaTrackSettings& aResult) override {}
void Stop() override {}
protected:
~BasicUnstoppableTrackSource() {}
~BasicTrackSource() {}
const MediaSourceEnum mMediaSource;
};