Bug 1652108 - part3 : remove relevant codes for 'autoplay_would_be_allowed_count' and 'autoplay_would_not_be_allowed_count'. r=bryce

We don't need `autoplay_would_be_allowed_count` and `autoplay_would_not_be_allowed_count`, so we can remove all related codes.

Differential Revision: https://phabricator.services.mozilla.com/D83227
This commit is contained in:
alwu
2020-09-23 22:35:26 +00:00
parent dec4bc83f9
commit 7fc37f86fb
5 changed files with 0 additions and 72 deletions

View File

@@ -4258,20 +4258,6 @@ void HTMLMediaElement::SetPlayedOrSeeked(bool aValue) {
void HTMLMediaElement::NotifyXPCOMShutdown() { ShutdownDecoder(); }
void HTMLMediaElement::UpdateHadAudibleAutoplayState() {
// If we're audible, and autoplaying...
if ((Volume() > 0.0 && !Muted()) &&
(!OwnerDoc()->HasBeenUserGestureActivated() || Autoplay())) {
if (AutoplayPolicyTelemetryUtils::WouldBeAllowedToPlayIfAutoplayDisabled(
*this)) {
ScalarAdd(Telemetry::ScalarID::MEDIA_AUTOPLAY_WOULD_BE_ALLOWED_COUNT, 1);
} else {
ScalarAdd(Telemetry::ScalarID::MEDIA_AUTOPLAY_WOULD_NOT_BE_ALLOWED_COUNT,
1);
}
}
}
already_AddRefed<Promise> HTMLMediaElement::Play(ErrorResult& aRv) {
LOG(LogLevel::Debug,
("%p Play() called by JS readyState=%d", this, mReadyState.Ref()));
@@ -4326,8 +4312,6 @@ already_AddRefed<Promise> HTMLMediaElement::Play(ErrorResult& aRv) {
return promise.forget();
}
UpdateHadAudibleAutoplayState();
const bool handlingUserInput = UserActivation::IsHandlingUserInput();
mPendingPlayPromises.AppendElement(promise);
@@ -6140,7 +6124,6 @@ void HTMLMediaElement::CheckAutoplayDataReady() {
return;
}
UpdateHadAudibleAutoplayState();
if (!AutoplayPolicy::IsAllowedToPlay(*this)) {
DispatchEventsWhenPlayWasNotAllowed();
return;