Revert "[network] Improve thread-safety of cache entry handling."

This reverts commit 9299c2e2ea.
This commit is contained in:
roytam1 2022-03-28 22:56:14 +08:00
commit 1d6c0f2e87
8 changed files with 105 additions and 141 deletions

View file

@ -112,10 +112,9 @@ public:
nsresult OnFetched();
bool DataSize(int64_t* aSize);
void Key(nsACString& aKey);
void Key(nsACString& aKey) { aKey = mKey; }
bool IsDoomed();
bool IsPinned();
// Returns true when there is a potentially unfinished write operation.
bool IsPinned() const { return mPinned; }
bool IsWriteInProgress();
// Memory reporting
@ -132,16 +131,10 @@ private:
virtual ~CacheFile();
void Lock() { mLock.Lock(); }
void Unlock() {
// move the elements out of mObjsToRelease
// so that they can be released after we unlock
nsTArray<RefPtr<nsISupports>> objs = std::move(mObjsToRelease);
mLock.Unlock();
}
void AssertOwnsLock() const { mLock.AssertCurrentThreadOwns(); }
void ReleaseOutsideLock(RefPtr<nsISupports> aObject);
void Lock();
void Unlock();
void AssertOwnsLock() const;
void ReleaseOutsideLock(RefPtr<nsISupports> aObject);
enum ECallerType {
READER = 0,