Back to index

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

#include <nsRequestObserverProxy.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSIREQUESTOBSERVERPROXY 
nsRequestObserverProxy ()
virtual ~nsRequestObserverProxy ()
nsIRequestObserverObserver ()
nsresult FireEvent (nsARequestObserverEvent *)
nsIEventQueueEventQueue ()
nsresult SetEventQueue (nsIEventQueue *)
void init (in nsIRequestObserver observer, in nsIEventQueue eventQ)
 Initializes an nsIRequestObserverProxy.
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.

Protected Attributes

nsCOMPtr< nsIRequestObservermObserver
nsCOMPtr< nsIEventQueuemEventQ

Friends

class nsOnStartRequestEvent
class nsOnStopRequestEvent

Detailed Description

Definition at line 50 of file nsRequestObserverProxy.h.


Constructor & Destructor Documentation

NS_DECL_ISUPPORTS NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSIREQUESTOBSERVERPROXY nsRequestObserverProxy::nsRequestObserverProxy ( ) [inline]

Definition at line 57 of file nsRequestObserverProxy.h.

{ }

Definition at line 220 of file nsRequestObserverProxy.cpp.

{
    if (mObserver) {
        // order is crucial here... we must be careful to clear mObserver
        // before posting the proxy release event.  otherwise, we'd risk
        // releasing the object on this thread.
        nsIRequestObserver *obs = mObserver;
        NS_ADDREF(obs);
        mObserver = 0;
        ProxyRelease(mEventQ, obs);
    }
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 63 of file nsRequestObserverProxy.h.

{ return mEventQ.get(); } // debugging aid

Here is the call graph for this function:

Definition at line 313 of file nsRequestObserverProxy.cpp.

Here is the call graph for this function:

void nsIRequestObserverProxy::init ( in nsIRequestObserver  observer,
in nsIEventQueue  eventQ 
) [inherited]

Initializes an nsIRequestObserverProxy.

Parameters:
observer- receives observer notifications on the other thread
eventQ- may be NULL indicating the calling thread's event queue

Definition at line 60 of file nsRequestObserverProxy.h.

{ return mObserver; }

Here is the caller graph for this function:

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 321 of file nsRequestObserverProxy.cpp.

{
    nsresult rv = NS_OK;
    if ((eq == NS_CURRENT_EVENTQ) || (eq == NS_UI_THREAD_EVENTQ)) {
        nsCOMPtr<nsIEventQueueService> serv = do_GetService(kEventQueueService, &rv);
        if (NS_FAILED(rv)) return rv;
        rv = serv->GetSpecialEventQueue(NS_PTR_TO_INT32(eq), getter_AddRefs(mEventQ));
    }
    else
        mEventQ = eq;
    return rv;
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class nsOnStartRequestEvent [friend]

Definition at line 70 of file nsRequestObserverProxy.h.

friend class nsOnStopRequestEvent [friend]

Definition at line 71 of file nsRequestObserverProxy.h.


Member Data Documentation

Definition at line 68 of file nsRequestObserverProxy.h.

Definition at line 67 of file nsRequestObserverProxy.h.


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