Bug 1189822 part 2. Remove the DOM proxy expando object hashtable in xpconnect. r=peterv

This commit is contained in:
Boris Zbarsky 2017-05-17 00:52:53 -04:00
Родитель 17e91105ca
Коммит cba820b01b
2 изменённых файлов: 0 добавлений и 42 удалений

Просмотреть файл

@ -495,22 +495,9 @@ XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc)
if (wrapper->HasExternalReference() && !wrapper->IsWrapperExpired())
wrapper->TraceSelf(trc);
}
if (cur->mDOMExpandoSet) {
for (DOMExpandoSet::Enum e(*cur->mDOMExpandoSet); !e.empty(); e.popFront())
JS::TraceEdge(trc, &e.mutableFront(), "DOM expando object");
}
}
}
static void
SuspectDOMExpandos(JSObject* obj, nsCycleCollectionNoteRootCallback& cb)
{
MOZ_ASSERT(dom::GetDOMClass(obj) && dom::GetDOMClass(obj)->mDOMObjectIsISupports);
nsISupports* native = dom::UnwrapDOMObject<nsISupports>(obj);
cb.NoteXPCOMRoot(native);
}
// static
void
XPCWrappedNativeScope::SuspectAllWrappers(nsCycleCollectionNoteRootCallback& cb)
@ -519,11 +506,6 @@ XPCWrappedNativeScope::SuspectAllWrappers(nsCycleCollectionNoteRootCallback& cb)
for (auto i = cur->mWrappedNativeMap->Iter(); !i.Done(); i.Next()) {
static_cast<Native2WrappedNativeMap::Entry*>(i.Get())->value->Suspect(cb);
}
if (cur->mDOMExpandoSet) {
for (DOMExpandoSet::Range r = cur->mDOMExpandoSet->all(); !r.empty(); r.popFront())
SuspectDOMExpandos(r.front().unbarrieredGet(), cb);
}
}
}

Просмотреть файл

@ -995,28 +995,6 @@ public:
static bool
IsDyingScope(XPCWrappedNativeScope* scope);
typedef js::HashSet<JS::Heap<JSObject*>,
js::MovableCellHasher<JS::Heap<JSObject*>>,
js::SystemAllocPolicy> DOMExpandoSet;
bool RegisterDOMExpandoObject(JSObject* expando) {
// Expandos are proxy objects, and proxies are always tenured.
JS::AssertGCThingMustBeTenured(expando);
if (!mDOMExpandoSet) {
mDOMExpandoSet = new DOMExpandoSet();
if (!mDOMExpandoSet->init(8))
return false;
}
return mDOMExpandoSet->put(JS::Heap<JSObject*>(expando));
}
void RemoveDOMExpandoObject(JSObject* expando) {
if (mDOMExpandoSet) {
DOMExpandoSet::Ptr p = mDOMExpandoSet->lookup(JS::Heap<JSObject*>(expando));
MOZ_ASSERT(p.found());
mDOMExpandoSet->remove(p);
}
}
typedef js::HashMap<JSAddonId*,
nsCOMPtr<nsIAddonInterposition>,
js::PointerHasher<JSAddonId*, 3>,
@ -1109,8 +1087,6 @@ private:
// from this scope if the caller scope has mInterposition set.
bool mHasCallInterpositions;
nsAutoPtr<DOMExpandoSet> mDOMExpandoSet;
JS::WeakMapPtr<JSObject*, JSObject*> mXrayExpandos;
bool mIsContentXBLScope;