Back to index

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

List of all members.

Public Member Functions

 nsOnStartRequestEvent (nsAsyncStreamObserver *listener, nsIRequest *request, nsISupports *context)
virtual ~nsOnStartRequestEvent ()
NS_IMETHOD HandleEvent ()
 nsOnStartRequestEvent (nsRequestObserverProxy *proxy, nsIRequest *request, nsISupports *context)
 ~nsOnStartRequestEvent ()
void HandleEvent ()
 nsOnStartRequestEvent (nsStreamProxyBase *aProxy, nsIRequest *aRequest, nsISupports *aContext)
 ~nsOnStartRequestEvent ()
NS_IMETHOD HandleEvent ()
nsresult FireEvent (nsIEventQueue *)
PLEventGetPLEvent ()
nsresult Fire (nsIEventQueue *aEventQ)

Static Public Member Functions

static nsARequestObserverEventFromPLEvent (PLEvent *p)

Static Protected Member Functions

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

Protected Attributes

PLEvent mEvent
nsCOMPtr< nsIRequestmRequest
nsCOMPtr< nsISupports > mContext
PLEvent mEvent
nsCOMPtr< nsIRequestmRequest
nsCOMPtr< nsISupports > mContext
nsAsyncStreamObservermListener
nsIRequestmRequest
nsISupports * mContext
PLEvent mEvent

Private Attributes

nsRequestObserverProxymProxy

Detailed Description

Definition at line 195 of file nsAsyncStreamListener.cpp.


Constructor & Destructor Documentation

nsOnStartRequestEvent::nsOnStartRequestEvent ( nsAsyncStreamObserver listener,
nsIRequest request,
nsISupports *  context 
) [inline]

Definition at line 198 of file nsAsyncStreamListener.cpp.

        : nsStreamListenerEvent(listener, request, context) {}
virtual nsOnStartRequestEvent::~nsOnStartRequestEvent ( ) [inline, virtual]

Definition at line 201 of file nsAsyncStreamListener.cpp.

{}
nsOnStartRequestEvent::nsOnStartRequestEvent ( nsRequestObserverProxy proxy,
nsIRequest request,
nsISupports *  context 
) [inline]

Definition at line 134 of file nsRequestObserverProxy.cpp.

Here is the call graph for this function:

nsOnStartRequestEvent::nsOnStartRequestEvent ( nsStreamProxyBase aProxy,
nsIRequest aRequest,
nsISupports *  aContext 
) [inline]

Definition at line 112 of file nsStreamObserverProxy.cpp.


Member Function Documentation

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

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:

void PR_CALLBACK nsARequestObserverEvent::DestroyPLEvent ( PLEvent plev) [static, protected, inherited]

Definition at line 119 of file nsRequestObserverProxy.cpp.

{
    nsARequestObserverEvent *ev = FromPLEvent(plev);
    NS_ASSERTION(ev, "null event");
    delete ev;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void PR_CALLBACK nsStreamObserverEvent::DestroyPLEvent ( PLEvent aEvent) [static, protected, inherited]

Definition at line 97 of file nsStreamObserverProxy.cpp.

{
    nsStreamObserverEvent *ev = GET_STREAM_OBSERVER_EVENT(aEvent);
    NS_ASSERTION(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:

Definition at line 73 of file nsStreamObserverProxy.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static nsARequestObserverEvent* nsARequestObserverEvent::FromPLEvent ( PLEvent p) [inline, static, inherited]

Definition at line 80 of file nsRequestObserverProxy.h.

        { return (nsARequestObserverEvent *)
            ( (char *) p - offsetof(nsARequestObserverEvent, mEvent) ); }

Here is the caller graph for this function:

PLEvent* nsARequestObserverEvent::GetPLEvent ( ) [inline, inherited]

Definition at line 83 of file nsRequestObserverProxy.h.

{ return &mEvent; }

Here is the caller graph for this function:

Implements nsStreamListenerEvent.

Implements nsStreamListenerEvent.

Definition at line 151 of file nsRequestObserverProxy.cpp.

    {
        LOG(("nsOnStartRequestEvent::HandleEvent [req=%x]\n", mRequest.get()));

        if (!mProxy->mObserver) {
            NS_NOTREACHED("already handled onStopRequest event (observer is null)");
            return;
        }

        LOG(("handle startevent=%8lX\n",(long)this));
        nsresult rv = mProxy->mObserver->OnStartRequest(mRequest, mContext);
        if (NS_FAILED(rv)) {
            LOG(("OnStartRequest failed [rv=%x] canceling request!\n", rv));
            rv = mRequest->Cancel(rv);
            NS_ASSERTION(NS_SUCCEEDED(rv), "Cancel failed for request!");
        }
    }

Implements nsStreamListenerEvent.

Definition at line 207 of file nsAsyncStreamListener.cpp.

{
#if defined(PR_LOGGING)
  if (!gStreamEventLog)
      gStreamEventLog = PR_NewLogModule("netlibStreamEvent");
  PR_LOG(gStreamEventLog, PR_LOG_DEBUG,
         ("netlibEvent: Handle Start [event=%x]", this));
#endif
  nsIRequestObserver* receiver = (nsIRequestObserver*)mListener->GetReceiver();
  if (receiver == nsnull) {
      // must have already called OnStopRequest (it clears the receiver)
      return NS_ERROR_FAILURE;
  }

  nsresult status;
  nsresult rv = mRequest->GetStatus(&status);
  NS_ASSERTION(NS_SUCCEEDED(rv), "GetStatus failed");
  rv = receiver->OnStartRequest(mRequest, mContext);

  return rv;
}

Here is the call graph for this function:

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

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:

void PR_CALLBACK nsARequestObserverEvent::HandlePLEvent ( PLEvent plev) [static, protected, inherited]

Definition at line 108 of file nsRequestObserverProxy.cpp.

{
    nsARequestObserverEvent *ev = FromPLEvent(plev);
    NS_ASSERTION(ev, "null event");

    // Pass control to the real event handler
    if (ev)
        ev->HandleEvent();
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 86 of file nsStreamObserverProxy.cpp.

{
    nsStreamObserverEvent *ev = GET_STREAM_OBSERVER_EVENT(aEvent);
    NS_ASSERTION(ev, "null event");

    // Pass control the real event handler
    if (ev)
        ev->HandleEvent();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

nsISupports* nsStreamListenerEvent::mContext [protected, inherited]

Definition at line 79 of file nsAsyncStreamListener.cpp.

nsCOMPtr<nsISupports> nsARequestObserverEvent::mContext [protected, inherited]

Definition at line 97 of file nsRequestObserverProxy.h.

nsCOMPtr<nsISupports> nsStreamObserverEvent::mContext [protected, inherited]

Definition at line 103 of file nsStreamObserverProxy.h.

PLEvent nsStreamListenerEvent::mEvent [protected, inherited]

Definition at line 80 of file nsAsyncStreamListener.cpp.

PLEvent nsARequestObserverEvent::mEvent [protected, inherited]

Definition at line 94 of file nsRequestObserverProxy.h.

PLEvent nsStreamObserverEvent::mEvent [protected, inherited]

Definition at line 100 of file nsStreamObserverProxy.h.

Definition at line 77 of file nsAsyncStreamListener.cpp.

Reimplemented from nsStreamObserverEvent.

Definition at line 132 of file nsRequestObserverProxy.cpp.

Definition at line 78 of file nsAsyncStreamListener.cpp.

Definition at line 96 of file nsRequestObserverProxy.h.

Definition at line 102 of file nsStreamObserverProxy.h.


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