static JSDHashOperator WrappedNativeJSGCThingTracer(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32_t number, void *arg) { XPCWrappedNative* wrapper = ((Native2WrappedNativeMap::Entry*)hdr)->value; if (wrapper->HasExternalReference() && !wrapper->IsWrapperExpired()) wrapper->TraceSelf((JSTracer *)arg); return JS_DHASH_NEXT; }
// static void XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntime* rt) { // Do JS_CallTracer for all wrapped natives with external references, as // well as any DOM expando objects. for (XPCWrappedNativeScope* cur = gScopes; cur; cur = cur->mNext) { for (auto i = cur->mWrappedNativeMap->Iter(); !i.Done(); i.Next()) { auto entry = static_cast<Native2WrappedNativeMap::Entry*>(i.Get()); XPCWrappedNative* wrapper = entry->value; if (wrapper->HasExternalReference() && !wrapper->IsWrapperExpired()) wrapper->TraceSelf(trc); } if (cur->mDOMExpandoSet) { for (DOMExpandoSet::Enum e(*cur->mDOMExpandoSet); !e.empty(); e.popFront()) JS_CallHashSetObjectTracer(trc, e, e.front(), "DOM expando object"); } } }