diff --git a/js/xpconnect/src/XPCForwards.h b/js/xpconnect/src/XPCForwards.h index 08a1c5401ac7..64096a3d6375 100644 --- a/js/xpconnect/src/XPCForwards.h +++ b/js/xpconnect/src/XPCForwards.h @@ -81,7 +81,6 @@ class NativeSetMap; class IID2ThisTranslatorMap; class XPCNativeScriptableSharedMap; class XPCWrappedNativeProtoMap; -class XPCNativeWrapperMap; class WrappedNative2WrapperMap; class JSObject2JSObjectMap; diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index cbfa495cc739..4db7dbc7da11 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -1202,15 +1202,6 @@ XPCJSRuntime::~XPCJSRuntime() delete mDetachedWrappedNativeProtoMap; } - if (mExplicitNativeWrapperMap) { -#ifdef XPC_DUMP_AT_SHUTDOWN - uint32_t count = mExplicitNativeWrapperMap->Count(); - if (count) - printf("deleting XPCJSRuntime with %d live explicit XPCNativeWrapper\n", (int)count); -#endif - delete mExplicitNativeWrapperMap; - } - if (mJSHolders.ops) { JS_DHashTableFinish(&mJSHolders); mJSHolders.ops = nsnull; @@ -1961,7 +1952,6 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect) mNativeScriptableSharedMap(XPCNativeScriptableSharedMap::newMap(XPC_NATIVE_JSCLASS_MAP_SIZE)), mDyingWrappedNativeProtoMap(XPCWrappedNativeProtoMap::newMap(XPC_DYING_NATIVE_PROTO_MAP_SIZE)), mDetachedWrappedNativeProtoMap(XPCWrappedNativeProtoMap::newMap(XPC_DETACHED_NATIVE_PROTO_MAP_SIZE)), - mExplicitNativeWrapperMap(XPCNativeWrapperMap::newMap(XPC_NATIVE_WRAPPER_MAP_SIZE)), mMapLock(XPCAutoLock::NewLock("XPCJSRuntime::mMapLock")), mThreadRunningGC(nsnull), mWrappedJSToReleaseArray(), @@ -2080,7 +2070,6 @@ XPCJSRuntime::newXPCJSRuntime(nsXPConnect* aXPConnect) self->GetThisTranslatorMap() && self->GetNativeScriptableSharedMap() && self->GetDyingWrappedNativeProtoMap() && - self->GetExplicitNativeWrapperMap() && self->GetMapLock() && self->mWatchdogThread) { return self; diff --git a/js/xpconnect/src/XPCMaps.cpp b/js/xpconnect/src/XPCMaps.cpp index 6250604923a4..44969027dfe0 100644 --- a/js/xpconnect/src/XPCMaps.cpp +++ b/js/xpconnect/src/XPCMaps.cpp @@ -674,32 +674,6 @@ XPCWrappedNativeProtoMap::~XPCWrappedNativeProtoMap() JS_DHashTableDestroy(mTable); } -/***************************************************************************/ -// implement XPCNativeWrapperMap... - -// static -XPCNativeWrapperMap* -XPCNativeWrapperMap::newMap(int size) -{ - XPCNativeWrapperMap* map = new XPCNativeWrapperMap(size); - if (map && map->mTable) - return map; - delete map; - return nsnull; -} - -XPCNativeWrapperMap::XPCNativeWrapperMap(int size) -{ - mTable = JS_NewDHashTable(JS_DHashGetStubOps(), nsnull, - sizeof(JSDHashEntryStub), size); -} - -XPCNativeWrapperMap::~XPCNativeWrapperMap() -{ - if (mTable) - JS_DHashTableDestroy(mTable); -} - /***************************************************************************/ // implement WrappedNative2WrapperMap... diff --git a/js/xpconnect/src/XPCMaps.h b/js/xpconnect/src/XPCMaps.h index 446c817a0ad0..5c75a0727ae5 100644 --- a/js/xpconnect/src/XPCMaps.h +++ b/js/xpconnect/src/XPCMaps.h @@ -635,42 +635,6 @@ private: JSDHashTable *mTable; }; -class XPCNativeWrapperMap -{ -public: - static XPCNativeWrapperMap* newMap(int size); - - inline JSObject* Add(JSObject* nw) - { - NS_PRECONDITION(nw,"bad param"); - JSDHashEntryStub* entry = (JSDHashEntryStub*) - JS_DHashTableOperate(mTable, nw, JS_DHASH_ADD); - if (!entry) - return nsnull; - if (entry->key) - return (JSObject*) entry->key; - entry->key = nw; - return nw; - } - - inline void Remove(JSObject* nw) - { - NS_PRECONDITION(nw,"bad param"); - JS_DHashTableOperate(mTable, nw, JS_DHASH_REMOVE); - } - - inline uint32_t Count() {return mTable->entryCount;} - inline uint32_t Enumerate(JSDHashEnumerator f, void *arg) - {return JS_DHashTableEnumerate(mTable, f, arg);} - - ~XPCNativeWrapperMap(); -private: - XPCNativeWrapperMap(); // no implementation - XPCNativeWrapperMap(int size); -private: - JSDHashTable *mTable; -}; - class WrappedNative2WrapperMap { static struct JSDHashTableOps sOps; diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index fb524bdd96a1..5af27ecd9249 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -684,9 +684,6 @@ public: XPCWrappedNativeProtoMap* GetDetachedWrappedNativeProtoMap() const {return mDetachedWrappedNativeProtoMap;} - XPCNativeWrapperMap* GetExplicitNativeWrapperMap() const - {return mExplicitNativeWrapperMap;} - XPCCompartmentMap& GetCompartmentMap() {return mCompartmentMap;} @@ -832,7 +829,6 @@ private: XPCNativeScriptableSharedMap* mNativeScriptableSharedMap; XPCWrappedNativeProtoMap* mDyingWrappedNativeProtoMap; XPCWrappedNativeProtoMap* mDetachedWrappedNativeProtoMap; - XPCNativeWrapperMap* mExplicitNativeWrapperMap; XPCCompartmentMap mCompartmentMap; XPCLock* mMapLock; PRThread* mThreadRunningGC;