mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1070696 - Implement a JSObject* override to AutoJSAPI::Init(). r=smaug
This commit is contained in:
parent
e3eca2660e
commit
be9e0c4e41
@ -302,6 +302,12 @@ AutoJSAPI::Init(nsIGlobalObject* aGlobalObject)
|
||||
return Init(aGlobalObject, nsContentUtils::GetDefaultJSContextForThread());
|
||||
}
|
||||
|
||||
bool
|
||||
AutoJSAPI::Init(JSObject* aObject)
|
||||
{
|
||||
return Init(xpc::NativeGlobal(aObject));
|
||||
}
|
||||
|
||||
bool
|
||||
AutoJSAPI::InitWithLegacyErrorReporting(nsIGlobalObject* aGlobalObject)
|
||||
{
|
||||
|
@ -214,6 +214,10 @@ public:
|
||||
// false and use of cx() will cause an assertion.
|
||||
bool Init(nsIGlobalObject* aGlobalObject);
|
||||
|
||||
// This is a helper that grabs the native global associated with aObject and
|
||||
// invokes the above Init() with that.
|
||||
bool Init(JSObject* aObject);
|
||||
|
||||
// Unsurprisingly, this uses aCx and enters the compartment of aGlobalObject.
|
||||
// If aGlobalObject or its associated JS global are null then it returns
|
||||
// false and use of cx() will cause an assertion.
|
||||
|
@ -1524,7 +1524,7 @@ SetAddonInterposition(const nsACString &addonIdStr, nsIAddonInterposition *inter
|
||||
// We enter the junk scope just to allocate a string, which actually will go
|
||||
// in the system zone.
|
||||
AutoJSAPI jsapi;
|
||||
jsapi.Init(xpc::NativeGlobal(xpc::PrivilegedJunkScope()));
|
||||
jsapi.Init(xpc::PrivilegedJunkScope());
|
||||
addonId = NewAddonId(jsapi.cx(), addonIdStr);
|
||||
if (!addonId)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user