Back to index

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

#include <nsViewSourceChannel.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIREQUEST
NS_DECL_NSICHANNEL
NS_DECL_NSIVIEWSOURCECHANNEL
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSIHTTPCHANNEL 
nsViewSourceChannel ()
 NS_HIDDEN_ (nsresult) Init(nsIURI *uri)
nsIInputStream open ()
 Synchronously open the channel.
void asyncOpen (in nsIStreamListener aListener, in nsISupports aContext)
 Asynchronously open this channel.
boolean isPending ()
 Indicates whether the request is pending.
void cancel (in nsresult aStatus)
 Cancels the current request.
void suspend ()
 Suspends the current request.
void resume ()
 Resumes the current request.
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.
ACString getRequestHeader (in ACString aHeader)
 Get the value of a particular request header.
void setRequestHeader (in ACString aHeader, in ACString aValue, in boolean aMerge)
 Set the value of a particular request header.
void visitRequestHeaders (in nsIHttpHeaderVisitor aVisitor)
 Call this method to visit all request headers.
ACString getResponseHeader (in ACString header)
 Get the value of a particular response header.
void setResponseHeader (in ACString header, in ACString value, in boolean merge)
 Set the value of a particular response header.
void visitResponseHeaders (in nsIHttpHeaderVisitor aVisitor)
 Call this method to visit all response headers.
boolean isNoStoreResponse ()
 Returns true if the server sent a "Cache-Control: no-store" response header.
boolean isNoCacheResponse ()
 Returns true if the server sent the equivalent of a "Cache-control: no-cache" response header.
boolean isFromCache ()
 TRUE if this channel's data is being loaded from the cache.
void setUploadStream (in nsIInputStream aStream, in ACString aContentType, in long aContentLength)
 Sets a stream to be uploaded by this channel.

Public Attributes

attribute ACString originalContentType
 The actual (MIME) content type of the data.
attribute nsIURI originalURI
 The original URI used to construct the channel.
readonly attribute nsIURI URI
 The URI corresponding to the channel.
attribute nsISupports owner
 The owner, corresponding to the entity that is responsible for this channel.
attribute nsIInterfaceRequestor notificationCallbacks
 The notification callbacks for the channel.
readonly attribute nsISupports securityInfo
 Transport-level security information (if any) corresponding to the channel.
attribute ACString contentType
 The MIME type of the channel's content if available.
attribute ACString contentCharset
 The character set of the channel's content if available and if applicable.
attribute long contentLength
 The length of the data associated with the channel if available.
const unsigned long LOAD_DOCUMENT_URI = 1 << 16
 Set (e.g., by the docshell) to indicate whether or not the channel corresponds to a document URI.
const unsigned long LOAD_RETARGETED_DOCUMENT_URI = 1 << 17
 If the end consumer for this load has been retargeted after discovering it's content, this flag will be set:
const unsigned long LOAD_REPLACE = 1 << 18
 This flag is set to indicate that onStopRequest may be followed by another onStartRequest/onStopRequest pair.
const unsigned long LOAD_INITIAL_DOCUMENT_URI = 1 << 19
 Set (e.g., by the docshell) to indicate whether or not the channel corresponds to an initial document URI load (e.g., link click).
const unsigned long LOAD_TARGETED = 1 << 20
 Set (e.g., by the URILoader) to indicate whether or not the end consumer for this load has been determined.
const unsigned long LOAD_CALL_CONTENT_SNIFFERS = 1 << 21
 If this flag is set, the channel should call the content sniffers as described in nsNetCID.h about NS_CONTENT_SNIFFER_CATEGORY.
readonly attribute AUTF8String name
 The name of the request.
readonly attribute nsresult status
 The error status associated with the request.
attribute nsILoadGroup loadGroup
 The load group of this request.
attribute nsLoadFlags loadFlags
 The load flags of this request.
const unsigned long LOAD_NORMAL = 0
 No special load flags:
const unsigned long LOAD_BACKGROUND = 1 << 0
 Don't deliver status notifications to the nsIProgressEventSink, or keep this load from completing the nsILoadGroup it may belong to.
const unsigned long INHIBIT_CACHING = 1 << 7
 This flag prevents caching of any kind.
const unsigned long INHIBIT_PERSISTENT_CACHING = 1 << 8
 This flag prevents caching on disk (or other persistent media), which may be needed to preserve privacy.
const unsigned long LOAD_BYPASS_CACHE = 1 << 9
 Force an end-to-end download of content data from the origin server.
const unsigned long LOAD_FROM_CACHE = 1 << 10
 Load from the cache, bypassing protocol specific validation logic.
const unsigned long VALIDATE_ALWAYS = 1 << 11
 The following flags control the frequency of cached content validation when neither LOAD_BYPASS_CACHE or LOAD_FROM_CACHE are set.
const unsigned long VALIDATE_NEVER = 1 << 12
const unsigned long VALIDATE_ONCE_PER_SESSION = 1 << 13
attribute ACString requestMethod
 Set/get the HTTP request method (default is "GET").
attribute nsIURI referrer
 Get/set the HTTP referrer URI.
attribute boolean allowPipelining
 This attribute is a hint to the channel to indicate whether or not the underlying HTTP transaction should be allowed to be pipelined with other transactions.
attribute unsigned long redirectionLimit
 This attribute specifies the number of redirects this channel is allowed to make.
readonly attribute unsigned long responseStatus
 Get the HTTP response code (e.g., 200).
readonly attribute ACString responseStatusText
 Get the HTTP response status text (e.g., "OK").
readonly attribute boolean requestSucceeded
 Returns true if the HTTP response code indicates success.
attribute nsISupports cacheToken
 Set/get the cache token...
attribute nsISupports cacheKey
 Set/get the cache key...
attribute boolean cacheAsFile
 Specifies whether or not the data should be cached to a file.
readonly attribute nsIFile cacheFile
 Get the "file" where the cached data can be found.
const unsigned long LOAD_BYPASS_LOCAL_CACHE = 1 << 28
 This load flag causes the local cache to be skipped when fetching a request.
const unsigned long LOAD_BYPASS_LOCAL_CACHE_IF_BUSY = 1 << 29
 This load flag causes the local cache to be skipped if the request would otherwise block waiting to access the cache.
const unsigned long LOAD_ONLY_FROM_CACHE = 1 << 30
 This load flag inhibits fetching from the net if the data in the cache has been evicted.
const unsigned long LOAD_ONLY_IF_MODIFIED = 1 << 31
 This load flag controls what happens when a document would be loaded from the cache to satisfy a call to AsyncOpen.
readonly attribute nsIInputStream uploadStream
 Get the stream (to be) uploaded by this channel.

Protected Attributes

nsCOMPtr< nsIChannelmChannel
nsCOMPtr< nsIHttpChannelmHttpChannel
nsCOMPtr< nsICachingChannelmCachingChannel
nsCOMPtr< nsIUploadChannelmUploadChannel
nsCOMPtr< nsIStreamListenermListener
nsCOMPtr< nsIURImOriginalURI
nsCString mContentType
PRBool mIsDocument
PRBool mOpened

Detailed Description

Definition at line 54 of file nsViewSourceChannel.h.


Constructor & Destructor Documentation

NS_DECL_ISUPPORTS NS_DECL_NSIREQUEST NS_DECL_NSICHANNEL NS_DECL_NSIVIEWSOURCECHANNEL NS_DECL_NSISTREAMLISTENER NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSIHTTPCHANNEL nsViewSourceChannel::nsViewSourceChannel ( ) [inline]

Definition at line 73 of file nsViewSourceChannel.h.


Member Function Documentation

void nsIChannel::asyncOpen ( in nsIStreamListener  aListener,
in nsISupports  aContext 
) [inherited]

Asynchronously open this channel.

Data is fed to the specified stream listener as it becomes available. The stream listener's methods are called on the thread that calls asyncOpen and are not called until after asyncOpen returns.

Parameters:
aListenerthe nsIStreamListener implementation
aContextan opaque parameter forwarded to aListener's methods
void nsIRequest::cancel ( in nsresult  aStatus) [inherited]

Cancels the current request.

This will close any open input or output streams and terminate any async requests. Users should normally pass NS_BINDING_ABORTED, although other errors may also be passed. The error passed in will become the value of the status attribute.

Parameters:
aStatusthe reason for canceling this request.

NOTE: most nsIRequest implementations expect aStatus to be a failure code; however, some implementations may allow aStatus to be a success code such as NS_OK. In general, aStatus should be a failure code.

ACString nsIHttpChannel::getRequestHeader ( in ACString  aHeader) [inherited]

Get the value of a particular request header.

Parameters:
aHeaderThe case-insensitive name of the request header to query (e.g., "Cache-Control").
Returns:
the value of the request header.
Exceptions:
NS_ERROR_NOT_AVAILABLEif the header is not set.
ACString nsIHttpChannel::getResponseHeader ( in ACString  header) [inherited]

Get the value of a particular response header.

Parameters:
aHeaderThe case-insensitive name of the response header to query (e.g., "Set-Cookie").
Returns:
the value of the response header.
Exceptions:
NS_ERROR_NOT_AVAILABLEif called before the response has been received (before onStartRequest) or if the header is not set in the response.

TRUE if this channel's data is being loaded from the cache.

This value is undefined before the channel fires its OnStartRequest notification and after the channel fires its OnStopRequest notification.

Returns true if the server sent the equivalent of a "Cache-control: no-cache" response header.

Equivalent response headers include: "Pragma: no-cache", "Expires: 0", and "Expires" with a date value in the past relative to the value of the "Date" header.

Exceptions:
NS_ERROR_NOT_AVAILABLEif called before the response has been received (before onStartRequest).

Returns true if the server sent a "Cache-Control: no-store" response header.

Exceptions:
NS_ERROR_NOT_AVAILABLEif called before the response has been received (before onStartRequest).
boolean nsIRequest::isPending ( ) [inherited]

Indicates whether the request is pending.

nsIRequest::isPending is true when there is an outstanding asynchronous event that will make the request no longer be pending. Requests do not necessarily start out pending; in some cases, requests have to be explicitly initiated (e.g. nsIChannel implementations are only pending once asyncOpen returns successfully).

Requests can become pending multiple times during their lifetime.

Returns:
TRUE if the request has yet to reach completion.
FALSE if the request has reached completion (e.g., after OnStopRequest has fired).
Note:
Suspended requests are still considered pending.
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 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:

Synchronously open the channel.

Returns:
blocking input stream to the channel's data.

NOTE: nsIChannel implementations are not required to implement this method. Moreover, since this method may block the calling thread, it should not be called on a thread that processes UI events.

void nsIRequest::resume ( ) [inherited]

Resumes the current request.

This may have the effect of re-opening any underlying transport and will resume the delivery of data to any open streams.

void nsIHttpChannel::setRequestHeader ( in ACString  aHeader,
in ACString  aValue,
in boolean  aMerge 
) [inherited]

Set the value of a particular request header.

This method allows, for example, the cookies module to add "Cookie" headers to the outgoing HTTP request.

This method may only be called before the channel is opened.

Parameters:
aHeaderThe case-insensitive name of the request header to set (e.g., "Cookie").
aValueThe request header value to set (e.g., "X=1").
aMergeIf true, the new header value will be merged with any existing values for the specified header. This flag is ignored if the specified header does not support merging (e.g., the "Content- Type" header can only have one value). The list of headers for which this flag is ignored is an implementation detail. If this flag is false, then the header value will be replaced with the contents of |aValue|.

If aValue is empty and aMerge is false, the header will be cleared.

Exceptions:
NS_ERROR_IN_PROGRESSif called after the channel has been opened.
void nsIHttpChannel::setResponseHeader ( in ACString  header,
in ACString  value,
in boolean  merge 
) [inherited]

Set the value of a particular response header.

This method allows, for example, the HTML content sink to inform the HTTP channel about HTTP-EQUIV headers found in HTML <META> tags.

Parameters:
aHeaderThe case-insensitive name of the response header to set (e.g., "Cache-control").
aValueThe response header value to set (e.g., "no-cache").
aMergeIf true, the new header value will be merged with any existing values for the specified header. This flag is ignored if the specified header does not support merging (e.g., the "Content- Type" header can only have one value). The list of headers for which this flag is ignored is an implementation detail. If this flag is false, then the header value will be replaced with the contents of |aValue|.

If aValue is empty and aMerge is false, the header will be cleared.

Exceptions:
NS_ERROR_NOT_AVAILABLEif called before the response has been received (before onStartRequest).
NS_ERROR_ILLEGAL_VALUEif changing the value of this response header is not allowed.
void nsIUploadChannel::setUploadStream ( in nsIInputStream  aStream,
in ACString  aContentType,
in long  aContentLength 
) [inherited]

Sets a stream to be uploaded by this channel.

Most implementations of this interface require that the stream: (1) implement threadsafe addRef and release (2) implement nsIInputStream::readSegments (3) implement nsISeekableStream::seek

History here is that we need to support both streams that already have headers (e.g., Content-Type and Content-Length) information prepended to the stream (by plugins) as well as clients (composer, uploading application) that want to upload data streams without any knowledge of protocol specifications. For this reason, we have a special meaning for the aContentType parameter (see below).

Parameters:
aStreamThe stream to be uploaded by this channel.
aContentTypeIf aContentType is empty, the protocol will assume that no content headers are to be added to the uploaded stream and that any required headers are already encoded in the stream. In the case of HTTP, if this parameter is non-empty, then its value will replace any existing Content-Type header on the HTTP request. In the case of FTP and FILE, this parameter is ignored.
aContentLengthA value of -1 indicates that the length of the stream should be determined by calling the stream's |available| method.
void nsIRequest::suspend ( ) [inherited]

Suspends the current request.

This may have the effect of closing any underlying transport (in order to free up resources), although any open streams remain logically opened and will continue delivering data when the transport is resumed.

NOTE: some implementations are unable to immediately suspend, and may continue to deliver events already posted to an event queue. In general, callers should be capable of handling events even after suspending a request.

Call this method to visit all request headers.

Calling setRequestHeader while visiting request headers has undefined behavior. Don't do it!

Parameters:
aVisitorthe header visitor instance.

Call this method to visit all response headers.

Calling setResponseHeader while visiting response headers has undefined behavior. Don't do it!

Parameters:
aVisitorthe header visitor instance.
Exceptions:
NS_ERROR_NOT_AVAILABLEif called before the response has been received (before onStartRequest).

Member Data Documentation

This attribute is a hint to the channel to indicate whether or not the underlying HTTP transaction should be allowed to be pipelined with other transactions.

This should be set to FALSE, for example, if the application knows that the corresponding document is likely to be very large.

This attribute is true by default, though other factors may prevent pipelining.

This attribute may only be set before the channel is opened.

Exceptions:
NS_ERROR_FAILUREif set after the channel has been opened.

Definition at line 160 of file nsIHttpChannel.idl.

Specifies whether or not the data should be cached to a file.

This may fail if the disk cache is not present. The value of this attribute is usually only settable during the processing of a channel's OnStartRequest. The default value of this attribute depends on the particular implementation of nsICachingChannel.

Definition at line 98 of file nsICachingChannel.idl.

Get the "file" where the cached data can be found.

This is valid for as long as a reference to the cache token is held. This may return an error if cacheAsFile is false.

Definition at line 105 of file nsICachingChannel.idl.

attribute nsISupports nsICachingChannel::cacheKey [inherited]

Set/get the cache key...

uniquely identifies the data in the cache for this channel. Holding a reference to this key does NOT prevent the cached data from being removed.

A cache key retrieved from a particular instance of nsICachingChannel could be set on another instance of nsICachingChannel provided the underlying implementations are compatible and provided the new channel instance was created with the same URI. The implementation of nsICachingChannel would be expected to use the cache entry identified by the cache token. Depending on the value of nsIRequest::loadFlags, the cache entry may be validated, overwritten, or simply read.

The cache key may be NULL indicating that the URI of the channel is sufficient to locate the same cache entry. Setting a NULL cache key is likewise valid.

Definition at line 89 of file nsICachingChannel.idl.

attribute nsISupports nsICachingChannel::cacheToken [inherited]

Set/get the cache token...

uniquely identifies the data in the cache. Holding a reference to this token prevents the cached data from being removed.

A cache token retrieved from a particular instance of nsICachingChannel could be set on another instance of nsICachingChannel provided the underlying implementations are compatible. The implementation of nsICachingChannel would be expected to only read from the cache entry identified by the cache token and not try to validate it.

The cache token can be QI'd to a nsICacheEntryInfo if more detail about the cache entry is needed (e.g., expiration time).

Definition at line 70 of file nsICachingChannel.idl.

attribute ACString nsIChannel::contentCharset [inherited]

The character set of the channel's content if available and if applicable.

This attribute only applies to textual data.

The value of the contentCharset attribute is a mixedcase string.

Definition at line 148 of file nsIChannel.idl.

The length of the data associated with the channel if available.

A value of -1 indicates that the content length is unknown.

Callers should prefer getting the "content-length" property as 64-bit value by QIing the channel to nsIPropertyBag2, if that interface is exposed by the channel.

Definition at line 158 of file nsIChannel.idl.

attribute ACString nsIChannel::contentType [inherited]

The MIME type of the channel's content if available.

NOTE: the content type can often be wrongly specified (e.g., wrong file extension, wrong MIME type, wrong document type stored on a server, etc.), and the caller most likely wants to verify with the actual data.

Setting contentType before the channel has been opened provides a hint to the channel as to what the MIME type is. The channel may ignore this hint in deciding on the actual MIME type that it will report.

Setting contentType after onStartRequest has been fired or after open() is called will override the type determined by the channel.

Setting contentType between the time that asyncOpen() is called and the time when onStartRequest is fired has undefined behavior at this time.

The value of the contentType attribute is a lowercase string. A value assigned to this attribute will be parsed and normalized as follows: 1- any parameters (delimited with a ';') will be stripped. 2- if a charset parameter is given, then its value will replace the the contentCharset attribute of the channel. 3- the stripped contentType will be lowercased. Any implementation of nsIChannel must follow these rules.

Definition at line 140 of file nsIChannel.idl.

const unsigned long nsIRequest::INHIBIT_CACHING = 1 << 7 [inherited]

This flag prevents caching of any kind.

It does not, however, prevent cached content from being used to satisfy this request.

Definition at line 153 of file nsIRequest.idl.

const unsigned long nsIRequest::INHIBIT_PERSISTENT_CACHING = 1 << 8 [inherited]

This flag prevents caching on disk (or other persistent media), which may be needed to preserve privacy.

For HTTPS, this flag is set auto- matically.

Definition at line 160 of file nsIRequest.idl.

const unsigned long nsIRequest::LOAD_BACKGROUND = 1 << 0 [inherited]

Don't deliver status notifications to the nsIProgressEventSink, or keep this load from completing the nsILoadGroup it may belong to.

Definition at line 143 of file nsIRequest.idl.

const unsigned long nsIRequest::LOAD_BYPASS_CACHE = 1 << 9 [inherited]

Force an end-to-end download of content data from the origin server.

This flag is used for a shift-reload.

Definition at line 172 of file nsIRequest.idl.

const unsigned long nsICachingChannel::LOAD_BYPASS_LOCAL_CACHE = 1 << 28 [inherited]

This load flag causes the local cache to be skipped when fetching a request.

Unlike LOAD_BYPASS_CACHE, it does not force an end-to-end load (i.e., it does not affect proxy caches).

Definition at line 123 of file nsICachingChannel.idl.

This load flag causes the local cache to be skipped if the request would otherwise block waiting to access the cache.

Definition at line 129 of file nsICachingChannel.idl.

const unsigned long nsIChannel::LOAD_CALL_CONTENT_SNIFFERS = 1 << 21 [inherited]

If this flag is set, the channel should call the content sniffers as described in nsNetCID.h about NS_CONTENT_SNIFFER_CATEGORY.

Note: Channels may ignore this flag; however, new channel implementations should only do so with good reason.

Definition at line 227 of file nsIChannel.idl.

const unsigned long nsIChannel::LOAD_DOCUMENT_URI = 1 << 16 [inherited]

Set (e.g., by the docshell) to indicate whether or not the channel corresponds to a document URI.

Definition at line 193 of file nsIChannel.idl.

const unsigned long nsIRequest::LOAD_FROM_CACHE = 1 << 10 [inherited]

Load from the cache, bypassing protocol specific validation logic.

This flag is used when browsing via history. It is not recommended for normal browsing as it may likely violate reasonable assumptions made by the server and confuse users.

Definition at line 180 of file nsIRequest.idl.

const unsigned long nsIChannel::LOAD_INITIAL_DOCUMENT_URI = 1 << 19 [inherited]

Set (e.g., by the docshell) to indicate whether or not the channel corresponds to an initial document URI load (e.g., link click).

Definition at line 212 of file nsIChannel.idl.

const unsigned long nsIRequest::LOAD_NORMAL = 0 [inherited]

No special load flags:

Definition at line 137 of file nsIRequest.idl.

const unsigned long nsICachingChannel::LOAD_ONLY_FROM_CACHE = 1 << 30 [inherited]

This load flag inhibits fetching from the net if the data in the cache has been evicted.

An error of NS_ERROR_DOCUMENT_NOT_CACHED will be sent to the listener's onStopRequest in this case.

Definition at line 136 of file nsICachingChannel.idl.

const unsigned long nsICachingChannel::LOAD_ONLY_IF_MODIFIED = 1 << 31 [inherited]

This load flag controls what happens when a document would be loaded from the cache to satisfy a call to AsyncOpen.

If this attribute is set to TRUE, then the document will not be loaded from the cache. A stream listener can check nsICachingChannel::isFromCache to determine if the AsyncOpen will actually result in data being streamed.

If this flag has been set, and the request can be satisfied via the cache, then the OnDataAvailable events will be skipped. The listener will only see OnStartRequest followed by OnStopRequest.

Definition at line 149 of file nsICachingChannel.idl.

const unsigned long nsIChannel::LOAD_REPLACE = 1 << 18 [inherited]

This flag is set to indicate that onStopRequest may be followed by another onStartRequest/onStopRequest pair.

This flag is, for example, used by the multipart/replace stream converter.

Definition at line 206 of file nsIChannel.idl.

const unsigned long nsIChannel::LOAD_RETARGETED_DOCUMENT_URI = 1 << 17 [inherited]

If the end consumer for this load has been retargeted after discovering it's content, this flag will be set:

Definition at line 199 of file nsIChannel.idl.

const unsigned long nsIChannel::LOAD_TARGETED = 1 << 20 [inherited]

Set (e.g., by the URILoader) to indicate whether or not the end consumer for this load has been determined.

Definition at line 218 of file nsIChannel.idl.

The load flags of this request.

Bits 0-15 are reserved.

When added to a load group, this request's load flags are merged with the load flags of the load group.

Definition at line 128 of file nsIRequest.idl.

The load group of this request.

While pending, the request is a member of the load group. It is the responsibility of the request to implement this policy.

Definition at line 120 of file nsIRequest.idl.

Definition at line 82 of file nsViewSourceChannel.h.

Definition at line 80 of file nsViewSourceChannel.h.

Definition at line 86 of file nsViewSourceChannel.h.

Definition at line 81 of file nsViewSourceChannel.h.

Definition at line 87 of file nsViewSourceChannel.h.

Definition at line 84 of file nsViewSourceChannel.h.

Definition at line 88 of file nsViewSourceChannel.h.

Definition at line 85 of file nsViewSourceChannel.h.

Definition at line 83 of file nsViewSourceChannel.h.

readonly attribute AUTF8String nsIRequest::name [inherited]

The name of the request.

Often this is the URI of the request.

Definition at line 55 of file nsIRequest.idl.

The notification callbacks for the channel.

This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications. If this value is NULL, the channel implementation may use the notification callbacks from its load group. The channel may also query the notification callbacks from its load group if its notification callbacks do not supply the requested interface.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

When the channel is done, it must not continue holding references to this object.

NOTE: A channel implementation should take care when "caching" an interface pointer queried from its notification callbacks. If the notification callbacks are changed, then a cached interface pointer may become invalid and may therefore need to be re-queried.

Definition at line 108 of file nsIChannel.idl.

The actual (MIME) content type of the data.

nsIViewSourceChannel returns a content type of "application/x-view-source" if you ask it for the contentType attribute.

However, callers interested in finding out or setting the actual content type can utilize this attribute.

Definition at line 54 of file nsIViewSourceChannel.idl.

The original URI used to construct the channel.

This is used in the case of a redirect or URI "resolution" (e.g. resolving a resource: URI to a file: URI) so that the original pre-redirect URI can still be obtained.

NOTE: this is distinctly different from the http Referer (referring URI), which is typically the page that contained the original URI (accessible from nsIHttpChannel).

Definition at line 71 of file nsIChannel.idl.

attribute nsISupports nsIChannel::owner [inherited]

The owner, corresponding to the entity that is responsible for this channel.

Used by the security manager to grant or deny privileges to mobile code loaded from this channel.

NOTE: this is a strong reference to the owner, so if the owner is also holding a strong reference to the channel, care must be taken to explicitly drop its reference to the channel.

Definition at line 87 of file nsIChannel.idl.

This attribute specifies the number of redirects this channel is allowed to make.

If zero, the channel will fail to redirect and will generate a NS_ERROR_REDIRECT_LOOP failure status.

NOTE: An HTTP redirect results in a new channel being created. If the new channel supports nsIHttpChannel, then it will be assigned a value to its |redirectionLimit| attribute one less than the value of the redirected channel's |redirectionLimit| attribute. The initial value for this attribute may be a configurable preference (depending on the implementation).

Definition at line 174 of file nsIHttpChannel.idl.

Get/set the HTTP referrer URI.

This is the address (URI) of the resource from which this channel's URI was obtained (see RFC2616 section 14.36).

This attribute may only be set before the channel is opened.

NOTE: The channel may silently refuse to set the Referer header if the URI does not pass certain security checks (e.g., a "https://" URL will never be sent as the referrer for a plaintext HTTP request). The implementation is not required to throw an exception when the referrer URI is rejected.

Exceptions:
NS_ERROR_IN_PROGRESSif set after the channel has been opened.

Definition at line 92 of file nsIHttpChannel.idl.

Set/get the HTTP request method (default is "GET").

Setter is case insensitive; getter returns an uppercase string.

This attribute may only be set before the channel is opened.

NOTE: The data for a "POST" or "PUT" request can be configured via nsIUploadChannel; however, after setting the upload data, it may be necessary to set the request method explicitly. The documentation for nsIUploadChannel has further details.

Exceptions:
NS_ERROR_IN_PROGRESSif set after the channel has been opened.

Definition at line 75 of file nsIHttpChannel.idl.

Returns true if the HTTP response code indicates success.

The value of nsIRequest::status will be NS_OK even when processing a 404 response because a 404 response may include a message body that (in some cases) should be shown to the user.

Use this attribute to distinguish server error pages from normal pages, instead of comparing the response status manually against the set of valid response codes, if that is required by your application.

Exceptions:
NS_ERROR_NOT_AVAILABLEif called before the response has been received (before onStartRequest).

Definition at line 216 of file nsIHttpChannel.idl.

readonly attribute unsigned long nsIHttpChannel::responseStatus [inherited]

Get the HTTP response code (e.g., 200).

Exceptions:
NS_ERROR_NOT_AVAILABLEif called before the response has been received (before onStartRequest).

Definition at line 189 of file nsIHttpChannel.idl.

readonly attribute ACString nsIHttpChannel::responseStatusText [inherited]

Get the HTTP response status text (e.g., "OK").

NOTE: This returns the raw (possibly 8-bit) text from the server. There are no assumptions made about the charset of the returned text. You have been warned!

Exceptions:
NS_ERROR_NOT_AVAILABLEif called before the response has been received (before onStartRequest).

Definition at line 201 of file nsIHttpChannel.idl.

readonly attribute nsISupports nsIChannel::securityInfo [inherited]

Transport-level security information (if any) corresponding to the channel.

Definition at line 113 of file nsIChannel.idl.

readonly attribute nsresult nsIRequest::status [inherited]

The error status associated with the request.

Definition at line 77 of file nsIRequest.idl.

Get the stream (to be) uploaded by this channel.

Definition at line 89 of file nsIUploadChannel.idl.

readonly attribute nsIURI nsIChannel::URI [inherited]

The URI corresponding to the channel.

Its value is immutable.

Definition at line 76 of file nsIChannel.idl.

const unsigned long nsIRequest::VALIDATE_ALWAYS = 1 << 11 [inherited]

The following flags control the frequency of cached content validation when neither LOAD_BYPASS_CACHE or LOAD_FROM_CACHE are set.

By default, cached content is automatically validated if necessary before reuse.

VALIDATE_ALWAYS forces validation of any cached content independent of its expiration time.

VALIDATE_NEVER disables validation of expired content.

VALIDATE_ONCE_PER_SESSION disables validation of expired content, provided it has already been validated (at least once) since the start of this session.

NOTE TO IMPLEMENTORS: These flags are intended for normal browsing, and they should therefore not apply to content that must be validated before each use. Consider, for example, a HTTP response with a "Cache-control: no-cache" header. According to RFC2616, this response must be validated before it can be taken from a cache. Breaking this requirement could result in incorrect and potentially undesirable side-effects.

Definition at line 204 of file nsIRequest.idl.

const unsigned long nsIRequest::VALIDATE_NEVER = 1 << 12 [inherited]

Definition at line 205 of file nsIRequest.idl.

const unsigned long nsIRequest::VALIDATE_ONCE_PER_SESSION = 1 << 13 [inherited]

Definition at line 206 of file nsIRequest.idl.


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