mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 1356826
: Part 4 - Add Cu.isInAutomation and Cu.crashIfNotInAutomation helpers. r=bholley
MozReview-Commit-ID: ADqVqF2XraG --HG-- extra : rebase_source : 5b4ff1ceb7f3123f585559a954e59291c91e5554 extra : source : c46fed6e4f6a928df2b06fca6b3f004fd4bb0cc7
This commit is contained in:
parent
f273a3c370
commit
a4e4191399
@ -529,6 +529,12 @@ interface nsIXPCComponents_Utils : nsISupports
|
||||
[implicit_jscontext]
|
||||
attribute boolean ion;
|
||||
|
||||
// Returns true if we're running in automation and certain security
|
||||
// restrictions can be eased.
|
||||
readonly attribute boolean isInAutomation;
|
||||
|
||||
void crashIfNotInAutomation();
|
||||
|
||||
[implicit_jscontext]
|
||||
void setGCZeal(in long zeal);
|
||||
|
||||
|
@ -2916,7 +2916,7 @@ nsXPCComponents_Utils::SetWantXrays(HandleValue vscope, JSContext* cx)
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Utils::ForcePermissiveCOWs(JSContext* cx)
|
||||
{
|
||||
CrashIfNotInAutomation();
|
||||
xpc::CrashIfNotInAutomation();
|
||||
CompartmentPrivate::Get(CurrentGlobalOrNull(cx))->forcePermissiveCOWs = true;
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2927,7 +2927,7 @@ nsXPCComponents_Utils::ForcePrivilegedComponentsForScope(HandleValue vscope,
|
||||
{
|
||||
if (!vscope.isObject())
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
CrashIfNotInAutomation();
|
||||
xpc::CrashIfNotInAutomation();
|
||||
JSObject* scopeObj = js::UncheckedUnwrap(&vscope.toObject());
|
||||
XPCWrappedNativeScope* scope = ObjectScope(scopeObj);
|
||||
scope->ForcePrivilegedComponents();
|
||||
@ -3012,6 +3012,22 @@ nsXPCComponents_Utils::SetGCZeal(int32_t aValue, JSContext* cx)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Utils::GetIsInAutomation(bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
|
||||
*aResult = xpc::IsInAutomation();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Utils::CrashIfNotInAutomation()
|
||||
{
|
||||
xpc::CrashIfNotInAutomation();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Utils::NukeSandbox(HandleValue obj, JSContext* cx)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user