Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
nsStreamListenerProxy Class Reference

#include <nsStreamListenerProxy.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSISTREAMLISTENERPROXY
NS_DECL_NSIINPUTSTREAMOBSERVER 
nsStreamListenerProxy ()
virtual ~nsStreamListenerProxy ()
nsresult GetListener (nsIStreamListener **)
void SetListenerStatus (nsresult status)
nsresult GetListenerStatus ()
PRUint32 GetPendingCount ()
void init (in nsIStreamListener aListener, in nsIEventQueue aEventQ, in unsigned long aBufferSegmentSize, in unsigned long aBufferMaxSize)
 Initializes an nsIStreamListenerProxy.
void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount)
 Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread.
void onStartRequest (in nsIRequest aRequest, in nsISupports aContext)
 Called to signify the beginning of an asynchronous request.
void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode)
 Called to signify the end of an asynchronous request.
void onEmpty (in nsIInputStream inStr)
 Called when the input stream's consumer has read all the existing data from the stream.
void onClose (in nsIInputStream inStr)
 Called when the consumer closes its end of the stream.

Protected Attributes

nsRequestObserverProxymObserverProxy
nsCOMPtr< nsIInputStreammPipeIn
nsCOMPtr< nsIOutputStreammPipeOut
nsCOMPtr< nsIRequestmRequestToResume
PRLockmLock
PRUint32 mPendingCount
PRBool mPipeEmptied
nsresult mListenerStatus

Detailed Description

Definition at line 50 of file nsStreamListenerProxy.h.


Constructor & Destructor Documentation

Definition at line 86 of file nsStreamListenerProxy.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 96 of file nsStreamListenerProxy.cpp.

Here is the call graph for this function:

Definition at line 66 of file nsStreamListenerProxy.h.

{ return mListenerStatus; }

Definition at line 106 of file nsStreamListenerProxy.cpp.

{
    return PR_AtomicSet((PRInt32 *) &mPendingCount, 0);
}

Here is the call graph for this function:

void nsIStreamListenerProxy::init ( in nsIStreamListener  aListener,
in nsIEventQueue  aEventQ,
in unsigned long  aBufferSegmentSize,
in unsigned long  aBufferMaxSize 
) [inherited]

Initializes an nsIStreamListenerProxy.

Parameters:
aListenerreceives listener notifications on the other thread
aEventQmay be NULL indicating the calling thread's event queue
aBufferSegmentSizepassing zero indicates the default
aBufferMaxSizepassing zero indicates the default

Called when the consumer closes its end of the stream.

void nsIStreamListener::onDataAvailable ( in nsIRequest  aRequest,
in nsISupports  aContext,
in nsIInputStream  aInputStream,
in unsigned long  aOffset,
in unsigned long  aCount 
) [inherited]

Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread.

The onDataAvailable impl must read exactly |aCount| bytes of data before returning.

Parameters:
aRequestrequest corresponding to the source of the data
aContextuser defined context
aInputStreaminput stream containing the data chunk
aOffsetNumber of bytes that were sent in previous onDataAvailable calls for this request. In other words, the sum of all previous count parameters. If that number is greater than or equal to 2^32, this parameter will be PR_UINT32_MAX (2^32 - 1).
aCountnumber of bytes available in the stream

NOTE: The aInputStream parameter must implement readSegments.

An exception thrown from onDataAvailable has the side-effect of causing the request to be canceled.

Called when the input stream's consumer has read all the existing data from the stream.

void nsIRequestObserver::onStartRequest ( in nsIRequest  aRequest,
in nsISupports  aContext 
) [inherited]

Called to signify the beginning of an asynchronous request.

Parameters:
aRequestrequest being observed
aContextuser defined context

An exception thrown from onStartRequest has the side-effect of causing the request to be canceled.

Here is the caller graph for this function:

void nsIRequestObserver::onStopRequest ( in nsIRequest  aRequest,
in nsISupports  aContext,
in nsresult  aStatusCode 
) [inherited]

Called to signify the end of an asynchronous request.

This call is always preceded by a call to onStartRequest.

Parameters:
aRequestrequest being observed
aContextuser defined context
aStatusCodereason for stopping (NS_OK if completed successfully)

An exception thrown from onStopRequest is generally ignored.

Here is the caller graph for this function:

Definition at line 65 of file nsStreamListenerProxy.h.


Member Data Documentation

Definition at line 80 of file nsStreamListenerProxy.h.

Definition at line 77 of file nsStreamListenerProxy.h.

Definition at line 71 of file nsStreamListenerProxy.h.

Definition at line 78 of file nsStreamListenerProxy.h.

Definition at line 79 of file nsStreamListenerProxy.h.

Definition at line 73 of file nsStreamListenerProxy.h.

Definition at line 74 of file nsStreamListenerProxy.h.

Definition at line 76 of file nsStreamListenerProxy.h.


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