Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
EntryInfoVisitor Class Reference
Inheritance diagram for EntryInfoVisitor:
Inheritance graph
Collaboration diagram for EntryInfoVisitor:
Collaboration graph

List of all members.

Public Member Functions

 EntryInfoVisitor (nsDiskCacheDevice *device, nsDiskCacheMap *cacheMap, nsICacheVisitor *visitor)
virtual PRInt32 VisitRecord (nsDiskCacheRecord *mapRecord)

Private Attributes

nsresult mResult

Detailed Description

Definition at line 737 of file nsDiskCacheDevice.cpp.

Constructor & Destructor Documentation

EntryInfoVisitor::EntryInfoVisitor ( nsDiskCacheDevice device,
nsDiskCacheMap cacheMap,
nsICacheVisitor visitor 
) [inline]

Definition at line 740 of file nsDiskCacheDevice.cpp.

        : mDevice(device)
        , mCacheMap(cacheMap)
        , mVisitor(visitor)
        , mResult(NS_OK)

Member Function Documentation

virtual PRInt32 EntryInfoVisitor::VisitRecord ( nsDiskCacheRecord mapRecord) [inline, virtual]

Implements nsDiskCacheRecordVisitor.

Definition at line 749 of file nsDiskCacheDevice.cpp.

        // XXX optimization: do we have this record in memory?
        // read in the entry (metadata)
        nsDiskCacheEntry * diskEntry;
        nsresult rv = mCacheMap->ReadDiskCacheEntry(mapRecord, &diskEntry);
        if (NS_FAILED(rv)) {
            mResult = rv;
            return kVisitNextRecord;

        // create nsICacheEntryInfo
        nsDiskCacheEntryInfo * entryInfo = new nsDiskCacheEntryInfo(DISK_CACHE_DEVICE_ID, diskEntry);
        if (!entryInfo) {
            mResult = NS_ERROR_OUT_OF_MEMORY;
            return kStopVisitingRecords;
        nsCOMPtr<nsICacheEntryInfo> ref(entryInfo);
        PRBool  keepGoing;
        rv = mVisitor->VisitEntry(DISK_CACHE_DEVICE_ID, entryInfo, &keepGoing);
        delete [] (char *)diskEntry;
        return keepGoing ? kVisitNextRecord : kStopVisitingRecords;

Here is the call graph for this function:

Member Data Documentation

Definition at line 777 of file nsDiskCacheDevice.cpp.

Definition at line 776 of file nsDiskCacheDevice.cpp.

Definition at line 779 of file nsDiskCacheDevice.cpp.

Definition at line 778 of file nsDiskCacheDevice.cpp.

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