Bug 834699 - Stop checking dom.xbl_scopes. r=bz

This commit is contained in:
Bobby Holley 2013-05-02 16:02:03 -07:00
parent 8e703465df
commit 4d84f3f37c
8 changed files with 7 additions and 27 deletions

View File

@ -1143,7 +1143,7 @@ public:
* Control if GetUserData and SetUserData methods will be exposed to
* unprivileged content.
*/
static bool ShouldExposeUserData(JSContext* aCx, JSObject* /* unused */);
static bool IsChromeOrXBL(JSContext* aCx, JSObject* /* unused */);
void LookupPrefix(const nsAString& aNamespace, nsAString& aResult);
bool IsDefaultNamespace(const nsAString& aNamespaceURI)

View File

@ -95,7 +95,6 @@
#include "nsXBLInsertionPoint.h"
#include "nsXBLPrototypeBinding.h"
#include "prprf.h"
#include "xpcprivate.h" // XBLScopesEnabled
#include "xpcpublic.h"
#include "nsCSSRuleProcessor.h"
#include "nsCSSParser.h"
@ -722,12 +721,11 @@ nsINode::GetUserData(JSContext* aCx, const nsAString& aKey, ErrorResult& aError)
//static
bool
nsINode::ShouldExposeUserData(JSContext* aCx, JSObject* /* unused */)
nsINode::IsChromeOrXBL(JSContext* aCx, JSObject* /* unused */)
{
JSCompartment* compartment = js::GetContextCompartment(aCx);
return xpc::AccessCheck::isChrome(compartment) ||
xpc::IsXBLScope(compartment) ||
!XPCJSRuntime::Get()->XBLScopesEnabled();
xpc::IsXBLScope(compartment);
}
uint16_t

View File

@ -2090,9 +2090,7 @@ CreateNativeGlobalForInner(JSContext* aCx,
nsIXPConnect* xpc = nsContentUtils::XPConnect();
// Determine if we need the Components object.
bool componentsInContent =
!Preferences::GetBool("dom.omit_components_in_content", true) ||
!Preferences::GetBool("dom.xbl_scopes", true);
bool componentsInContent = !Preferences::GetBool("dom.omit_components_in_content", true);
bool needComponents = componentsInContent ||
nsContentUtils::IsSystemPrincipal(aPrincipal) ||
TreatAsRemoteXUL(aPrincipal);

View File

@ -96,9 +96,9 @@ interface Node : EventTarget {
readonly attribute DOMString? localName;
boolean hasAttributes();
[Throws, Func="nsINode::ShouldExposeUserData"]
[Throws, Func="nsINode::IsChromeOrXBL"]
any setUserData(DOMString key, any data, UserDataHandler? handler);
[Throws, Func="nsINode::ShouldExposeUserData"]
[Throws, Func="nsINode::IsChromeOrXBL"]
any getUserData(DOMString key);
[ChromeOnly]
readonly attribute Principal nodePrincipal;

View File

@ -2496,8 +2496,6 @@ CompartmentNameCallback(JSRuntime *rt, JSCompartment *comp,
memcpy(buf, name.get(), name.Length() + 1);
}
bool XPCJSRuntime::gXBLScopesEnabled;
static bool
PreserveWrapper(JSContext *cx, JSObject *objArg)
{
@ -2668,10 +2666,6 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
#endif
DOM_InitInterfaces();
Preferences::AddBoolVarCache(&gXBLScopesEnabled,
"dom.xbl_scopes",
false);
// these jsids filled in later when we have a JSContext to work with.
mStrIDs[0] = JSID_VOID;

View File

@ -160,8 +160,7 @@ XPCWrappedNativeScope::XPCWrappedNativeScope(JSContext *cx,
// In addition to being pref-controlled, we also disable XBL scopes for
// remote XUL domains, _except_ if we have an additional pref override set.
nsIPrincipal *principal = GetPrincipal();
mAllowXBLScope = XPCJSRuntime::Get()->XBLScopesEnabled() &&
!RemoteXULForbidsXBLScope(principal);
mAllowXBLScope = !RemoteXULForbidsXBLScope(principal);
// Determine whether to use an XBL scope.
mUseXBLScope = mAllowXBLScope;

View File

@ -889,10 +889,6 @@ public:
static void CTypesActivityCallback(JSContext *cx,
js::CTypesActivityType type);
bool XBLScopesEnabled() {
return gXBLScopesEnabled;
}
size_t SizeOfIncludingThis(nsMallocSizeOfFun mallocSizeOf);
AutoMarkingPtr** GetAutoRootsAdr() {return &mAutoRoots;}
@ -910,8 +906,6 @@ private:
void ReleaseIncrementally(nsTArray<nsISupports *> &array);
static bool gXBLScopesEnabled;
static const char* mStrings[IDX_TOTAL_COUNT];
jsid mStrIDs[IDX_TOTAL_COUNT];
jsval mStrJSVals[IDX_TOTAL_COUNT];

View File

@ -736,9 +736,6 @@ pref("dom.min_timeout_value", 4);
// And for background windows
pref("dom.min_background_timeout_value", 1000);
// Run content XBL in a separate scope.
pref("dom.xbl_scopes", true);
// Stop defining the Components object in content.
pref("dom.omit_components_in_content", true);