Bug 1078837 part 1 - Move CustomElf::mappable to BaseElf. r=nfroyd

This commit is contained in:
Mike Hommey 2014-10-16 09:19:45 +09:00
parent eb89afceec
commit c39fcc8944
2 changed files with 9 additions and 7 deletions

View File

@ -33,8 +33,11 @@ public:
*/
const Elf::Sym *GetSymbol(const char *symbol, unsigned long hash) const;
BaseElf(const char *path)
: LibHandle(path) { }
BaseElf(const char *path, Mappable *mappable = nullptr)
: LibHandle(path)
, mappable(mappable)
{
}
protected:
/**
@ -75,6 +78,9 @@ public:
return reinterpret_cast<const T *>(base + offset);
}
/* Appropriated Mappable */
mozilla::RefPtr<Mappable> mappable;
/* Base address where the library is loaded */
MappedPtr base;

View File

@ -66,9 +66,8 @@ private:
* Private constructor
*/
CustomElf(Mappable *mappable, const char *path)
: BaseElf(path)
: BaseElf(path, mappable)
, link_map()
, mappable(mappable)
, init(0)
, fini(0)
, initialized(false)
@ -136,9 +135,6 @@ private:
return CallFunction(GetPtr(addr));
}
/* Appropriated Mappable */
mozilla::RefPtr<Mappable> mappable;
/* List of dependent libraries */
std::vector<mozilla::RefPtr<LibHandle> > dependencies;