commit 0b818646649d7167fddffb9392dd4c224e77100a
parent ca2ec1f19a8ef81e2c5ec6b637e241b40468adfa
Author: Cristian Tuns <ctuns@mozilla.com>
Date: Thu, 13 Nov 2025 22:39:14 -0500
Revert "Bug 1996123 - Permit consecutive Android autoplay permission grants/denials of the same type. r=media-playback-reviewers,aosmond,alwu" for causing build bustages in GVAutoplayPermissionRequest.cpp
This reverts commit 720bc69d6efaf36bd3e6f49d56a946cd5905e18a.
Diffstat:
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/dom/media/autoplay/GVAutoplayPermissionRequest.cpp b/dom/media/autoplay/GVAutoplayPermissionRequest.cpp
@@ -132,16 +132,13 @@ void GVAutoplayPermissionRequest::SetRequestStatus(RStatus aStatus) {
NS_IMETHODIMP
GVAutoplayPermissionRequest::Cancel() {
MOZ_ASSERT(mContext, "Do not call 'Cancel()' twice!");
- // As the process of replying to the request is an async task, the status
- // might have been reset at the time we get the result from parent process.
- // Ex. if the page got closed or navigated immediately after user replied to
+ // As the process of replying of the request is an async task, the status
+ // might have be reset at the time we get the result from parent process.
+ // Ex. if the page got closed or naviagated immediately after user replied to
// the request. Therefore, the status should be either `pending` or `unknown`.
- // Additionally, we tolerate `canceled` if the request was already canceled.
- // See Bug 1996123 for details on the multiple cancel.
const RStatus status = GetRequestStatus(mContext, mType);
REQUEST_LOG("Cancel, current status=%s", EnumValueToString(status));
- MOZ_ASSERT(status == RStatus::ePENDING || RStatus::eDENIED ||
- status == RStatus::eUNKNOWN);
+ MOZ_ASSERT(status == RStatus::ePENDING || status == RStatus::eUNKNOWN);
if ((status == RStatus::ePENDING) && !mContext->IsDiscarded()) {
SetRequestStatus(RStatus::eDENIED);
}
@@ -152,16 +149,13 @@ GVAutoplayPermissionRequest::Cancel() {
NS_IMETHODIMP
GVAutoplayPermissionRequest::Allow(JS::Handle<JS::Value> aChoices) {
MOZ_ASSERT(mContext, "Do not call 'Allow()' twice!");
- // As the process of replying to the request is an async task, the status
- // might have been reset at the time we get the result from parent process.
- // Ex. if the page got closed or navigated immediately after user replied to
+ // As the process of replying of the request is an async task, the status
+ // might have be reset at the time we get the result from parent process.
+ // Ex. if the page got closed or naviagated immediately after user replied to
// the request. Therefore, the status should be either `pending` or `unknown`.
- // Additionally, we tolerate `allowed` if the request was already allowed.
- // See Bug 1996123 for details on the multiple allow.
const RStatus status = GetRequestStatus(mContext, mType);
REQUEST_LOG("Allow, current status=%s", EnumValueToString(status));
- MOZ_ASSERT(status == RStatus::ePENDING || status == RStatus::eALLOWED ||
- status == RStatus::eUNKNOWN);
+ MOZ_ASSERT(status == RStatus::ePENDING || status == RStatus::eUNKNOWN);
if (status == RStatus::ePENDING) {
SetRequestStatus(RStatus::eALLOWED);
// Permission grant may arrive late and elements may be suspended.
@@ -172,6 +166,7 @@ GVAutoplayPermissionRequest::Allow(JS::Handle<JS::Value> aChoices) {
/* no extra string data */ nullptr);
}
}
+
mContext = nullptr;
return NS_OK;
}