Back to index

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

List of all members.

Public Member Functions

 nsStreamListenerEvent (nsAsyncStreamObserver *listener, nsIRequest *request, nsISupports *context)
virtual ~nsStreamListenerEvent ()
nsresult Fire (nsIEventQueue *aEventQ)
NS_IMETHOD HandleEvent ()=0

Static Protected Member Functions

static void PR_CALLBACK HandlePLEvent (PLEvent *aEvent)
static void PR_CALLBACK DestroyPLEvent (PLEvent *aEvent)

Protected Attributes

nsAsyncStreamObservermListener
nsIRequestmRequest
nsISupports * mContext
PLEvent mEvent

Detailed Description

Definition at line 62 of file nsAsyncStreamListener.cpp.


Constructor & Destructor Documentation

nsStreamListenerEvent::nsStreamListenerEvent ( nsAsyncStreamObserver listener,
nsIRequest request,
nsISupports *  context 
)

Member Function Documentation

Definition at line 128 of file nsAsyncStreamListener.cpp.

{
    nsStreamListenerEvent* ev = GET_STREAM_LISTENER_EVENT(aEvent);
    NS_ASSERTION(nsnull != ev, "null event.");
    delete ev;
}

Here is the caller graph for this function:

Definition at line 136 of file nsAsyncStreamListener.cpp.

{
    NS_PRECONDITION(nsnull != aEventQueue, "nsIEventQueue for thread is null");

    PL_InitEvent(&mEvent,
                 nsnull,
                 (PLHandleEventProc)  nsStreamListenerEvent::HandlePLEvent,
                 (PLDestroyEventProc) nsStreamListenerEvent::DestroyPLEvent);

    return aEventQueue->PostEvent(&mEvent);
}

Here is the call graph for this function:

void PR_CALLBACK nsStreamListenerEvent::HandlePLEvent ( PLEvent aEvent) [static, protected]

Definition at line 108 of file nsAsyncStreamListener.cpp.

{
    nsStreamListenerEvent* ev = GET_STREAM_LISTENER_EVENT(aEvent);
    NS_ASSERTION(nsnull != ev,"null event.");

    nsresult rv = ev->HandleEvent();
    //
    // If the consumer fails, then cancel the transport.  This is necessary
    // in case where the socket transport is blocked waiting for room in the
    // pipe, but the consumer fails without consuming all the data.
    //
    // Unless the transport is cancelled, it will block forever, waiting for
    // the pipe to empty...
    //
    if (NS_FAILED(rv)) {
        nsresult cancelRv = ev->mRequest->Cancel(rv);
        NS_ASSERTION(NS_SUCCEEDED(cancelRv), "Cancel failed");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

nsISupports* nsStreamListenerEvent::mContext [protected]

Definition at line 79 of file nsAsyncStreamListener.cpp.

Definition at line 80 of file nsAsyncStreamListener.cpp.

Definition at line 77 of file nsAsyncStreamListener.cpp.

Definition at line 78 of file nsAsyncStreamListener.cpp.


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