Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions
nsSyncLoadService Class Reference
Inheritance diagram for nsSyncLoadService:
Inheritance graph
[legend]
Collaboration diagram for nsSyncLoadService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsSyncLoadService ()
virtual ~nsSyncLoadService ()
nsIDOMDocument loadDocument (in nsIChannel aChannel, in nsIURI aLoaderURI)
 Synchronously load the document from the specified channel.
nsIDOMDocument loadDocumentAsXML (in nsIChannel aChannel, in nsIURI aLoaderURI)
nsIDOMDocument loadLocalDocument (in nsIChannel aChannel, in nsIURI aLoaderURI)
 Synchronously load an XML document from the specified channel.
nsIDOMDocument loadLocalXBLDocument (in nsIChannel aChannel)
 Synchronously load the xbl-document from the specified channel.

Static Public Member Functions

NS_DECL_ISUPPORTS static
NS_DECL_NSISYNCLOADDOMSERVICE
nsresult 
PushSyncStreamToListener (nsIInputStream *aIn, nsIStreamListener *aListener, nsIChannel *aChannel)

Detailed Description

Definition at line 81 of file nsSyncLoadService.cpp.


Constructor & Destructor Documentation

Definition at line 447 of file nsSyncLoadService.cpp.

{
}

Definition at line 451 of file nsSyncLoadService.cpp.

{
}

Member Function Documentation

nsIDOMDocument nsISyncLoadDOMService::loadDocument ( in nsIChannel  aChannel,
in nsIURI  aLoaderURI 
) [inherited]

Synchronously load the document from the specified channel.

Parameters:
aChannelThe channel to load the document from.
aLoaderURIURI of loading document. For security checks null if no securitychecks should be done
Returns:
The document loaded from the URI.
nsIDOMDocument nsISyncLoadDOMService::loadDocumentAsXML ( in nsIChannel  aChannel,
in nsIURI  aLoaderURI 
) [inherited]
nsIDOMDocument nsISyncLoadDOMService::loadLocalDocument ( in nsIChannel  aChannel,
in nsIURI  aLoaderURI 
) [inherited]

Synchronously load an XML document from the specified channel.

The channel must be possible to open synchronously.

Parameters:
aChannelThe channel to load the document from.
aLoaderURIURI of loading document. For security checks null if no securitychecks should be done
Returns:
The document loaded from the URI.

Synchronously load the xbl-document from the specified channel.

The channel must be possible to open synchronously.

Parameters:
aChannelThe channel to load the document from.
Returns:
The document loaded from the URI.

Definition at line 541 of file nsSyncLoadService.cpp.

{
    // Set up buffering stream
    nsCOMPtr<nsIInputStream> bufferedStream;
    nsresult rv = NS_NewBufferedInputStream(getter_AddRefs(bufferedStream),
                                            aIn, 4096);
    NS_ENSURE_SUCCESS(rv, rv);

    // Load
    aListener->OnStartRequest(aChannel, nsnull);
    PRUint32 sourceOffset = 0;
    while (1) {
        PRUint32 readCount = 0;
        rv = bufferedStream->Available(&readCount);
        if (NS_FAILED(rv) || !readCount) {
            break;
        }

        rv = aListener->OnDataAvailable(aChannel, nsnull, bufferedStream,
                                        sourceOffset, readCount);
        if (NS_FAILED(rv)) {
            break;
        }

        sourceOffset += readCount;
    }
    aListener->OnStopRequest(aChannel, nsnull, rv);
    
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:


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