mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 14:17:30 +09:00
[network] Use a proof of lock everywhere in cache v2.
This commit is contained in:
parent
1d1618ff0c
commit
9aed4d8a38
6 changed files with 355 additions and 344 deletions
|
|
@ -9,12 +9,13 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/SHA1.h"
|
||||
#include "mozilla/StaticMutex.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
class CacheIndex;
|
||||
struct CacheIndexRecord;
|
||||
class CacheIndexRecordWrapper;
|
||||
|
||||
class CacheIndexIterator
|
||||
{
|
||||
|
|
@ -42,14 +43,18 @@ protected:
|
|||
nsresult CloseInternal(nsresult aStatus);
|
||||
|
||||
bool ShouldBeNewAdded() { return mAddNew; }
|
||||
virtual void AddRecord(CacheIndexRecord *aRecord);
|
||||
bool RemoveRecord(CacheIndexRecord *aRecord);
|
||||
bool ReplaceRecord(CacheIndexRecord *aOldRecord,
|
||||
CacheIndexRecord *aNewRecord);
|
||||
virtual void AddRecord(CacheIndexRecordWrapper* aRecord,
|
||||
const StaticMutexAutoLock& aProofOfLock);
|
||||
bool RemoveRecord(CacheIndexRecordWrapper* aRecord,
|
||||
const StaticMutexAutoLock& aProofOfLock);
|
||||
bool ReplaceRecord(CacheIndexRecordWrapper* aOldRecord,
|
||||
CacheIndexRecordWrapper* aNewRecord,
|
||||
const StaticMutexAutoLock& aProofOfLock);
|
||||
void ClearRecords(const StaticMutexAutoLock& aProofOfLock);
|
||||
|
||||
nsresult mStatus;
|
||||
RefPtr<CacheIndex> mIndex;
|
||||
nsTArray<CacheIndexRecord *> mRecords;
|
||||
nsTArray<RefPtr<CacheIndexRecordWrapper>> mRecords;
|
||||
bool mAddNew;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue