From 1ecd8dc0b9bd3804bd41588cddd41fed3e670e11 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Sat, 22 Aug 2015 21:53:48 +0200 Subject: [PATCH] Backed out changeset e9d838084096 (bug 1181555) for Linux x64 opt and B2G Desktop Linux x64 opt Hazard analysis fail. r=backout --- dom/apps/PermissionsTable.jsm | 6 ------ dom/base/nsDocument.cpp | 29 +++-------------------------- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/dom/apps/PermissionsTable.jsm b/dom/apps/PermissionsTable.jsm index ed4abd20f822..ca7b4a2694f0 100644 --- a/dom/apps/PermissionsTable.jsm +++ b/dom/apps/PermissionsTable.jsm @@ -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 - } }; /** diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index c85d9cc8d528..60c7ba424f9e 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -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 global(aCx, JS_GetGlobalForObject(aCx, aObject)); - nsCOMPtr window = - do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(global)); - - if (window) { - nsresult rv; - nsCOMPtr 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 obj(aCx, aObject); + return Preferences::GetBool("dom.webcomponents.enabled") || + IsInCertifiedApp(aCx, obj); } nsresult