Bug 700659 - Slay nsHashSets in netwerk. r=jduell
This commit is contained in:
8
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
8
netwerk/cache/nsDiskCacheDeviceSQL.cpp
vendored
@@ -1218,7 +1218,7 @@ nsOfflineCacheDevice::InitActiveCaches()
|
|||||||
nsCString clientID;
|
nsCString clientID;
|
||||||
statement->GetUTF8String(1, clientID);
|
statement->GetUTF8String(1, clientID);
|
||||||
|
|
||||||
mActiveCaches.Put(clientID);
|
mActiveCaches.PutEntry(clientID);
|
||||||
mActiveCachesByGroup.Put(group, new nsCString(clientID));
|
mActiveCachesByGroup.Put(group, new nsCString(clientID));
|
||||||
|
|
||||||
rv = statement->ExecuteStep(&hasRows);
|
rv = statement->ExecuteStep(&hasRows);
|
||||||
@@ -2182,7 +2182,7 @@ nsOfflineCacheDevice::DeactivateGroup(const nsACString &group)
|
|||||||
|
|
||||||
if (mActiveCachesByGroup.Get(group, &active))
|
if (mActiveCachesByGroup.Get(group, &active))
|
||||||
{
|
{
|
||||||
mActiveCaches.Remove(*active);
|
mActiveCaches.RemoveEntry(*active);
|
||||||
mActiveCachesByGroup.Remove(group);
|
mActiveCachesByGroup.Remove(group);
|
||||||
active = nsnull;
|
active = nsnull;
|
||||||
}
|
}
|
||||||
@@ -2323,14 +2323,14 @@ nsOfflineCacheDevice::ActivateCache(const nsCSubstring &group,
|
|||||||
nsCString *active;
|
nsCString *active;
|
||||||
if (mActiveCachesByGroup.Get(group, &active))
|
if (mActiveCachesByGroup.Get(group, &active))
|
||||||
{
|
{
|
||||||
mActiveCaches.Remove(*active);
|
mActiveCaches.RemoveEntry(*active);
|
||||||
mActiveCachesByGroup.Remove(group);
|
mActiveCachesByGroup.Remove(group);
|
||||||
active = nsnull;
|
active = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!clientID.IsEmpty())
|
if (!clientID.IsEmpty())
|
||||||
{
|
{
|
||||||
mActiveCaches.Put(clientID);
|
mActiveCaches.PutEntry(clientID);
|
||||||
mActiveCachesByGroup.Put(group, new nsCString(clientID));
|
mActiveCachesByGroup.Put(group, new nsCString(clientID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
netwerk/cache/nsDiskCacheDeviceSQL.h
vendored
3
netwerk/cache/nsDiskCacheDeviceSQL.h
vendored
@@ -51,7 +51,6 @@
|
|||||||
#include "nsCOMArray.h"
|
#include "nsCOMArray.h"
|
||||||
#include "nsInterfaceHashtable.h"
|
#include "nsInterfaceHashtable.h"
|
||||||
#include "nsClassHashtable.h"
|
#include "nsClassHashtable.h"
|
||||||
#include "nsHashSets.h"
|
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
|
|
||||||
class nsIURI;
|
class nsIURI;
|
||||||
@@ -271,7 +270,7 @@ private:
|
|||||||
|
|
||||||
nsInterfaceHashtable<nsCStringHashKey, nsIWeakReference> mCaches;
|
nsInterfaceHashtable<nsCStringHashKey, nsIWeakReference> mCaches;
|
||||||
nsClassHashtable<nsCStringHashKey, nsCString> mActiveCachesByGroup;
|
nsClassHashtable<nsCStringHashKey, nsCString> mActiveCachesByGroup;
|
||||||
nsCStringHashSet mActiveCaches;
|
nsTHashtable<nsCStringHashKey> mActiveCaches;
|
||||||
|
|
||||||
nsCOMPtr<nsIThread> mInitThread;
|
nsCOMPtr<nsIThread> mInitThread;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user