Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsDiskCacheBinding.cpp File Reference
#include <limits.h>
#include "nscore.h"
#include "nsDiskCacheBinding.h"

Go to the source code of this file.

Classes

struct  HashTableEntry

Functions

static const void *PR_CALLBACK GetKey (PLDHashTable *, PLDHashEntryHdr *header)
static PLDHashNumber PR_CALLBACK HashKey (PLDHashTable *table, const void *key)
static PRBool PR_CALLBACK MatchEntry (PLDHashTable *, const PLDHashEntryHdr *header, const void *key)
static void PR_CALLBACK MoveEntry (PLDHashTable *, const PLDHashEntryHdr *src, PLDHashEntryHdr *dst)
static void PR_CALLBACK ClearEntry (PLDHashTable *, PLDHashEntryHdr *header)
nsDiskCacheBindingGetCacheEntryBinding (nsCacheEntry *entry)
PLDHashOperator PR_CALLBACK ActiveBinding (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)
 ActiveBinding : PLDHashTable enumerate function to verify active bindings.

Function Documentation

PLDHashOperator PR_CALLBACK ActiveBinding ( PLDHashTable table,
PLDHashEntryHdr hdr,
PRUint32  number,
void arg 
)

ActiveBinding : PLDHashTable enumerate function to verify active bindings.

Definition at line 376 of file nsDiskCacheBinding.cpp.

{
    nsDiskCacheBinding * binding = ((HashTableEntry *)hdr)->mBinding;
    NS_ASSERTION(binding, "### disk cache binding = nsnull!");
    
    nsDiskCacheBinding * head = binding;
    do {   
        if (binding->IsActive()) {
           *((PRBool *)arg) = PR_TRUE;
            return PL_DHASH_STOP;
        }

        binding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
    } while (binding != head);

    return PL_DHASH_NEXT;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void PR_CALLBACK ClearEntry ( PLDHashTable ,
PLDHashEntryHdr header 
) [static]

Definition at line 96 of file nsDiskCacheBinding.cpp.

{
    ((HashTableEntry *)header)->mBinding = nsnull;
}

Definition at line 112 of file nsDiskCacheBinding.cpp.

{
    return (nsDiskCacheBinding *) entry->Data();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const void* PR_CALLBACK GetKey ( PLDHashTable ,
PLDHashEntryHdr header 
) [static]

Definition at line 64 of file nsDiskCacheBinding.cpp.

{
    return (void*) ((HashTableEntry *)header)->mBinding->mRecord.HashNumber();
}

Here is the caller graph for this function:

static PLDHashNumber PR_CALLBACK HashKey ( PLDHashTable table,
const void key 
) [static]

Definition at line 71 of file nsDiskCacheBinding.cpp.

static PRBool PR_CALLBACK MatchEntry ( PLDHashTable ,
const PLDHashEntryHdr header,
const void key 
) [static]

Definition at line 78 of file nsDiskCacheBinding.cpp.

{
    HashTableEntry * hashEntry = (HashTableEntry *) header;
    return (hashEntry->mBinding->mRecord.HashNumber() == (PLDHashNumber) NS_PTR_TO_INT32(key));
}

Here is the call graph for this function:

static void PR_CALLBACK MoveEntry ( PLDHashTable ,
const PLDHashEntryHdr src,
PLDHashEntryHdr dst 
) [static]

Definition at line 87 of file nsDiskCacheBinding.cpp.

{
    ((HashTableEntry *)dst)->mBinding = ((HashTableEntry *)src)->mBinding;
}