You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.


TOC PREV NEXT INDEX

Embedding Gecko API


nsIRequestObserver


This interface defines an observer of the request cycle. It is scriptable.

Methods
onStartRequest

Called to signify the beginning of an asynchronous request.

Syntax:

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

Parameters:

aRequest: The request being observed.
aContext: A user defined context.

nsresult:

NS_OK if successful.

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

onStopRequest

Called to signify the end of an asynchronous request.This call is always preceded by a call to onStartRequest.

Syntax:

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

Parameters:

aRequest: The request being observed.
aContext: A user defined context.
aStatusCode: The reason for stopping (NS_OK if completed successfully.

nsresult:

NS_OK if successful.

Note: An exception thrown from onStopRequest is generally ignored.


Written by:Ellen Evans | Comments, questions, complaints? Bug 143387
TOC PREV NEXT INDEX