Bug 1302350 - part3 : provide a method to know the media-block-state before connecting to the AudioChannelService r=baku

In order to refactor the blocking mechanism, we want to know the blocking state
before calling notifyStartedPlaying().

MozReview-Commit-ID: 3wa2M7qwUAm

--HG--
extra : rebase_source : d128463b7fd892b966d80d5b5f76537819f35bcf
This commit is contained in:
Alastor Wu 2016-11-01 17:46:11 +08:00
Родитель c2f555c0fd
Коммит 45cac62c4c
2 изменённых файлов: 7 добавлений и 0 удалений

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

@ -361,3 +361,9 @@ AudioChannelAgent::IsPlayingStarted() const
return mIsRegToService;
}
bool
AudioChannelAgent::ShouldBlockMedia() const
{
return mWindow ?
mWindow->GetMediaSuspend() == nsISuspendedTypes::SUSPENDED_BLOCK : false;
}

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

@ -49,6 +49,7 @@ public:
uint64_t InnerWindowID() const;
bool IsPlayingStarted() const;
bool ShouldBlockMedia() const;
private:
virtual ~AudioChannelAgent();