Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Types | Private Attributes
nsDiskCacheRecord Class Reference

#include <nsDiskCacheMap.h>

Collaboration diagram for nsDiskCacheRecord:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsDiskCacheRecord ()
PRBool ValidRecord ()
PRUint32 HashNumber () const
void SetHashNumber (PRUint32 hashNumber)
PRUint32 EvictionRank () const
void SetEvictionRank (PRUint32 rank)
PRBool DataLocationInitialized () const
void ClearDataLocation ()
PRUint32 DataFile () const
void SetDataBlocks (PRUint32 index, PRUint32 startBlock, PRUint32 blockCount)
PRUint32 DataBlockCount () const
PRUint32 DataStartBlock () const
PRUint32 DataBlockSize () const
PRUint32 DataFileSize () const
void SetDataFileSize (PRUint32 size)
PRUint8 DataFileGeneration () const
void SetDataFileGeneration (PRUint8 generation)
PRBool MetaLocationInitialized () const
void ClearMetaLocation ()
PRUint32 MetaLocation () const
PRUint32 MetaFile () const
void SetMetaBlocks (PRUint32 index, PRUint32 startBlock, PRUint32 blockCount)
PRUint32 MetaBlockCount () const
PRUint32 MetaStartBlock () const
PRUint32 MetaBlockSize () const
PRUint32 MetaFileSize () const
void SetMetaFileSize (PRUint32 size)
PRUint8 MetaFileGeneration () const
void SetMetaFileGeneration (PRUint8 generation)
PRUint8 Generation () const

Public Attributes

const char * clientID
const char * key
const PRUint8metaData
PRUint32 metaDataLen
PRInt32 generation
PRInt32 flags
PRInt32 dataSize
PRInt32 fetchCount
PRInt64 lastFetched
PRInt64 lastModified
PRInt64 expirationTime

Private Types

enum  {
  eLocationInitializedMask = 0x80000000, eLocationSelectorMask = 0x30000000, eLocationSelectorOffset = 28, eExtraBlocksMask = 0x03000000,
  eExtraBlocksOffset = 24, eReservedMask = 0x4C000000, eBlockNumberMask = 0x00FFFFFF, eFileSizeMask = 0x00FFFF00,
  eFileSizeOffset = 8, eFileGenerationMask = 0x000000FF, eFileReservedMask = 0x4F000000
}

Private Attributes

PRUint32 mHashNumber
PRUint32 mEvictionRank
PRUint32 mDataLocation
PRUint32 mMetaLocation

Detailed Description

Definition at line 379 of file nsDiskCacheDeviceSQL.cpp.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
eLocationInitializedMask 
eLocationSelectorMask 
eLocationSelectorOffset 
eExtraBlocksMask 
eExtraBlocksOffset 
eReservedMask 
eBlockNumberMask 
eFileSizeMask 
eFileSizeOffset 
eFileGenerationMask 
eFileReservedMask 

Definition at line 105 of file nsDiskCacheMap.h.

         {
        eLocationInitializedMask = 0x80000000,
        
        eLocationSelectorMask    = 0x30000000,
        eLocationSelectorOffset  = 28,
        
        eExtraBlocksMask         = 0x03000000,
        eExtraBlocksOffset       = 24,
        
        eReservedMask            = 0x4C000000,
        
        eBlockNumberMask         = 0x00FFFFFF,

        eFileSizeMask            = 0x00FFFF00,
        eFileSizeOffset          = 8,
        eFileGenerationMask      = 0x000000FF,
        eFileReservedMask        = 0x4F000000
        
    };

Constructor & Destructor Documentation

Definition at line 126 of file nsDiskCacheMap.h.


Member Function Documentation

Definition at line 148 of file nsDiskCacheMap.h.

{ mDataLocation = 0; }

Here is the caller graph for this function:

Definition at line 215 of file nsDiskCacheMap.h.

{ mMetaLocation = 0; }   

Here is the caller graph for this function:

Definition at line 177 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 187 of file nsDiskCacheMap.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 150 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 200 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 192 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 147 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 182 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 143 of file nsDiskCacheMap.h.

{ return mEvictionRank; }

Here is the caller graph for this function:

Definition at line 280 of file nsDiskCacheMap.h.

    {
        if ((mDataLocation & eLocationInitializedMask)  &&
            (DataFile() == 0))
            return DataFileGeneration();
            
        if ((mMetaLocation & eLocationInitializedMask)  &&
            (MetaFile() == 0))
            return MetaFileGeneration();
        
        return 0;  // no generation
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 139 of file nsDiskCacheMap.h.

{ return mHashNumber; }

Here is the caller graph for this function:

Definition at line 245 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 255 of file nsDiskCacheMap.h.

Here is the call graph for this function:

Definition at line 218 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 267 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 260 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 216 of file nsDiskCacheMap.h.

{ return mMetaLocation; }

Here is the caller graph for this function:

Definition at line 214 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

Definition at line 250 of file nsDiskCacheMap.h.

Here is the caller graph for this function:

void nsDiskCacheRecord::SetDataBlocks ( PRUint32  index,
PRUint32  startBlock,
PRUint32  blockCount 
) [inline]

Definition at line 155 of file nsDiskCacheMap.h.

    {
        // clear everything
        mDataLocation = 0;
        
        // set file index
        NS_ASSERTION( index < 4,"invalid location index");
        NS_ASSERTION( index > 0,"invalid location index");
        mDataLocation |= (index << eLocationSelectorOffset) & eLocationSelectorMask;

        // set startBlock
        NS_ASSERTION(startBlock == (startBlock & eBlockNumberMask), "invalid block number");
        mDataLocation |= startBlock & eBlockNumberMask;
        
        // set blockCount
        NS_ASSERTION( (blockCount>=1) && (blockCount<=4),"invalid block count");
        blockCount = --blockCount;
        mDataLocation |= (blockCount << eExtraBlocksOffset) & eExtraBlocksMask;
        
        mDataLocation |= eLocationInitializedMask;
    }

Here is the caller graph for this function:

Definition at line 205 of file nsDiskCacheMap.h.

    {
        // clear everything, (separate file index = 0)
        mDataLocation = 0;
        mDataLocation |= generation & eFileGenerationMask;
        mDataLocation |= eLocationInitializedMask;
    }

Here is the caller graph for this function:

Definition at line 193 of file nsDiskCacheMap.h.

    {
        NS_ASSERTION((mDataLocation & eFileReservedMask) == 0, "bad location");
        mDataLocation &= ~eFileSizeMask;    // clear eFileSizeMask
        mDataLocation |= (size << eFileSizeOffset) & eFileSizeMask;
    }

Here is the caller graph for this function:

Definition at line 144 of file nsDiskCacheMap.h.

{ mEvictionRank = rank ? rank : 1; }

Here is the caller graph for this function:

Definition at line 140 of file nsDiskCacheMap.h.

{ mHashNumber = hashNumber; }

Here is the caller graph for this function:

void nsDiskCacheRecord::SetMetaBlocks ( PRUint32  index,
PRUint32  startBlock,
PRUint32  blockCount 
) [inline]

Definition at line 223 of file nsDiskCacheMap.h.

    {
        // clear everything
        mMetaLocation = 0;
        
        // set file index
        NS_ASSERTION( index < 4, "invalid location index");
        NS_ASSERTION( index > 0, "invalid location index");
        mMetaLocation |= (index << eLocationSelectorOffset) & eLocationSelectorMask;

        // set startBlock
        NS_ASSERTION(startBlock == (startBlock & eBlockNumberMask), "invalid block number");
        mMetaLocation |= startBlock & eBlockNumberMask;
        
        // set blockCount
        NS_ASSERTION( (blockCount>=1) && (blockCount<=4),"invalid block count");
        blockCount = --blockCount;
        mMetaLocation |= (blockCount << eExtraBlocksOffset) & eExtraBlocksMask;
        
        mMetaLocation |= eLocationInitializedMask;
    }

Here is the caller graph for this function:

Definition at line 272 of file nsDiskCacheMap.h.

    {
        // clear everything, (separate file index = 0)
        mMetaLocation = 0;
        mMetaLocation |= generation & eFileGenerationMask;
        mMetaLocation |= eLocationInitializedMask;
    }

Here is the caller graph for this function:

Definition at line 261 of file nsDiskCacheMap.h.

    {
        mMetaLocation &= ~eFileSizeMask;    // clear eFileSizeMask
        mMetaLocation |= (size << eFileSizeOffset) & eFileSizeMask;
    }

Here is the caller graph for this function:

Definition at line 131 of file nsDiskCacheMap.h.

    {
        if ((mDataLocation & eReservedMask) || (mMetaLocation & eReservedMask))
            return PR_FALSE;
        return PR_TRUE;
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 381 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 387 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 391 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 388 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 386 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 385 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 382 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 389 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 390 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 102 of file nsDiskCacheMap.h.

Definition at line 383 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 384 of file nsDiskCacheDeviceSQL.cpp.

Definition at line 101 of file nsDiskCacheMap.h.

Definition at line 100 of file nsDiskCacheMap.h.

Definition at line 103 of file nsDiskCacheMap.h.


The documentation for this class was generated from the following files: