Bug 1488832 - Change init assert to runtime guard. r=jib

Differential Revision: https://phabricator.services.mozilla.com/D6144

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2018-09-20 12:29:50 +00:00
parent 3f65f029bf
commit 529b7c66ea

View File

@ -187,9 +187,13 @@ MediaEngineRemoteVideoSource::Allocate(
LOG((__PRETTY_FUNCTION__));
AssertIsOnOwningThread();
MOZ_ASSERT(mInitDone);
MOZ_ASSERT(mState == kReleased);
if (!mInitDone) {
LOG(("Init not done"));
return NS_ERROR_FAILURE;
}
NormalizedConstraints constraints(aConstraints);
webrtc::CaptureCapability newCapability;
LOG(("ChooseCapability(kFitness) for mCapability (Allocate) ++"));
@ -292,8 +296,8 @@ MediaEngineRemoteVideoSource::Start(const RefPtr<const AllocationHandle>& aHandl
LOG((__PRETTY_FUNCTION__));
AssertIsOnOwningThread();
MOZ_ASSERT(mInitDone);
MOZ_ASSERT(mState == kAllocated || mState == kStopped);
MOZ_ASSERT(mInitDone);
MOZ_ASSERT(mStream);
MOZ_ASSERT(IsTrackIDExplicit(mTrackID));