Backed out changeset e9d838084096 (bug 1181555) for Linux x64 opt and B2G Desktop Linux x64 opt Hazard analysis fail. r=backout

This commit is contained in:
Sebastian Hengst 2015-08-22 21:53:48 +02:00
parent 013a3c6c8f
commit edfba8b700
2 changed files with 3 additions and 32 deletions

View File

@ -579,12 +579,6 @@ this.PermissionsTable = { geolocation: {
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"moz-extremely-unstable-and-will-change-webcomponents": {
app: DENY_ACTION,
trusted: DENY_ACTION,
privileged: ALLOW_ACTION,
certified: ALLOW_ACTION
}
};
/**

View File

@ -92,7 +92,6 @@
#include "nsIAuthPrompt2.h"
#include "nsIScriptSecurityManager.h"
#include "nsIPermissionManager.h"
#include "nsIPrincipal.h"
#include "nsIDOMWindow.h"
@ -5832,31 +5831,9 @@ nsDocument::CustomElementConstructor(JSContext* aCx, unsigned aArgc, JS::Value*
bool
nsDocument::IsWebComponentsEnabled(JSContext* aCx, JSObject* aObject)
{
if (Preferences::GetBool("dom.webcomponents.enabled")) {
return true;
}
// Check for the webcomponents permission. See Bug 1181555.
JSAutoCompartment ac(aCx, aObject);
JS::Rooted<JSObject*> global(aCx, JS_GetGlobalForObject(aCx, aObject));
nsCOMPtr<nsPIDOMWindow> window =
do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(global));
if (window) {
nsresult rv;
nsCOMPtr<nsIPermissionManager> permMgr =
do_GetService(NS_PERMISSIONMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, false);
uint32_t perm;
rv = permMgr->TestPermissionFromWindow(
window, "moz-extremely-unstable-and-will-change-webcomponents", &perm);
NS_ENSURE_SUCCESS(rv, false);
return perm == nsIPermissionManager::ALLOW_ACTION;
}
return false;
JS::Rooted<JSObject*> obj(aCx, aObject);
return Preferences::GetBool("dom.webcomponents.enabled") ||
IsInCertifiedApp(aCx, obj);
}
nsresult