Back to index

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

#include <nsFTPChannel.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIREQUEST
NS_DECL_NSICHANNEL
NS_DECL_NSIUPLOADCHANNEL
NS_DECL_NSIFTPCHANNEL
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSIPROGRESSEVENTSINK
NS_DECL_NSISTREAMLISTENER
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSICACHELISTENER
NS_DECL_NSIRESUMABLECHANNEL 
nsFTPChannel ()
virtual ~nsFTPChannel ()
nsresult Init (nsIURI *uri, nsIProxyInfo *proxyInfo, nsICacheSession *session)
nsresult SetupState (PRUint64 startPos, const nsACString &entityID)
nsresult GenerateCacheKey (nsACString &cacheKey)
nsresult AsyncOpenAt (nsIStreamListener *listener, nsISupports *ctxt, PRUint64 startPos, const nsACString &entityID)
template<class T >
void GetCallback (nsCOMPtr< T > &aResult)
void GetFTPEventSink (nsCOMPtr< nsIFTPEventSink > &aResult)
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 setUploadStream (in nsIInputStream aStream, in ACString aContentType, in long aContentLength)
 Sets a stream to be uploaded by this channel.
void getInterface (in nsIIDRef uuid,[iid_is(uuid), retval] out nsQIResult result)
 Retrieves the specified interface pointer.
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 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 onCacheEntryAvailable (in nsICacheEntryDescriptor descriptor, in nsCacheAccessMode accessGranted, in nsresult status)
 Called when the requested access (or appropriate subset) is acquired.
void resumeAt (in unsigned long long startPos, in ACString entityID)
 Prepare this channel for resuming.

Public Attributes

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
readonly attribute nsIInputStream uploadStream
 Get the stream (to be) uploaded by this channel.
readonly attribute ACString entityID
 The entity id for this URI.

Protected Member Functions

void InitProgressSink ()

Protected Attributes

nsCOMPtr< nsIURImOriginalURI
nsCOMPtr< nsIURImURL
nsCOMPtr< nsIInputStreammUploadStream
nsCOMPtr< nsIProgressEventSinkmProgressSink
nsCOMPtr< nsIFTPEventSinkmFTPEventSink
nsCOMPtr< nsIInterfaceRequestormCallbacks
PRBool mIsPending
PRUint32 mLoadFlags
PRUint32 mSourceOffset
PRInt32 mAmount
nsCOMPtr< nsILoadGroupmLoadGroup
nsCString mContentType
nsCString mContentCharset
PRInt32 mContentLength
nsCOMPtr< nsISupports > mOwner
nsCOMPtr< nsIStreamListenermListener
nsFtpStatemFTPState
nsCOMPtr< nsISupports > mUserContext
nsresult mStatus
PRPackedBool mCanceled
nsCOMPtr< nsIIOServicemIOService
nsCOMPtr< nsICacheSessionmCacheSession
nsCOMPtr< nsICacheEntryDescriptormCacheEntry
nsCOMPtr< nsIProxyInfomProxyInfo
nsCString mEntityID
PRUint64 mStartPos

Detailed Description

Definition at line 77 of file nsFTPChannel.h.


Constructor & Destructor Documentation

Definition at line 94 of file nsFTPChannel.cpp.

{
#if defined(PR_LOGGING)
    nsCAutoString spec;
    mURL->GetAsciiSpec(spec);
    PR_LOG(gFTPLog, PR_LOG_ALWAYS, ("~nsFTPChannel() for %s", spec.get()));
#endif
    NS_IF_RELEASE(mFTPState);
}

Here is the call graph for this function:


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
nsresult nsFTPChannel::AsyncOpenAt ( nsIStreamListener listener,
nsISupports *  ctxt,
PRUint64  startPos,
const nsACString &  entityID 
)

Definition at line 293 of file nsFTPChannel.cpp.

{
    PRInt32 port;
    nsresult rv = mURL->GetPort(&port);
    if (NS_FAILED(rv))
        return rv;
 
    rv = NS_CheckPortSafety(port, "ftp", mIOService);
    if (NS_FAILED(rv))
        return rv;

    PR_LOG(gFTPLog, PR_LOG_DEBUG, ("nsFTPChannel::AsyncOpen() called\n"));

    mListener = listener;
    mUserContext = ctxt;

    // Add this request to the load group
    if (mLoadGroup)
        mLoadGroup->AddRequest(this, nsnull);
    PRBool offline;

    // If we're starting from the beginning, then its OK to use the cache,
    // because the entire file must be there (the cache doesn't support
    // partial entries yet)
    // Note that ftp doesn't store metadata, so disable caching if there was
    // an entityID. Storing this metadata isn't worth it until we can
    // get partial data out of the cache anyway...
    if (mCacheSession && !mUploadStream && entityID.IsEmpty() &&
        (startPos==0 || startPos==PRUint32(-1))) {
        mIOService->GetOffline(&offline);

        // Set the desired cache access mode accordingly...
        nsCacheAccessMode accessRequested;
        if (offline) {
            // Since we are offline, we can only read from the cache.
            accessRequested = nsICache::ACCESS_READ;
        }
        else if (mLoadFlags & LOAD_BYPASS_CACHE)
            accessRequested = nsICache::ACCESS_WRITE; // replace cache entry
        else
            accessRequested = nsICache::ACCESS_READ_WRITE; // normal browsing
        
        nsCAutoString cacheKey;
        GenerateCacheKey(cacheKey);

        rv = mCacheSession->AsyncOpenCacheEntry(cacheKey,
                                                accessRequested,
                                                this);
        if (NS_SUCCEEDED(rv))
            return rv;
        
        // If we failed to use the cache, try without
        PR_LOG(gFTPLog, PR_LOG_DEBUG,
               ("Opening cache entry failed [rv=%x]", rv));
    }
    
    return SetupState(startPos, entityID);
    // XXX this function must not fail since we have already called AddRequest!
}

Here is the call graph for this function:

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.

nsresult nsFTPChannel::GenerateCacheKey ( nsACString &  cacheKey)

Definition at line 248 of file nsFTPChannel.cpp.

{
    cacheKey.SetLength(0);
    
    nsCAutoString spec;
    mURL->GetAsciiSpec(spec);

    // Strip any trailing #ref from the URL before using it as the key
    const char *p = strchr(spec.get(), '#');
    if (p)
        cacheKey.Append(Substring(spec, 0, p - spec.get()));
    else
        cacheKey.Append(spec);
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
void nsFTPChannel::GetCallback ( nsCOMPtr< T > &  aResult) [inline]

Definition at line 116 of file nsFTPChannel.h.

                                           {
        GetInterface(NS_GET_IID(T), getter_AddRefs(aResult));
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 355 of file nsFTPChannel.cpp.

{
    if (!mFTPEventSink) {
        nsCOMPtr<nsIFTPEventSink> ftpSink;
        GetCallback(ftpSink);
        if (ftpSink)
            NS_GetProxyForObject(NS_CURRENT_EVENTQ,
                                 NS_GET_IID(nsIFTPEventSink),
                                 ftpSink,
                                 PROXY_ASYNC | PROXY_ALWAYS,
                                 getter_AddRefs(mFTPEventSink));
    }
    aResult = mFTPEventSink;
}

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 nsFTPChannel::Init ( nsIURI uri,
nsIProxyInfo proxyInfo,
nsICacheSession session 
)

Definition at line 121 of file nsFTPChannel.cpp.

{
    nsresult rv = nsHashPropertyBag::Init();
    if (NS_FAILED(rv))
        return rv;

    // setup channel state
    mURL = uri;
    mProxyInfo = proxyInfo;

    mIOService = do_GetIOService(&rv);
    if (NS_FAILED(rv)) return rv;

    mCacheSession = session;
    
    return NS_OK;
}

Here is the call graph for this function:

Definition at line 371 of file nsFTPChannel.cpp.

{
    // Build a proxy for the progress event sink since we may need to call it
    // while we are deep inside some of our state logic, and we wouldn't want
    // to worry about some weird re-entrancy scenario.
    nsCOMPtr<nsIProgressEventSink> progressSink;
    NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, progressSink);
    if (progressSink)
        NS_GetProxyForObject(NS_CURRENT_EVENTQ,
                             NS_GET_IID(nsIProgressEventSink),
                             progressSink,
                             PROXY_ASYNC | PROXY_ALWAYS,
                             getter_AddRefs(mProgressSink));
}

Here is the call graph for this function:

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 nsICacheListener::onCacheEntryAvailable ( in nsICacheEntryDescriptor  descriptor,
in nsCacheAccessMode  accessGranted,
in nsresult  status 
) [inherited]

Called when the requested access (or appropriate subset) is acquired.

The status parameter equals NS_OK on success. See nsICacheService.idl for accessGranted values.

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:

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 nsIResumableChannel::resumeAt ( in unsigned long long  startPos,
in ACString  entityID 
) [inherited]

Prepare this channel for resuming.

The request will not start until asyncOpen or open is called. Calling resumeAt after open or asyncOpen has been called has undefined behaviour.

Parameters:
startPosthe starting offset, in bytes, to use to download
entityIDinformation about the file, to match before obtaining the file. Pass an empty string to use anything.

During OnStartRequest, this channel will have a status of NS_ERROR_NOT_RESUMABLE if the file cannot be resumed, eg because the server doesn't support this. This error may occur even if startPos is 0, so that the front end can warn the user. Similarly, the status of this channel during OnStartRequest may be NS_ERROR_ENTITY_CHANGED, which indicates that the entity has changed, as indicated by a changed entityID. In both of these cases, no OnDataAvailable will be called, and OnStopRequest will immediately follow with the same status code.

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.
nsresult nsFTPChannel::SetupState ( PRUint64  startPos,
const nsACString &  entityID 
)

Definition at line 387 of file nsFTPChannel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.


Member Data Documentation

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.

readonly attribute ACString nsIResumableChannel::entityID [inherited]

The entity id for this URI.

Available after OnStartRequest.

Exceptions:
NS_ERROR_NOT_RESUMABLEif this load is not resumable.

Definition at line 69 of file nsIResumableChannel.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 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 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 141 of file nsFTPChannel.h.

Definition at line 159 of file nsFTPChannel.h.

Definition at line 158 of file nsFTPChannel.h.

Definition at line 135 of file nsFTPChannel.h.

Definition at line 154 of file nsFTPChannel.h.

Definition at line 144 of file nsFTPChannel.h.

Definition at line 145 of file nsFTPChannel.h.

Definition at line 143 of file nsFTPChannel.h.

Definition at line 161 of file nsFTPChannel.h.

Definition at line 134 of file nsFTPChannel.h.

Definition at line 150 of file nsFTPChannel.h.

Definition at line 156 of file nsFTPChannel.h.

Definition at line 137 of file nsFTPChannel.h.

Definition at line 148 of file nsFTPChannel.h.

Definition at line 138 of file nsFTPChannel.h.

Definition at line 142 of file nsFTPChannel.h.

Definition at line 127 of file nsFTPChannel.h.

nsCOMPtr<nsISupports> nsFTPChannel::mOwner [protected]

Definition at line 146 of file nsFTPChannel.h.

Definition at line 133 of file nsFTPChannel.h.

Definition at line 160 of file nsFTPChannel.h.

Definition at line 140 of file nsFTPChannel.h.

Definition at line 162 of file nsFTPChannel.h.

Definition at line 153 of file nsFTPChannel.h.

Definition at line 130 of file nsFTPChannel.h.

Definition at line 128 of file nsFTPChannel.h.

nsCOMPtr<nsISupports> nsFTPChannel::mUserContext [protected]

Definition at line 152 of file nsFTPChannel.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 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.

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 files: