Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
nsFastLoadService Class Reference

#include <nsFastLoadService.h>

Inheritance diagram for nsFastLoadService:
Inheritance graph
[legend]
Collaboration diagram for nsFastLoadService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsFastLoadService ()
nsIFile newFastLoadFile (in string aBaseName)
nsIObjectInputStream newInputStream (in nsIInputStream aSrcStream)
nsIObjectOutputStream newOutputStream (in nsIOutputStream aDestStream)
void startMuxedDocument (in nsISupports aURI, in string aURISpec, in PRInt32 aDirectionFlags)
 These methods associate a URI object with its spec, for faster select using the object pointer as a key, rather than the spec string.
nsISupports selectMuxedDocument (in nsISupports aURI)
void endMuxedDocument (in nsISupports aURI)
void addDependency (in nsIFile aFile)
PRUint32 computeChecksum (in nsIFile aFile, in nsIFastLoadReadControl aControl)
void cacheChecksum (in nsIFile aFile, in nsIObjectOutputStream aStream)
void getFastLoadReferent (inout nsISupports aPtr)
void readFastLoadPtr (in nsIObjectInputStream aInputStream, inout nsISupports aPtr)
void writeFastLoadPtr (in nsIObjectOutputStream aOutputStream, in nsISupports aPtr)
boolean hasMuxedDocument (in string aURISpec)
 Return true if aURISpec identifies a muxed document in the FastLoad file, false otherwise.

Static Public Member Functions

NS_DECL_ISUPPORTS static
NS_DECL_NSIFASTLOADSERVICE
NS_METHOD 
Create (nsISupports *aOuter, REFNSIID aIID, void **aResult)

Public Attributes

const PRInt32 NS_FASTLOAD_READ = 1
const PRInt32 NS_FASTLOAD_WRITE = 2
attribute nsIObjectInputStream inputStream
attribute nsIObjectOutputStream outputStream
attribute nsIFastLoadFileIO fileIO
readonly attribute PRInt32 direction

Private Member Functions

 ~nsFastLoadService ()

Private Attributes

PRLockmLock
PLDHashTablemFastLoadPtrMap
nsCOMPtr< nsIObjectInputStreammInputStream
nsCOMPtr< nsIObjectOutputStreammOutputStream
nsCOMPtr< nsIFastLoadFileIOmFileIO
PRInt32 mDirection
nsHashtable mChecksumTable

Detailed Description

Definition at line 49 of file nsFastLoadService.h.


Constructor & Destructor Documentation

Definition at line 65 of file nsFastLoadService.cpp.

  : mLock(nsnull),
    mFastLoadPtrMap(nsnull),
    mDirection(0)
{
    NS_ASSERTION(gFastLoadService_ == nsnull, "double FastLoadService init?");
    gFastLoadService_ = this;
}

Here is the caller graph for this function:

Definition at line 74 of file nsFastLoadService.cpp.

Here is the call graph for this function:


Member Function Documentation

NS_IMETHODIMP nsFastLoadService::Create ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 90 of file nsFastLoadService.cpp.

{
    *aResult = nsnull;
    if (aOuter)
        return NS_ERROR_NO_AGGREGATION;

    nsFastLoadService* fastLoadService = new nsFastLoadService();
    if (!fastLoadService)
        return NS_ERROR_OUT_OF_MEMORY;

    fastLoadService->mLock = PR_NewLock();
    if (!fastLoadService->mLock) {
        delete fastLoadService;
        return NS_ERROR_OUT_OF_MEMORY;
    }

    NS_ADDREF(fastLoadService);
    nsresult rv = fastLoadService->QueryInterface(aIID, aResult);
    NS_RELEASE(fastLoadService);
    return rv;
}

Here is the call graph for this function:

void nsIFastLoadService::endMuxedDocument ( in nsISupports  aURI) [inherited]
void nsIFastLoadService::getFastLoadReferent ( inout nsISupports  aPtr) [inherited]

Return true if aURISpec identifies a muxed document in the FastLoad file, false otherwise.

void nsIFastLoadService::readFastLoadPtr ( in nsIObjectInputStream  aInputStream,
inout nsISupports  aPtr 
) [inherited]
nsISupports nsIFastLoadService::selectMuxedDocument ( in nsISupports  aURI) [inherited]
void nsIFastLoadService::startMuxedDocument ( in nsISupports  aURI,
in string  aURISpec,
in PRInt32  aDirectionFlags 
) [inherited]

These methods associate a URI object with its spec, for faster select using the object pointer as a key, rather than the spec string.

The selectMuxedDocument method returns the previously selected URI object, in case a caller needs to reselect the previous after muxing data for a given URI synchronously. For the non-blocking or "asynchronous" i/o case, the caller must select the source URI from the FastLoad multiplex before writing a new burst of data parsed from the slow-loaded source.

Clients of inputStream and outputStream should try to demultiplex data from the input stream only if fastLoadService->StartMuxedDocument(uri, urispec, NS_FASTLOAD_READ) succeeds. If StartMuxedDocument fails with NS_ERROR_NOT_AVAILABLE, callers should slow-load the documents, muxing their data to the current output stream.

void nsIFastLoadService::writeFastLoadPtr ( in nsIObjectOutputStream  aOutputStream,
in nsISupports  aPtr 
) [inherited]

Member Data Documentation

Definition at line 72 of file nsIFastLoadService.idl.

Definition at line 71 of file nsIFastLoadService.idl.

Definition at line 69 of file nsIFastLoadService.idl.

nsHashtable nsFastLoadService::mChecksumTable [private]

Definition at line 70 of file nsFastLoadService.h.

Definition at line 69 of file nsFastLoadService.h.

Definition at line 65 of file nsFastLoadService.h.

Definition at line 68 of file nsFastLoadService.h.

Definition at line 66 of file nsFastLoadService.h.

Definition at line 64 of file nsFastLoadService.h.

Definition at line 67 of file nsFastLoadService.h.

Definition at line 66 of file nsIFastLoadService.idl.

Definition at line 67 of file nsIFastLoadService.idl.

Definition at line 70 of file nsIFastLoadService.idl.


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