mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 769594: Make nsObjectLoadingContent use TestPermissionFromPrincipal. r=mounir
This commit is contained in:
parent
3e4b30be56
commit
5845c4644a
@ -496,19 +496,24 @@ nsresult nsObjectLoadingContent::IsPluginEnabledForType(const nsCString& aMIMETy
|
||||
rv = topWindow->GetDocument(getter_AddRefs(topDocument));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIDocument> topDoc = do_QueryInterface(topDocument);
|
||||
nsIURI* topUri = topDoc->GetDocumentURI();
|
||||
|
||||
nsCOMPtr<nsIPermissionManager> permissionManager = do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
PRUint32 permission;
|
||||
rv = permissionManager->TestPermission(topUri, "plugins", &permission);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
bool allowPerm = false;
|
||||
if (!nsContentUtils::IsSystemPrincipal(topDoc->NodePrincipal())) {
|
||||
PRUint32 permission;
|
||||
rv = permissionManager->TestPermissionFromPrincipal(topDoc->NodePrincipal(),
|
||||
"plugins",
|
||||
&permission);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
allowPerm = permission == nsIPermissionManager::ALLOW_ACTION;
|
||||
}
|
||||
|
||||
PRUint32 state;
|
||||
rv = pluginHost->GetBlocklistStateForType(aMIMEType.get(), &state);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (permission == nsIPermissionManager::ALLOW_ACTION &&
|
||||
if (allowPerm &&
|
||||
state != nsIBlocklistService::STATE_VULNERABLE_UPDATE_AVAILABLE &&
|
||||
state != nsIBlocklistService::STATE_VULNERABLE_NO_UPDATE) {
|
||||
mCTPPlayable = true;
|
||||
|
Loading…
Reference in New Issue
Block a user