Bug 1617033 - part3 : add comment to explicitly mention some functions should only be used after starting listener. r=chunmin

Differential Revision: https://phabricator.services.mozilla.com/D63916
This commit is contained in:
alwu
2020-03-06 17:46:44 +00:00
parent f862f1f153
commit 1ce08c48d8

View File

@@ -426,6 +426,11 @@ class HTMLMediaElement::MediaControlEventListener final
mControlAgent = nullptr;
}
bool IsStarted() const { return mState != ControlledMediaState::eStopped; }
/**
* Following methods should only be used after starting listener.
*/
void NotifyMediaStartedPlaying() {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(IsStarted());
@@ -474,8 +479,6 @@ class HTMLMediaElement::MediaControlEventListener final
}
}
bool IsStarted() const { return mState != ControlledMediaState::eStopped; }
private:
~MediaControlEventListener() = default;