зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1638559 - return a deny action when the window context is null. r=bryce
I suspect that when enabling Fission, in some situation, we might get a null window context which results in a crash. Therefore, returning a deny action if we are not able to get a window context. Differential Revision: https://phabricator.services.mozilla.com/D76196
This commit is contained in:
Родитель
c524d44aa8
Коммит
0445af8ee7
|
@ -60,9 +60,13 @@ static uint32_t SiteAutoplayPerm(nsPIDOMWindowInner* aWindow) {
|
|||
if (!aWindow || !aWindow->GetBrowsingContext()) {
|
||||
return nsIPermissionManager::DENY_ACTION;
|
||||
}
|
||||
return aWindow->GetBrowsingContext()
|
||||
->GetTopWindowContext()
|
||||
->GetAutoplayPermission();
|
||||
|
||||
WindowContext* topContext =
|
||||
aWindow->GetBrowsingContext()->GetTopWindowContext();
|
||||
if (!topContext) {
|
||||
return nsIPermissionManager::DENY_ACTION;
|
||||
}
|
||||
return topContext->GetAutoplayPermission();
|
||||
}
|
||||
|
||||
static bool IsWindowAllowedToPlay(nsPIDOMWindowInner* aWindow) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче