зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1505494 - not allow autoplay if we don't have a document. r=cpearce
In order to avoid the nullptr crash when using `approver`. Differential Revision: https://phabricator.services.mozilla.com/D11501 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d40d607632
Коммит
5657ac5a73
|
@ -91,6 +91,10 @@ IsWindowAllowedToPlay(nsPIDOMWindowInner* aWindow)
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIDocument* approver = ApproverDocOf(*aWindow->GetExtantDoc());
|
nsIDocument* approver = ApproverDocOf(*aWindow->GetExtantDoc());
|
||||||
|
if (!approver) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (nsContentUtils::IsExactSitePermAllow(approver->NodePrincipal(),
|
if (nsContentUtils::IsExactSitePermAllow(approver->NodePrincipal(),
|
||||||
"autoplay-media")) {
|
"autoplay-media")) {
|
||||||
AUTOPLAY_LOG("Allow autoplay as document has autoplay permission.");
|
AUTOPLAY_LOG("Allow autoplay as document has autoplay permission.");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче