Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
nsXMLHttpRequest Class Reference

#include <nsXMLHttpRequest.h>

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

List of all members.

Classes

class  nsHeaderVisitor

Public Member Functions

 nsXMLHttpRequest ()
virtual ~nsXMLHttpRequest ()
NS_DECL_ISUPPORTS
NS_DECL_NSIXMLHTTPREQUEST
NS_DECL_NSIJSXMLHTTPREQUEST
NS_DECL_NSIDOMEVENTTARGET
NS_DECL_NSIDOMEVENTLISTENER
NS_IMETHOD 
Load (nsIDOMEvent *aEvent)
 Processes a page or image load event.
NS_IMETHOD BeforeUnload (nsIDOMEvent *aEvent)
 Processes a page beforeUnload event.
NS_IMETHOD Unload (nsIDOMEvent *aEvent)
 Processes a page unload event.
NS_IMETHOD Abort (nsIDOMEvent *aEvent)
 Processes a load abort event.
NS_IMETHOD Error (nsIDOMEvent *aEvent)
 Processes an load error event.
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSICHANNELEVENTSINK
NS_DECL_NSIPROGRESSEVENTSINK
NS_DECL_NSIINTERFACEREQUESTOR
NS_IMETHOD 
Initialize (nsISupports *aOwner, JSContext *cx, JSObject *obj, PRUint32 argc, jsval *argv)
 Initialize a newly created native instance using the owner of the constructor and the parameters passed into the JavaScript constructor.
nsresult Init ()
virtual nsIDOMGCParticipantGetSCCIndex ()
 Get a reference node for what is known to be a strongly connected component of nsIDOMGCParticipants.
virtual void AppendReachableList (nsCOMArray< nsIDOMGCParticipant > &aArray)
 Append the list of nsIDOMGCPartipants reachable from this one via C++ getters exposed to script that return a different result from |GetSCCIndex|.
void abort ()
 If the request has been sent already, this method will abort the request.
string getAllResponseHeaders ()
 Returns all of the response headers as a string for HTTP requests.
ACString getResponseHeader (in AUTF8String header)
 Returns the text of the header with the specified name for HTTP requests.
void openRequest (in AUTF8String method, in AUTF8String url, in boolean async, in AString user, in AString password)
 Native (non-script) method to initialize a request.
void open (in AUTF8String method, in AUTF8String url)
 Meant to be a script-only method for initializing a request.
void send (in nsIVariant body)
 Sends the request.
void setRequestHeader (in AUTF8String header, in AUTF8String value)
 Sets a HTTP request header for HTTP requests.
void overrideMimeType (in AUTF8String mimetype)
 Override the mime type returned by the server (if any).
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.
void addEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture)
 This method allows the registration of event listeners on the event target.
void removeEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture)
 This method allows the removal of event listeners from the event target.
boolean dispatchEvent (in nsIDOMEvent evt) raises (DOMException)
 This method allows the dispatch of events into the implementations event model.
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 onChannelRedirect (in nsIChannel oldChannel, in nsIChannel newChannel, in unsigned long flags)
 Called when a redirect occurs.
void onProgress (in nsIRequest aRequest, in nsISupports aContext, in unsigned long long aProgress, in unsigned long long aProgressMax)
 Called to notify the event sink that progress has occurred for the given request.
void onStatus (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatus, in wstring aStatusArg)
 Called to notify the event sink with a status message for the given request.
void getInterface (in nsIIDRef uuid,[iid_is(uuid), retval] out nsQIResult result)
 Retrieves the specified interface pointer.

Public Attributes

readonly attribute nsIChannel channel
 The request uses a channel in order to perform the request.
readonly attribute nsIDOMDocument responseXML
 The response to the request is parsed as if it were a text/xml stream.
readonly attribute AString responseText
 The response to the request as text.
readonly attribute unsigned long status
 The status of the response to the request for HTTP requests.
readonly attribute AUTF8String statusText
 The string representing the status of the response for HTTP requests.
readonly attribute long readyState
 The state of the request.
attribute boolean multipart
 Set to true if the response is expected to be a stream of possibly multiple (XML) documents.
attribute nsIDOMEventListener onload
 Meant to be a script-only mechanism for setting a load event listener.
attribute nsIDOMEventListener onerror
 Meant to be a script-only mechanism for setting an error event listener.
attribute nsIDOMEventListener onprogress
 Meant to be a script-only mechanism for setting a progress event listener.
attribute
nsIOnReadyStateChangeHandler 
onreadystatechange
 Meant to be a script-only mechanism for setting a callback function.
const unsigned long REDIRECT_TEMPORARY = 1 << 0
 This is a temporary redirect.
const unsigned long REDIRECT_PERMANENT = 1 << 1
 This is a permanent redirect.
const unsigned long REDIRECT_INTERNAL = 1 << 2
 This is an internal redirect, i.e.

Protected Types

typedef
nsMarkedJSFunctionHolder
< nsIDOMEventListener
ListenerHolder

Protected Member Functions

nsresult GetStreamForWString (const PRUnichar *aStr, PRInt32 aLength, nsIInputStream **aStream)
nsresult DetectCharset (nsACString &aCharset)
nsresult ConvertBodyToText (nsAString &aOutBuffer)
nsresult ChangeState (PRUint32 aState, PRBool aBroadcast=PR_TRUE, PRBool aClearEventListeners=PR_FALSE)
nsresult RequestCompleted ()
nsresult GetLoadGroup (nsILoadGroup **aLoadGroup)
nsIURIGetBaseURI ()
nsresult CreateEvent (nsEvent *event, nsIDOMEvent **domevent)
void NotifyEventListeners (nsIDOMEventListener *aHandler, const nsCOMArray< nsIDOMEventListener > *aListeners, nsIDOMEvent *aEvent)
void ClearEventListeners ()
already_AddRefed< nsIHttpChannelGetCurrentHttpChannel ()
nsresult CheckInnerWindowCorrectness ()

Static Protected Member Functions

static NS_METHOD StreamReaderFunc (nsIInputStream *in, void *closure, const char *fromRawSegment, PRUint32 toOffset, PRUint32 count, PRUint32 *writeCount)

Protected Attributes

nsCOMPtr< nsISupports > mContext
nsCOMPtr< nsIPrincipalmPrincipal
nsCOMPtr< nsIChannelmChannel
nsCOMPtr< nsIRequestmReadRequest
nsCOMPtr< nsIDOMDocumentmDocument
nsTArray< ListenerHolder * > mLoadEventListeners
nsTArray< ListenerHolder * > mErrorEventListeners
nsCOMPtr< nsIScriptContextmScriptContext
nsWeakPtr mOwner
nsMarkedJSFunctionHolder
< nsIDOMEventListener
mOnLoadListener
nsMarkedJSFunctionHolder
< nsIDOMEventListener
mOnErrorListener
nsMarkedJSFunctionHolder
< nsIDOMEventListener
mOnProgressListener
nsMarkedJSFunctionHolder
< nsIOnReadyStateChangeHandler
mOnReadystatechangeListener
nsCOMPtr< nsIStreamListenermXMLParserStreamListener
nsCOMPtr< nsIEventQueueServicemEventQService
nsCString mResponseBody
nsCString mOverrideMimeType
nsCOMPtr< nsIInterfaceRequestormNotificationCallbacks
 The notification callbacks the channel had when Send() was called.
nsCOMPtr< nsIChannelEventSinkmChannelEventSink
 Sink interfaces that we implement that mNotificationCallbacks may want to also be notified for.
nsCOMPtr< nsIProgressEventSinkmProgressEventSink
PRUint32 mState

Detailed Description

Definition at line 70 of file nsXMLHttpRequest.h.


Member Typedef Documentation

Definition at line 134 of file nsXMLHttpRequest.h.


Constructor & Destructor Documentation

Definition at line 319 of file nsXMLHttpRequest.cpp.

Here is the call graph for this function:

Definition at line 325 of file nsXMLHttpRequest.cpp.

Here is the call graph for this function:


Member Function Documentation

nsresult nsXMLHttpRequest::Abort ( nsIDOMEvent aEvent) [virtual]

Processes a load abort event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 707 of file nsXMLHttpRequest.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIXMLHttpRequest::abort ( ) [inherited]

If the request has been sent already, this method will abort the request.

void nsIDOMEventTarget::addEventListener ( in DOMString  type,
in nsIDOMEventListener  listener,
in boolean  useCapture 
) [inherited]

This method allows the registration of event listeners on the event target.

If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase.

If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.

Parameters:
typeThe event type for which the user is registering
listenerThe listener parameter takes an interface implemented by the user which contains the methods to be called when the event occurs.
useCaptureIf true, useCapture indicates that the user wishes to initiate capture. After initiating capture, all events of the specified type will be dispatched to the registered EventListener before being dispatched to any EventTargets beneath them in the tree. Events which are bubbling upward through the tree will not trigger an EventListener designated to use capture.

Append the list of nsIDOMGCPartipants reachable from this one via C++ getters exposed to script that return a different result from |GetSCCIndex|.

The caller is responsible for taking the transitive closure of |AppendReachableList|.

This will only be called on objects that are returned by GetSCCIndex.

null pointers may be appended; they will be ignored by the caller.

Implements nsIDOMGCParticipant.

Definition at line 2138 of file nsXMLHttpRequest.cpp.

Here is the call graph for this function:

Processes a page beforeUnload event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 1894 of file nsXMLHttpRequest.cpp.

{
  return NS_OK;
}
nsresult nsXMLHttpRequest::ChangeState ( PRUint32  aState,
PRBool  aBroadcast = PR_TRUE,
PRBool  aClearEventListeners = PR_FALSE 
) [protected]

Definition at line 1939 of file nsXMLHttpRequest.cpp.

{
  // If we are setting one of the mutually exclusive states,
  // unset those state bits first.
  if (aState & XML_HTTP_REQUEST_LOADSTATES) {
    mState &= ~XML_HTTP_REQUEST_LOADSTATES;
  }
  mState |= aState;
  nsresult rv = NS_OK;

  // Take ref to the one listener we need
  nsCOMPtr<nsIOnReadyStateChangeHandler> onReadyStateChangeListener =
    mOnReadystatechangeListener.Get();

  if (aClearEventListeners) {
    ClearEventListeners();
  }

  if ((mState & XML_HTTP_REQUEST_ASYNC) &&
      (aState & XML_HTTP_REQUEST_LOADSTATES) && // Broadcast load states only
      aBroadcast &&
      onReadyStateChangeListener &&
      NS_SUCCEEDED(CheckInnerWindowCorrectness())) {
    nsCOMPtr<nsIJSContextStack> stack;
    JSContext *cx = nsnull;

    if (mScriptContext) {
      stack = do_GetService("@mozilla.org/js/xpc/ContextStack;1");

      if (stack) {
        cx = (JSContext *)mScriptContext->GetNativeContext();

        if (cx) {
          stack->Push(cx);
        }
      }
    }

    rv = onReadyStateChangeListener->HandleEvent();

    if (cx) {
      stack->Pop(&cx);
    }
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 165 of file nsXMLHttpRequest.h.

  {
    if (mOwner) {
      nsCOMPtr<nsPIDOMWindow> win = do_QueryReferent(mOwner);
      NS_ENSURE_STATE(win);
      NS_ASSERTION(win->IsInnerWindow(), "Should have inner window here!\n");
      nsPIDOMWindow* outer = win->GetOuterWindow();
      if (!outer || outer->GetCurrentInnerWindow() != win) {
        return NS_ERROR_FAILURE;
      }
    }
    return NS_OK;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 892 of file nsXMLHttpRequest.cpp.

{
  if (mState & XML_HTTP_REQUEST_ROOTED) {
    nsDOMClassInfo::UnsetExternallyReferenced(this);
    mState &= ~XML_HTTP_REQUEST_ROOTED;
  }

  // This isn't *really* needed anymore now that we use
  // nsMarkedJSFunctionHolder, but we may as well keep it for safety
  // (against leaks) and compatibility, and also for the code to clear
  // the first two arrays (called from the destructor).
  PRUint32 i, i_end;
  for (i = 0, i_end = mLoadEventListeners.Length(); i < i_end; ++i)
    delete mLoadEventListeners[i];
  mLoadEventListeners.Clear();
  for (i = 0, i_end = mErrorEventListeners.Length(); i < i_end; ++i)
    delete mErrorEventListeners[i];
  mErrorEventListeners.Clear();

  mOnLoadListener.Set(nsnull, this);
  mOnErrorListener.Set(nsnull, this);
  mOnReadystatechangeListener.Set(nsnull, this);
  mOnProgressListener.Set(nsnull, this);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsXMLHttpRequest::ConvertBodyToText ( nsAString &  aOutBuffer) [protected]

Definition at line 568 of file nsXMLHttpRequest.cpp.

{
  // This code here is basically a copy of a similar thing in
  // nsScanner::Append(const char* aBuffer, PRUint32 aLen).
  // If we get illegal characters in the input we replace
  // them and don't just fail.

  PRInt32 dataLen = mResponseBody.Length();
  if (!dataLen)
    return NS_OK;

  nsresult rv = NS_OK;

  nsCAutoString dataCharset;
  nsCOMPtr<nsIDocument> document(do_QueryInterface(mDocument));
  if (document) {
    dataCharset = document->GetDocumentCharacterSet();
  } else {
    if (NS_FAILED(DetectCharset(dataCharset)) || dataCharset.IsEmpty()) {
      // MS documentation states UTF-8 is default for responseText
      dataCharset.AssignLiteral("UTF-8");
    }
  }

  if (dataCharset.EqualsLiteral("ASCII")) {
    CopyASCIItoUTF16(mResponseBody, aOutBuffer);

    return NS_OK;
  }

  nsCOMPtr<nsICharsetConverterManager> ccm =
    do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);
  if (NS_FAILED(rv))
    return rv;

  nsCOMPtr<nsIUnicodeDecoder> decoder;
  rv = ccm->GetUnicodeDecoderRaw(dataCharset.get(),
                                 getter_AddRefs(decoder));
  if (NS_FAILED(rv))
    return rv;

  const char * inBuffer = mResponseBody.get();
  PRInt32 outBufferLength;
  rv = decoder->GetMaxLength(inBuffer, dataLen, &outBufferLength);
  if (NS_FAILED(rv))
    return rv;

  PRUnichar * outBuffer =
    NS_STATIC_CAST(PRUnichar*, nsMemory::Alloc((outBufferLength + 1) *
                                               sizeof(PRUnichar)));
  if (!outBuffer) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  PRInt32 totalChars = 0,
          outBufferIndex = 0,
          outLen = outBufferLength;

  do {
    PRInt32 inBufferLength = dataLen;
    rv = decoder->Convert(inBuffer,
                          &inBufferLength,
                          &outBuffer[outBufferIndex],
                          &outLen);
    totalChars += outLen;
    if (NS_FAILED(rv)) {
      // We consume one byte, replace it with U+FFFD
      // and try the conversion again.
      outBuffer[outBufferIndex + outLen++] = (PRUnichar)0xFFFD;
      outBufferIndex += outLen;
      outLen = outBufferLength - (++totalChars);

      decoder->Reset();

      if((inBufferLength + 1) > dataLen) {
        inBufferLength = dataLen;
      } else {
        inBufferLength++;
      }

      inBuffer = &inBuffer[inBufferLength];
      dataLen -= inBufferLength;
    }
  } while ( NS_FAILED(rv) && (dataLen > 0) );

  aOutBuffer.Assign(outBuffer, totalChars);
  nsMemory::Free(outBuffer);

  return NS_OK;
}

Here is the call graph for this function:

nsresult nsXMLHttpRequest::CreateEvent ( nsEvent event,
nsIDOMEvent **  domevent 
) [protected]

Definition at line 805 of file nsXMLHttpRequest.cpp.

{
  nsresult rv;

  nsCOMPtr<nsIDOMEventReceiver> receiver(do_QueryInterface(mDocument));
  if (!receiver) {
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsIEventListenerManager> manager;
  rv = receiver->GetListenerManager(getter_AddRefs(manager));
  if (!manager) {
    return NS_ERROR_FAILURE;
  }

  rv = manager->CreateEvent(nsnull, aEvent,
                            NS_LITERAL_STRING("HTMLEvents"),
                            aDOMEvent);
  if (NS_FAILED(rv)) {
    return rv;
  }

  nsCOMPtr<nsIPrivateDOMEvent> privevent(do_QueryInterface(*aDOMEvent));
  if (!privevent) {
    NS_IF_RELEASE(*aDOMEvent);
    return NS_ERROR_FAILURE;
  }
  privevent->SetTarget(this);
  privevent->SetCurrentTarget(this);
  privevent->SetOriginalTarget(this);

  // We're not marking these events trusted as there is no way for us
  // to tell if we're called through the code that normally calls us
  // (i.e. necko) or if script on a webpage QI'd this object to say,
  // nsIProgressEventSink and called onProgress(...).
  //
  // privevent->SetTrusted(?);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsXMLHttpRequest::DetectCharset ( nsACString &  aCharset) [protected]

Definition at line 542 of file nsXMLHttpRequest.cpp.

{
  aCharset.Truncate();
  nsresult rv;
  nsCAutoString charsetVal;
  nsCOMPtr<nsIChannel> channel(do_QueryInterface(mReadRequest));
  if (!channel) {
    channel = mChannel;
    if (!channel) {
      // There will be no mChannel when we got a necko error in
      // OnStopRequest or if we were never sent.
      return NS_ERROR_NOT_AVAILABLE;
    }
  }

  rv = channel->GetContentCharset(charsetVal);
  if (NS_SUCCEEDED(rv)) {
    nsCOMPtr<nsICharsetAlias> calias(do_GetService(kCharsetAliasCID,&rv));
    if(NS_SUCCEEDED(rv) && calias) {
      rv = calias->GetPreferred(charsetVal, aCharset);
    }
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

boolean nsIDOMEventTarget::dispatchEvent ( in nsIDOMEvent  evt) raises (DOMException) [inherited]

This method allows the dispatch of events into the implementations event model.

Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

Parameters:
evtSpecifies the event type, behavior, and contextual information to be used in processing the event.
Returns:
Indicates whether any of the listeners which handled the event called preventDefault. If preventDefault was called the value is false, else the value is true.
Exceptions:
UNSPECIFIED_EVENT_TYPE_ERR,:Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as null or an empty string will also trigger this exception.
nsresult nsXMLHttpRequest::Error ( nsIDOMEvent aEvent) [virtual]

Processes an load error event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 1910 of file nsXMLHttpRequest.cpp.

{
  // We need to create the event before nulling out mDocument
  nsCOMPtr<nsIDOMEvent> event(do_QueryInterface(aEvent));
  // There is no NS_PAGE_ERROR event but NS_SCRIPT_ERROR should be ok.
  nsEvent evt(PR_TRUE, NS_SCRIPT_ERROR);
  if (!event) {
    CreateEvent(&evt, getter_AddRefs(event));
  }

  mDocument = nsnull;
  ChangeState(XML_HTTP_REQUEST_COMPLETED);

  mState &= ~XML_HTTP_REQUEST_SYNCLOOPING;

  nsCOMPtr<nsIDOMEventListener> onErrorListener = mOnErrorListener.Get();
  PRUint32 count = mErrorEventListeners.Length();
  nsCOMArray<nsIDOMEventListener> listenersCopy(count);
  for (PRUint32 i = 0; i < count; ++i)
    listenersCopy.ReplaceObjectAt(nsCOMPtr<nsIDOMEventListener>(mErrorEventListeners[i]->Get()), i);

  ClearEventListeners();
  
  NotifyEventListeners(onErrorListener, &listenersCopy, event);

  return NS_OK;
}

Here is the call graph for this function:

Returns all of the response headers as a string for HTTP requests.

Note that this will return all the headers from the current part of a multipart request, not from the original channel.

Returns:
A string containing all of the response headers. NULL if the response has not yet been received.

Definition at line 790 of file nsXMLHttpRequest.cpp.

{
  if (!mScriptContext) {
    return nsnull;
  }

  nsCOMPtr<nsIDocument> doc = GetDocumentFromScriptContext(mScriptContext);
  if (!doc) {
    return nsnull;
  }

  return doc->GetBaseURI();
}

Here is the call graph for this function:

Definition at line 918 of file nsXMLHttpRequest.cpp.

{
  nsIHttpChannel *httpChannel = nsnull;

  if (mReadRequest) {
    CallQueryInterface(mReadRequest, &httpChannel);
  }

  if (!httpChannel && mChannel) {
    CallQueryInterface(mChannel, &httpChannel);
  }

  return httpChannel;
}

Here is the call graph for this function:

void nsIInterfaceRequestor::getInterface ( in nsIIDRef  uuid,
[iid_is(uuid), retval] out nsQIResult  result 
) [inherited]

Retrieves the specified interface pointer.

Parameters:
uuidThe IID of the interface being requested.
result[out] The interface pointer to be filled in if the interface is accessible.
Returns:
NS_OK - interface was successfully returned. NS_NOINTERFACE - interface not accessible. NS_ERROR* - method failure.
nsresult nsXMLHttpRequest::GetLoadGroup ( nsILoadGroup **  aLoadGroup) [protected]

Definition at line 776 of file nsXMLHttpRequest.cpp.

{
  NS_ENSURE_ARG_POINTER(aLoadGroup);
  *aLoadGroup = nsnull;

  nsCOMPtr<nsIDocument> doc = GetDocumentFromScriptContext(mScriptContext);
  if (doc) {
    *aLoadGroup = doc->GetDocumentLoadGroup().get();  // already_AddRefed
  }

  return NS_OK;
}

Here is the call graph for this function:

ACString nsIXMLHttpRequest::getResponseHeader ( in AUTF8String  header) [inherited]

Returns the text of the header with the specified name for HTTP requests.

Parameters:
headerThe name of the header to retrieve
Returns:
A string containing the text of the header specified. NULL if the response has not yet been received or the header does not exist in the response.

Get a reference node for what is known to be a strongly connected component of nsIDOMGCParticipants.

For example, DOM trees are strongly connected, so can return the root node to greatly reduce the number of nodes on which we need to run graph algorithms.

Note that it's acceptable for nodes in a single strongly connected component to return different values for GetSCCIndex, as long as those two values claim that they're reachable from each other in AppendReachableList.

Implements nsIDOMGCParticipant.

Definition at line 2132 of file nsXMLHttpRequest.cpp.

{
  return this;
}
nsresult nsXMLHttpRequest::GetStreamForWString ( const PRUnichar aStr,
PRInt32  aLength,
nsIInputStream **  aStream 
) [protected]

Definition at line 1148 of file nsXMLHttpRequest.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIUnicodeEncoder> encoder;
  char* postData;

  // We want to encode the string as utf-8, so get the right encoder
  nsCOMPtr<nsICharsetConverterManager> charsetConv =
           do_GetService(kCharsetConverterManagerCID, &rv);
  NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);

  rv = charsetConv->GetUnicodeEncoderRaw("UTF-8",
                                         getter_AddRefs(encoder));
  NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);

  // Convert to utf-8
  PRInt32 charLength;
  const PRUnichar* unicodeBuf = aStr;
  PRInt32 unicodeLength = aLength;

  rv = encoder->GetMaxLength(unicodeBuf, unicodeLength, &charLength);
  if (NS_FAILED(rv)) return NS_ERROR_FAILURE;


  // Allocate extra space for the null-terminator
  postData = (char*)nsMemory::Alloc(charLength + 1);
  if (!postData) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  rv = encoder->Convert(unicodeBuf,
                        &unicodeLength, postData, &charLength);
  if (NS_FAILED(rv)) {
    nsMemory::Free(postData);
    return NS_ERROR_FAILURE;
  }

  nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(mChannel));
  if (!httpChannel) {
    nsMemory::Free(postData);
    return NS_ERROR_FAILURE;
  }

  // Null-terminate
  postData[charLength] = '\0';

  nsCOMPtr<nsIStringInputStream> inputStream(do_CreateInstance("@mozilla.org/io/string-input-stream;1", &rv));
  if (NS_SUCCEEDED(rv)) {
    rv = inputStream->AdoptData(postData, charLength);
    if (NS_SUCCEEDED(rv)) {
      return CallQueryInterface(inputStream, aStream);
    }
  }

  // If we got here then something went wrong before the stream
  // adopted the buffer.
  nsMemory::Free(postData);
  return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Parameters:
evtThe Event contains contextual information about the event. It also contains the stopPropagation and preventDefault methods which are used in determining the event's flow and default action.

Definition at line 227 of file nsXMLHttpRequest.cpp.

{
  // Set the original mScriptContext and mPrincipal, if available.
  // Get JSContext from stack.
  nsCOMPtr<nsIJSContextStack> stack =
    do_GetService("@mozilla.org/js/xpc/ContextStack;1");

  if (!stack) {
    return NS_OK;
  }

  JSContext *cx;

  if (NS_FAILED(stack->Peek(&cx)) || !cx) {
    return NS_OK;
  }

  nsIScriptContext* context = GetScriptContextFromJSContext(cx);
  if (!context) {
    return NS_OK;
  }
  nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager();
  nsCOMPtr<nsIPrincipal> subjectPrincipal;
  if (secMan) {
    secMan->GetSubjectPrincipal(getter_AddRefs(subjectPrincipal));
  }
  NS_ENSURE_STATE(subjectPrincipal);

  mScriptContext = context;
  mPrincipal = subjectPrincipal;
  nsCOMPtr<nsPIDOMWindow> window =
    do_QueryInterface(context->GetGlobalObject());
  if (window) {
    mOwner = do_GetWeakReference(window->GetCurrentInnerWindow());
  }

  return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsXMLHttpRequest::Initialize ( nsISupports *  aOwner,
JSContext cx,
JSObject obj,
PRUint32  argc,
jsval argv 
) [virtual]

Initialize a newly created native instance using the owner of the constructor and the parameters passed into the JavaScript constructor.

Implements nsIJSNativeInitializer_MOZILLA_1_8_BRANCH.

Definition at line 267 of file nsXMLHttpRequest.cpp.

{
  mOwner = do_GetWeakReference(aOwner);
  if (!mOwner) {
    NS_WARNING("Unexpected nsIJSNativeInitializer owner");
    return NS_OK;
  }

  // This XHR object is bound to a |window|,
  // so re-set principal and script context.
  nsCOMPtr<nsIScriptObjectPrincipal> scriptPrincipal = do_QueryInterface(aOwner);
  NS_ENSURE_STATE(scriptPrincipal);
  mPrincipal = scriptPrincipal->GetPrincipal();
  nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(aOwner);
  NS_ENSURE_STATE(sgo);
  mScriptContext = sgo->GetContext();
  NS_ENSURE_STATE(mScriptContext);
  return NS_OK; 
}

Here is the call graph for this function:

nsresult nsXMLHttpRequest::Load ( nsIDOMEvent aEvent) [virtual]

Processes a page or image load event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 1866 of file nsXMLHttpRequest.cpp.

{
  // If we had an XML error in the data, the parser terminated and
  // we received the load event, even though we might still be
  // loading data into responseBody/responseText. We will delay
  // sending the load event until OnStopRequest(). In normal case
  // there is no harm done, we will get OnStopRequest() immediately
  // after the load event.
  //
  // However, if the data we were loading caused the parser to stop,
  // for example when loading external stylesheets, we can receive
  // the OnStopRequest() call before the parser has finished building
  // the document. In that case, we obviously should not fire the event
  // in OnStopRequest(). For those documents, we must wait for the load
  // event from the document to fire our RequestCompleted().
  if (mState & XML_HTTP_REQUEST_STOPPED) {
    RequestCompleted();
  }
  return NS_OK;
}

Here is the call graph for this function:

Definition at line 847 of file nsXMLHttpRequest.cpp.

{
  if (!aEvent)
    return;

  nsCOMPtr<nsIJSContextStack> stack;
  JSContext *cx = nsnull;

  if (NS_FAILED(CheckInnerWindowCorrectness())) {
    return;
  }

  if (mScriptContext) {
    stack = do_GetService("@mozilla.org/js/xpc/ContextStack;1");

    if (stack) {
      cx = (JSContext *)mScriptContext->GetNativeContext();

      if (cx) {
        stack->Push(cx);
      }
    }
  }

  if (aHandler) {
    aHandler->HandleEvent(aEvent);
  }

  if (aListeners) {
    for (PRInt32 i = 0, i_end = aListeners->Count(); i < i_end; ++i) {
      nsIDOMEventListener *listener = aListeners->ObjectAt(i);
      if (listener) {
        listener->HandleEvent(aEvent);
      }
    }
  }

  if (cx) {
    stack->Pop(&cx);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIChannelEventSink::onChannelRedirect ( in nsIChannel  oldChannel,
in nsIChannel  newChannel,
in unsigned long  flags 
) [inherited]

Called when a redirect occurs.

This may happen due to an HTTP 3xx status code.

Parameters:
oldChannelThe channel that's being redirected.
newChannelThe new channel. This channel is not opened yet.
flagsFlags indicating the type of redirect. A bitmask consisting of flags from above. One of REDIRECT_TEMPORARY and REDIRECT_PERMANENT will always be set.
Exceptions:
<any>Throwing an exception will cancel the load. No network request for the new channel will be made.
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.

void nsIProgressEventSink::onProgress ( in nsIRequest  aRequest,
in nsISupports  aContext,
in unsigned long long  aProgress,
in unsigned long long  aProgressMax 
) [inherited]

Called to notify the event sink that progress has occurred for the given request.

Parameters:
aRequestthe request being observed (may QI to nsIChannel).
aContextif aRequest is a channel, then this parameter is the listener context passed to nsIChannel::asyncOpen.
aProgressnumeric value in the range 0 to aProgressMax indicating the number of bytes transfered thus far.
aProgressMaxnumeric value indicating maximum number of bytes that will be transfered (or 0xFFFFFFFFFFFFFFFF if total is unknown).
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 nsIProgressEventSink::onStatus ( in nsIRequest  aRequest,
in nsISupports  aContext,
in nsresult  aStatus,
in wstring  aStatusArg 
) [inherited]

Called to notify the event sink with a status message for the given request.

Parameters:
aRequestthe request being observed (may QI to nsIChannel).
aContextif aRequest is a channel, then this parameter is the listener context passed to nsIChannel::asyncOpen.
aStatusstatus code (not necessarily an error code) indicating the state of the channel (usually the state of the underlying transport). see nsISocketTransport for socket specific status codes.
aStatusArgstatus code argument to be used with the string bundle service to convert the status message into localized, human readable text. the meaning of this parameter is specific to the value of the status code. for socket status codes, this parameter indicates the host:port associated with the status code.
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:

void nsIXMLHttpRequest::open ( in AUTF8String  method,
in AUTF8String  url 
) [inherited]

Meant to be a script-only method for initializing a request.

The parameters are similar to the ones detailed in the description of openRequest, but the last 3 are optional.

Will abort currently active loads.

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Parameters:
methodThe HTTP method - either "POST" or "GET". Ignored if the URL is not a HTTP URL.
urlThe URL to which to send the request.
async(optional) Whether the request is synchronous or asynchronous i.e. whether send returns only after the response is received or if it returns immediately after sending the request. In the latter case, notification of completion is sent through the event listeners. The default value is true. This argument must be true if the multipart attribute has been set to true, or an exception will be thrown.
user(optional) A username for authentication if necessary. The default value is the empty string
password(optional) A password for authentication if necessary. The default value is the empty string
void nsIXMLHttpRequest::openRequest ( in AUTF8String  method,
in AUTF8String  url,
in boolean  async,
in AString  user,
in AString  password 
) [inherited]

Native (non-script) method to initialize a request.

Note that the request is not sent until the send method is invoked.

Will abort currently active loads.

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Parameters:
methodThe HTTP method, for example "POST" or "GET". Ignored if the URL is not a HTTP(S) URL.
urlThe URL to which to send the request.
asyncWhether the request is synchronous or asynchronous i.e. whether send returns only after the response is received or if it returns immediately after sending the request. In the latter case, notification of completion is sent through the event listeners. This argument must be true if the multipart attribute has been set to true, or an exception will be thrown.
userA username for authentication if necessary.
passwordA password for authentication if necessary.
void nsIXMLHttpRequest::overrideMimeType ( in AUTF8String  mimetype) [inherited]

Override the mime type returned by the server (if any).

This may be used, for example, to force a stream to be treated and parsed as text/xml, even if the server does not report it as such. This must be done before the send method is invoked.

Parameters:
mimetypeThe type used to override that returned by the server (if any).
void nsIDOMEventTarget::removeEventListener ( in DOMString  type,
in nsIDOMEventListener  listener,
in boolean  useCapture 
) [inherited]

This method allows the removal of event listeners from the event target.

If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.

Parameters:
typeSpecifies the event type of the EventListener being removed.
listenerThe EventListener parameter indicates the EventListener to be removed.
useCaptureSpecifies whether the EventListener being removed was registered as a capturing listener or not. If a listener was registered twice, one with capture and one without, each must be removed separately. Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.

Definition at line 1474 of file nsXMLHttpRequest.cpp.

{
  nsresult rv = NS_OK;

  mState &= ~XML_HTTP_REQUEST_SYNCLOOPING;

  // If we're uninitialized at this point, we encountered an error
  // earlier and listeners have already been notified. Also we do
  // not want to do this if we already completed.
  if (mState & (XML_HTTP_REQUEST_UNINITIALIZED |
                XML_HTTP_REQUEST_COMPLETED)) {
    return NS_OK;
  }

  // We need to create the event before nulling out mDocument
  nsEvent evt(PR_TRUE, NS_PAGE_LOAD);
  nsCOMPtr<nsIDOMEvent> domevent;
  rv = CreateEvent(&evt, getter_AddRefs(domevent));

  // We might have been sent non-XML data. If that was the case,
  // we should null out the document member. The idea in this
  // check here is that if there is no document element it is not
  // an XML document. We might need a fancier check...
  if (mDocument) {
    nsCOMPtr<nsIDOMElement> root;
    mDocument->GetDocumentElement(getter_AddRefs(root));
    if (!root) {
      mDocument = nsnull;
    }
  }

  // Grab hold of the event listener lists we will need
  nsCOMPtr<nsIDOMEventListener> onLoadListener = mOnLoadListener.Get();
  PRUint32 count = mLoadEventListeners.Length();
  nsCOMArray<nsIDOMEventListener> listenersCopy(count);
  for (PRUint32 i = 0; i < count; ++i)
    listenersCopy.ReplaceObjectAt(nsCOMPtr<nsIDOMEventListener>(mLoadEventListeners[i]->Get()), i);

  // Clear listeners here unless we're multipart
  ChangeState(XML_HTTP_REQUEST_COMPLETED, PR_TRUE,
              !(mState & XML_HTTP_REQUEST_MULTIPART));

  NotifyEventListeners(onLoadListener, &listenersCopy, domevent);

  if (mState & XML_HTTP_REQUEST_MULTIPART) {
    // We're a multipart request, so we're not done. Reset to opened.
    ChangeState(XML_HTTP_REQUEST_OPENED);
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIXMLHttpRequest::send ( in nsIVariant  body) [inherited]

Sends the request.

If the request is asynchronous, returns immediately after sending the request. If it is synchronous returns only after the response has been received.

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Parameters:
bodyEither an instance of nsIDOMDocument, nsIInputStream or a string (nsISupportsString in the native calling case). This is used to populate the body of the HTTP request if the HTTP request method is "POST". If the parameter is a nsIDOMDocument, it is serialized. If the parameter is a nsIInputStream, then it must be compatible with nsIUploadChannel.setUploadStream, and a Content-Length header will be added to the HTTP request with a value given by nsIInputStream.available. Any headers included at the top of the stream will be treated as part of the message body. The MIME type of the stream should be specified by setting the Content- Type header via the setRequestHeader method before calling send.
void nsIXMLHttpRequest::setRequestHeader ( in AUTF8String  header,
in AUTF8String  value 
) [inherited]

Sets a HTTP request header for HTTP requests.

You must call open before setting the request headers.

Parameters:
headerThe name of the header to set in the request.
valueThe body of the header.
NS_METHOD nsXMLHttpRequest::StreamReaderFunc ( nsIInputStream in,
void closure,
const char *  fromRawSegment,
PRUint32  toOffset,
PRUint32  count,
PRUint32 writeCount 
) [static, protected]

Definition at line 1214 of file nsXMLHttpRequest.cpp.

{
  nsXMLHttpRequest* xmlHttpRequest = NS_STATIC_CAST(nsXMLHttpRequest*, closure);
  if (!xmlHttpRequest || !writeCount) {
    NS_WARNING("XMLHttpRequest cannot read from stream: no closure or writeCount");
    return NS_ERROR_FAILURE;
  }

  // Copy for our own use
  xmlHttpRequest->mResponseBody.Append(fromRawSegment,count);

  nsresult rv = NS_OK;

  if (xmlHttpRequest->mState & XML_HTTP_REQUEST_PARSEBODY) {
    // Give the same data to the parser.

    // We need to wrap the data in a new lightweight stream and pass that
    // to the parser, because calling ReadSegments() recursively on the same
    // stream is not supported.
    nsCOMPtr<nsIInputStream> copyStream;
    rv = NS_NewByteInputStream(getter_AddRefs(copyStream), fromRawSegment, count);

    if (NS_SUCCEEDED(rv)) {
      NS_ASSERTION(copyStream, "NS_NewByteInputStream lied");
      nsresult parsingResult = xmlHttpRequest->mXMLParserStreamListener
                                  ->OnDataAvailable(xmlHttpRequest->mReadRequest,
                                                    xmlHttpRequest->mContext,
                                                    copyStream, toOffset, count);

      // No use to continue parsing if we failed here, but we
      // should still finish reading the stream
      if (NS_FAILED(parsingResult)) {
        xmlHttpRequest->mState &= ~XML_HTTP_REQUEST_PARSEBODY;
      }
    }
  }

  xmlHttpRequest->ChangeState(XML_HTTP_REQUEST_INTERACTIVE);

  if (NS_SUCCEEDED(rv)) {
    *writeCount = count;
  } else {
    *writeCount = 0;
  }

  return rv;
}

Here is the call graph for this function:

Processes a page unload event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMLoadListener.

Definition at line 1888 of file nsXMLHttpRequest.cpp.

{
  return NS_OK;
}

Member Data Documentation

The request uses a channel in order to perform the request.

This attribute represents the channel used for the request. NULL if the channel has not yet been created.

In a multipart request case, this is the initial channel, not the different parts in the multipart request.

Mozilla only. Requires elevated privileges to access.

Definition at line 95 of file nsIXMLHttpRequest.idl.

Definition at line 181 of file nsXMLHttpRequest.h.

Sink interfaces that we implement that mNotificationCallbacks may want to also be notified for.

These are inited lazily if we're asked for the relevant interface.

Definition at line 225 of file nsXMLHttpRequest.h.

nsCOMPtr<nsISupports> nsXMLHttpRequest::mContext [protected]

Definition at line 179 of file nsXMLHttpRequest.h.

Definition at line 183 of file nsXMLHttpRequest.h.

Definition at line 186 of file nsXMLHttpRequest.h.

Definition at line 197 of file nsXMLHttpRequest.h.

Definition at line 185 of file nsXMLHttpRequest.h.

The notification callbacks the channel had when Send() was called.

We want to forward things here as needed.

Definition at line 219 of file nsXMLHttpRequest.h.

Definition at line 191 of file nsXMLHttpRequest.h.

Definition at line 190 of file nsXMLHttpRequest.h.

Definition at line 192 of file nsXMLHttpRequest.h.

Definition at line 194 of file nsXMLHttpRequest.h.

Definition at line 213 of file nsXMLHttpRequest.h.

Definition at line 188 of file nsXMLHttpRequest.h.

Definition at line 180 of file nsXMLHttpRequest.h.

Definition at line 226 of file nsXMLHttpRequest.h.

Definition at line 182 of file nsXMLHttpRequest.h.

Definition at line 211 of file nsXMLHttpRequest.h.

Definition at line 187 of file nsXMLHttpRequest.h.

Definition at line 228 of file nsXMLHttpRequest.h.

Set to true if the response is expected to be a stream of possibly multiple (XML) documents.

If set to true, the content type of the initial response must be multipart/x-mixed-replace or an error will be triggerd. All requests must be asynchronous.

This enables server push. For each XML document that's written to this request, a new XML DOM document is created and the onload handler is called inbetween documents. Note that when this is set, the onload handler and other event handlers are not reset after the first XML document is loaded, and the onload handler will be called as each part of the response is received.

Definition at line 283 of file nsIXMLHttpRequest.idl.

Definition at line 196 of file nsXMLHttpRequest.h.

Meant to be a script-only mechanism for setting an error event listener.

The attribute is expected to be JavaScript function object. When the error event occurs, the function is invoked. This attribute should not be used from native code!!

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Mozilla only.

Definition at line 322 of file nsIXMLHttpRequest.idl.

Meant to be a script-only mechanism for setting a load event listener.

The attribute is expected to be JavaScript function object. When the load event occurs, the function is invoked. This attribute should not be used from native code!!

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Mozilla only.

Definition at line 309 of file nsIXMLHttpRequest.idl.

Meant to be a script-only mechanism for setting a progress event listener.

The attribute is expected to be JavaScript function object. When the error event occurs, the function is invoked. This attribute should not be used from native code!! This event listener may be called multiple times during the open request.

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Mozilla only.

Definition at line 336 of file nsIXMLHttpRequest.idl.

Meant to be a script-only mechanism for setting a callback function.

The attribute is expected to be JavaScript function object. When the readyState changes, the callback function will be called. This attribute should not be used from native code!!

After the initial response, all event listeners will be cleared. Call open() before setting new event listeners.

Definition at line 347 of file nsIXMLHttpRequest.idl.

The state of the request.

Possible values: 0 UNINITIALIZED open() has not been called yet. 1 LOADING send() has not been called yet. 2 LOADED send() has been called, headers and status are available. 3 INTERACTIVE Downloading, responseText holds the partial data. 4 COMPLETED Finished with all operations.

Definition at line 257 of file nsIXMLHttpRequest.idl.

const unsigned long nsIChannelEventSink::REDIRECT_INTERNAL = 1 << 2 [inherited]

This is an internal redirect, i.e.

it was not initiated by the remote server, but is specific to the channel implementation.

The new URI may be identical to the old one.

Definition at line 81 of file nsIChannelEventSink.idl.

const unsigned long nsIChannelEventSink::REDIRECT_PERMANENT = 1 << 1 [inherited]

This is a permanent redirect.

New requests for this resource should use the URI of the new channel (This might be an HTTP 301 reponse). If this flag is not set, this is a temporary redirect.

The new URI may be identical to the old one.

Definition at line 73 of file nsIChannelEventSink.idl.

const unsigned long nsIChannelEventSink::REDIRECT_TEMPORARY = 1 << 0 [inherited]

This is a temporary redirect.

New requests for this resource should continue to use the URI of the old channel.

The new URI may be identical to the old one.

Definition at line 64 of file nsIChannelEventSink.idl.

readonly attribute AString nsIXMLHttpRequest::responseText [inherited]

The response to the request as text.

NULL if the request is unsuccessful or has not yet been sent.

Definition at line 110 of file nsIXMLHttpRequest.idl.

The response to the request is parsed as if it were a text/xml stream.

This attributes represents the response as a DOM Document object. NULL if the request is unsuccessful or has not yet been sent.

Definition at line 103 of file nsIXMLHttpRequest.idl.

readonly attribute unsigned long nsIXMLHttpRequest::status [inherited]

The status of the response to the request for HTTP requests.

Definition at line 116 of file nsIXMLHttpRequest.idl.

readonly attribute AUTF8String nsIXMLHttpRequest::statusText [inherited]

The string representing the status of the response for HTTP requests.

Definition at line 122 of file nsIXMLHttpRequest.idl.


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