mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
Bug 894448 part 1. Move IsChromeOrXBL to xpcpublic.h. r=bholley
This commit is contained in:
parent
94845105be
commit
bd1400ee1f
@ -1122,12 +1122,6 @@ public:
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Control if GetUserData and SetUserData methods will be exposed to
|
||||
* unprivileged content.
|
||||
*/
|
||||
static bool IsChromeOrXBL(JSContext* aCx, JSObject* /* unused */);
|
||||
|
||||
void LookupPrefix(const nsAString& aNamespace, nsAString& aResult);
|
||||
bool IsDefaultNamespace(const nsAString& aNamespaceURI)
|
||||
{
|
||||
|
@ -735,15 +735,6 @@ nsINode::GetUserData(JSContext* aCx, const nsAString& aKey, ErrorResult& aError)
|
||||
return result;
|
||||
}
|
||||
|
||||
//static
|
||||
bool
|
||||
nsINode::IsChromeOrXBL(JSContext* aCx, JSObject* /* unused */)
|
||||
{
|
||||
JSCompartment* compartment = js::GetContextCompartment(aCx);
|
||||
return xpc::AccessCheck::isChrome(compartment) ||
|
||||
xpc::IsXBLScope(compartment);
|
||||
}
|
||||
|
||||
uint16_t
|
||||
nsINode::CompareDocumentPosition(nsINode& aOtherNode) const
|
||||
{
|
||||
|
@ -1470,8 +1470,7 @@ class MethodDefiner(PropertyDefiner):
|
||||
"length": 1,
|
||||
"flags": "0",
|
||||
"condition":
|
||||
MemberCondition(None,
|
||||
"nsINode::IsChromeOrXBL") })
|
||||
MemberCondition(None, "IsChromeOrXBL") })
|
||||
|
||||
if not static:
|
||||
stringifier = descriptor.operations['Stringifier']
|
||||
|
@ -96,9 +96,9 @@ interface Node : EventTarget {
|
||||
readonly attribute DOMString? localName;
|
||||
|
||||
boolean hasAttributes();
|
||||
[Throws, Func="nsINode::IsChromeOrXBL"]
|
||||
[Throws, Func="IsChromeOrXBL"]
|
||||
any setUserData(DOMString key, any data, UserDataHandler? handler);
|
||||
[Throws, Func="nsINode::IsChromeOrXBL"]
|
||||
[Throws, Func="IsChromeOrXBL"]
|
||||
any getUserData(DOMString key);
|
||||
[ChromeOnly]
|
||||
readonly attribute Principal nodePrincipal;
|
||||
|
@ -1707,3 +1707,18 @@ JS_EXPORT_API(void) DumpCompleteHeap()
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
bool
|
||||
IsChromeOrXBL(JSContext* cx, JSObject* /* unused */)
|
||||
{
|
||||
JSCompartment* compartment = js::GetContextCompartment(cx);
|
||||
return AccessCheck::isChrome(compartment) ||
|
||||
IsXBLScope(compartment);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -478,6 +478,12 @@ DefineStaticJSVals(JSContext *cx);
|
||||
void
|
||||
Register(nsScriptNameSpaceManager* aNameSpaceManager);
|
||||
|
||||
/**
|
||||
* A test for whether WebIDL methods that should only be visible to
|
||||
* chrome or XBL scopes should be exposed.
|
||||
*/
|
||||
bool IsChromeOrXBL(JSContext* cx, JSObject* /* unused */);
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user