mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 16:58:38 +09:00
Issue #2678 - Remove the DOM proxy expando object hashtable in xpconnect.
This commit is contained in:
parent
45bb4cb8b4
commit
32da3f4de4
2 changed files with 0 additions and 42 deletions
|
|
@ -496,22 +496,9 @@ XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSContex
|
|||
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(XPCJSContext* cx,
|
||||
|
|
@ -521,11 +508,6 @@ XPCWrappedNativeScope::SuspectAllWrappers(XPCJSContext* cx,
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -950,28 +950,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>,
|
||||
|
|
@ -1065,8 +1043,6 @@ private:
|
|||
// from this scope if the caller scope has mInterposition set.
|
||||
bool mHasCallInterpositions;
|
||||
|
||||
nsAutoPtr<DOMExpandoSet> mDOMExpandoSet;
|
||||
|
||||
JS::WeakMapPtr<JSObject*, JSObject*> mXrayExpandos;
|
||||
|
||||
bool mIsContentXBLScope;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue