mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 937157, part 6 - Remove XPC_CHECK_WRAPPERS_AT_SHUTDOWN. r=bholley
This commit is contained in:
parent
218a6e5880
commit
9b7d840d3d
@ -1474,18 +1474,6 @@ XPCJSRuntime::DeleteString(nsAString *string)
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#ifdef XPC_CHECK_WRAPPERS_AT_SHUTDOWN
|
||||
static PLDHashOperator
|
||||
DEBUG_WrapperChecker(PLDHashTable *table, PLDHashEntryHdr *hdr,
|
||||
uint32_t number, void *arg)
|
||||
{
|
||||
XPCWrappedNative* wrapper = (XPCWrappedNative*)((PLDHashEntryStub*)hdr)->key;
|
||||
MOZ_ASSERT(!wrapper->IsValid(), "found a 'valid' wrapper!");
|
||||
++ *((int*)arg);
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
#endif
|
||||
|
||||
static PLDHashOperator
|
||||
DetachedWrappedNativeProtoShutdownMarker(PLDHashTable *table, PLDHashEntryHdr *hdr,
|
||||
uint32_t number, void *arg)
|
||||
@ -1609,17 +1597,6 @@ XPCJSRuntime::~XPCJSRuntime()
|
||||
delete mThisTranslatorMap;
|
||||
}
|
||||
|
||||
#ifdef XPC_CHECK_WRAPPERS_AT_SHUTDOWN
|
||||
if (DEBUG_WrappedNativeHashtable) {
|
||||
int LiveWrapperCount = 0;
|
||||
PL_DHashTableEnumerate(DEBUG_WrappedNativeHashtable,
|
||||
DEBUG_WrapperChecker, &LiveWrapperCount);
|
||||
if (LiveWrapperCount)
|
||||
printf("deleting XPCJSRuntime with %d live XPCWrappedNative (found in wrapper check)\n", (int)LiveWrapperCount);
|
||||
PL_DHashTableDestroy(DEBUG_WrappedNativeHashtable);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mNativeScriptableSharedMap) {
|
||||
#ifdef XPC_DUMP_AT_SHUTDOWN
|
||||
uint32_t count = mNativeScriptableSharedMap->Count();
|
||||
@ -3010,12 +2987,6 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
|
||||
mJunkScope(nullptr),
|
||||
mAsyncSnowWhiteFreer(new AsyncFreeSnowWhite())
|
||||
{
|
||||
#ifdef XPC_CHECK_WRAPPERS_AT_SHUTDOWN
|
||||
DEBUG_WrappedNativeHashtable =
|
||||
PL_NewDHashTable(PL_DHashGetStubOps(), nullptr,
|
||||
sizeof(PLDHashEntryStub), 128);
|
||||
#endif
|
||||
|
||||
DOM_InitInterfaces();
|
||||
|
||||
// these jsids filled in later when we have a JSContext to work with.
|
||||
|
@ -145,12 +145,6 @@ static bool DEBUG_DumpedWrapperStats;
|
||||
#ifdef DEBUG
|
||||
static void DEBUG_TrackNewWrapper(XPCWrappedNative* wrapper)
|
||||
{
|
||||
#ifdef XPC_CHECK_WRAPPERS_AT_SHUTDOWN
|
||||
if (wrapper->GetRuntime())
|
||||
wrapper->GetRuntime()->DEBUG_AddWrappedNative(wrapper);
|
||||
else
|
||||
NS_ERROR("failed to add wrapper");
|
||||
#endif
|
||||
#ifdef XPC_TRACK_WRAPPER_STATS
|
||||
DEBUG_TotalWrappedNativeCount++;
|
||||
DEBUG_TotalLiveWrappedNativeCount++;
|
||||
@ -173,9 +167,6 @@ static void DEBUG_TrackNewWrapper(XPCWrappedNative* wrapper)
|
||||
|
||||
static void DEBUG_TrackDeleteWrapper(XPCWrappedNative* wrapper)
|
||||
{
|
||||
#ifdef XPC_CHECK_WRAPPERS_AT_SHUTDOWN
|
||||
nsXPConnect::GetRuntimeInstance()->DEBUG_RemoveWrappedNative(wrapper);
|
||||
#endif
|
||||
#ifdef XPC_TRACK_WRAPPER_STATS
|
||||
DEBUG_TotalLiveWrappedNativeCount--;
|
||||
if (wrapper->HasProto())
|
||||
|
@ -183,7 +183,6 @@
|
||||
#define XPC_TRACK_WRAPPER_STATS
|
||||
#define XPC_TRACK_SCOPE_STATS
|
||||
#define XPC_TRACK_PROTO_STATS
|
||||
#define XPC_CHECK_WRAPPERS_AT_SHUTDOWN
|
||||
#endif
|
||||
|
||||
/***************************************************************************/
|
||||
@ -717,23 +716,6 @@ public:
|
||||
XPCReadableJSStringWrapper *NewStringWrapper(const PRUnichar *str, uint32_t len);
|
||||
void DeleteString(nsAString *string);
|
||||
|
||||
#ifdef XPC_CHECK_WRAPPERS_AT_SHUTDOWN
|
||||
void DEBUG_AddWrappedNative(nsIXPConnectWrappedNative* wrapper)
|
||||
{XPCAutoLock lock(GetMapLock());
|
||||
PLDHashEntryHdr *entry =
|
||||
PL_DHashTableOperate(DEBUG_WrappedNativeHashtable,
|
||||
wrapper, PL_DHASH_ADD);
|
||||
if (entry) ((PLDHashEntryStub *)entry)->key = wrapper;}
|
||||
|
||||
void DEBUG_RemoveWrappedNative(nsIXPConnectWrappedNative* wrapper)
|
||||
{XPCAutoLock lock(GetMapLock());
|
||||
PL_DHashTableOperate(DEBUG_WrappedNativeHashtable,
|
||||
wrapper, PL_DHASH_REMOVE);}
|
||||
private:
|
||||
PLDHashTable* DEBUG_WrappedNativeHashtable;
|
||||
public:
|
||||
#endif
|
||||
|
||||
void AddGCCallback(xpcGCCallback cb);
|
||||
void RemoveGCCallback(xpcGCCallback cb);
|
||||
void AddContextCallback(xpcContextCallback cb);
|
||||
|
Loading…
Reference in New Issue
Block a user