Bug 1586370 - Tighten some MTG threading asserts. r=padenot

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2019-12-18 22:51:37 +00:00
parent a8f9785f19
commit 7e49593412
2 changed files with 6 additions and 2 deletions

View File

@ -125,7 +125,7 @@ TrackTime MediaTrackGraphImpl::GraphTimeToTrackTimeWithBlocking(
}
GraphTime MediaTrackGraphImpl::IterationEnd() const {
MOZ_ASSERT(OnGraphThreadOrNotRunning());
MOZ_ASSERT(OnGraphThread());
return CurrentDriver()->IterationEnd();
}
@ -676,7 +676,7 @@ nsresult MediaTrackGraphImpl::OpenAudioInput(CubebUtils::AudioDeviceID aID,
void MediaTrackGraphImpl::CloseAudioInputImpl(
Maybe<CubebUtils::AudioDeviceID>& aID, AudioDataListener* aListener) {
MOZ_ASSERT(OnGraphThreadOrNotRunning());
MOZ_ASSERT(OnGraphThread());
// It is possible to not know the ID here, find it first.
if (aID.isNothing()) {
for (auto iter = mInputDeviceUsers.Iter(); !iter.Done(); iter.Next()) {

View File

@ -854,6 +854,8 @@ class MediaTrackGraphImpl : public MediaTrackGraph,
#if DEBUG
if (mGraphDriverRunning) {
mMonitor.AssertCurrentThreadOwns();
} else {
MOZ_ASSERT(NS_IsMainThread());
}
#endif
return mLifecycleState;
@ -862,6 +864,8 @@ class MediaTrackGraphImpl : public MediaTrackGraph,
#if DEBUG
if (mGraphDriverRunning) {
mMonitor.AssertCurrentThreadOwns();
} else {
MOZ_ASSERT(NS_IsMainThread());
}
#endif
return mLifecycleState;