Bug 1213517 - Make applyConstraints() and getSettings() do nothing after stop and shutdown. r=jesup

MozReview-Commit-ID: Ez2Wmsoy617

--HG--
extra : rebase_source : b4efaab09652ce3cc5a421c47574c42c6c22f073
This commit is contained in:
Jan-Ivar Bruaroey 2016-07-06 16:55:58 -04:00
Родитель b8a3459024
Коммит 72df8fa880
1 изменённых файлов: 7 добавлений и 5 удалений

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

@ -1132,11 +1132,11 @@ public:
ApplyConstraints(nsPIDOMWindowInner* aWindow,
const MediaTrackConstraints& aConstraints) override
{
if (sInShutdown) {
if (sInShutdown || !mListener) {
// Track has been stopped, or we are in shutdown. In either case
// there's no observable outcome, so pretend we succeeded.
RefPtr<PledgeVoid> p = new PledgeVoid();
p->Reject(new MediaStreamError(aWindow,
NS_LITERAL_STRING("AbortError"),
NS_LITERAL_STRING("In shutdown")));
p->Resolve(false);
return p.forget();
}
return mListener->ApplyConstraintsToTrack(aWindow, mTrackID, aConstraints);
@ -1145,7 +1145,9 @@ public:
void
GetSettings(dom::MediaTrackSettings& aOutSettings) override
{
mListener->GetSettings(aOutSettings);
if (mListener) {
mListener->GetSettings(aOutSettings);
}
}
void Stop() override