Bug 1292892 part 4 - Pass RootingContext to ModuleEntry. r=bz

This commit is contained in:
Jan de Mooij 2016-08-11 14:39:22 +02:00
parent da9820d563
commit 4ec9b6fc7e
2 changed files with 4 additions and 4 deletions

View File

@ -373,7 +373,7 @@ mozJSComponentLoader::LoadModule(FileLocation& aFile)
jsapi.Init();
JSContext* cx = jsapi.cx();
nsAutoPtr<ModuleEntry> entry(new ModuleEntry(cx));
nsAutoPtr<ModuleEntry> entry(new ModuleEntry(RootingContext::get(cx)));
RootedValue dummy(cx);
rv = ObjectForLocation(info, file, &entry->obj, &entry->thisObjectKey,
&entry->location, false, &dummy);
@ -1164,7 +1164,7 @@ mozJSComponentLoader::ImportInto(const nsACString& aLocation,
ModuleEntry* mod;
nsAutoPtr<ModuleEntry> newEntry;
if (!mImports.Get(info.Key(), &mod) && !mInProgressImports.Get(info.Key(), &mod)) {
newEntry = new ModuleEntry(callercx);
newEntry = new ModuleEntry(RootingContext::get(callercx));
if (!newEntry)
return NS_ERROR_OUT_OF_MEMORY;
mInProgressImports.Put(info.Key(), newEntry);

View File

@ -88,8 +88,8 @@ class mozJSComponentLoader : public mozilla::ModuleLoader,
class ModuleEntry : public mozilla::Module
{
public:
explicit ModuleEntry(JSContext* aCx)
: mozilla::Module(), obj(aCx), thisObjectKey(aCx)
explicit ModuleEntry(JS::RootingContext* aRootingCx)
: mozilla::Module(), obj(aRootingCx), thisObjectKey(aRootingCx)
{
mVersion = mozilla::Module::kVersion;
mCIDs = nullptr;