Bug 673470 - Simplify PrefixSet by removing (unneeded) thread safety. r=dcamp

This commit is contained in:
Gian-Carlo Pascutto
2012-08-15 09:10:24 +02:00
parent 4b70e3b4c2
commit 36e135e1d7
6 changed files with 48 additions and 133 deletions

View File

@@ -29,7 +29,7 @@ public:
NS_IMETHOD Init(const nsACString& aName);
NS_IMETHOD SetPrefixes(const PRUint32* aArray, PRUint32 aLength);
NS_IMETHOD GetPrefixes(PRUint32* aCount, PRUint32** aPrefixes);
NS_IMETHOD Probe(PRUint32 aPrefix, bool* aReady, bool* aFound);
NS_IMETHOD Contains(PRUint32 aPrefix, bool* aFound);
NS_IMETHOD IsEmpty(bool* aEmpty);
NS_IMETHOD LoadFromFile(nsIFile* aFile);
NS_IMETHOD StoreToFile(nsIFile* aFile);
@@ -45,11 +45,8 @@ protected:
static const PRUint32 MAX_INDEX_DIFF = (1 << 16);
static const PRUint32 PREFIXSET_VERSION_MAGIC = 1;
mozilla::Mutex mPrefixSetLock;
mozilla::CondVar mSetIsReady;
nsRefPtr<nsPrefixSetReporter> mReporter;
nsresult Contains(PRUint32 aPrefix, bool* aFound);
nsresult MakePrefixSet(const PRUint32* aArray, PRUint32 aLength);
PRUint32 BinSearch(PRUint32 start, PRUint32 end, PRUint32 target);
nsresult LoadFromFd(mozilla::AutoFDClose& fileFd);