Back to index

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

#include <nsImapProtocol.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIIMAPMOCKCHANNEL
NS_DECL_NSICHANNEL
NS_DECL_NSIREQUEST
NS_DECL_NSICACHELISTENER
NS_DECL_NSITRANSPORTEVENTSINK 
nsImapMockChannel ()
virtual ~nsImapMockChannel ()
void GetChannelListener (out nsIStreamListener aChannelListener)
void GetChannelContext (out nsISupports aChannelContext)
void Close ()
void setImapProtocol (in nsIImapProtocol aProtocol)
void setSecurityInfo (in nsISupports securityInfo)
void setURI (in 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 onCacheEntryAvailable (in nsICacheEntryDescriptor descriptor, in nsCacheAccessMode accessGranted, in nsresult status)
 Called when the requested access (or appropriate subset) is acquired.
void onTransportStatus (in nsITransport aTransport, in nsresult aStatus, in unsigned long long aProgress, in unsigned long long aProgressMax)
 Transport status notification.

Static Public Member Functions

static nsresult Create (const nsIID &iid, void **result)

Public Attributes

attribute nsIProgressEventSink progressEventSink
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

Protected Member Functions

nsresult OpenCacheEntry ()
PRBool ReadFromLocalCache ()
nsresult ReadFromImapConnection ()
nsresult ReadFromMemCache (nsICacheEntryDescriptor *entry)
nsresult NotifyStartEndReadFromCache (PRBool start)
nsresult SetupPartExtractorListener (nsIImapUrl *aUrl, nsIStreamListener *aConsumer)

Protected Attributes

nsCOMPtr< nsIURIm_url
nsCOMPtr< nsIURIm_originalUrl
nsCOMPtr< nsILoadGroupm_loadGroup
nsCOMPtr< nsIStreamListenerm_channelListener
nsISupports * m_channelContext
nsresult m_cancelStatus
nsLoadFlags mLoadFlags
nsCOMPtr< nsIProgressEventSinkmProgressEventSink
nsCOMPtr< nsIInterfaceRequestormCallbacks
nsCOMPtr< nsISupports > mOwner
nsCOMPtr< nsISupports > mSecurityInfo
nsCOMPtr< nsIRequestmCacheRequest
nsCString m_ContentType
nsWeakPtr m_protocol
PRBool mChannelClosed
PRBool mReadingFromCache
PRBool mTryingToReadPart
PRInt32 mContentLength

Detailed Description

Definition at line 630 of file nsImapProtocol.h.


Constructor & Destructor Documentation

Definition at line 8039 of file nsImapProtocol.cpp.

{
  // if we're offline, we may not get to close the channel correctly.
  // we need to do this to send the url state change notification in
  // the case of mem and disk cache reads.
  if (!mChannelClosed)
    Close();
}

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
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.

Here is the caller graph for this function:

static nsresult nsImapMockChannel::Create ( const nsIID iid,
void **  result 
) [static]
void nsIImapMockChannel::GetChannelContext ( out nsISupports  aChannelContext) [inherited]
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.

Definition at line 8048 of file nsImapProtocol.cpp.

{
  nsresult rv = NS_OK;
  mReadingFromCache = start;
  nsCOMPtr <nsIImapUrl> imapUrl = do_QueryInterface(m_url, &rv);
  if (imapUrl)
  {
    nsCOMPtr <nsIImapMailFolderSink> folderSink;
    rv = imapUrl->GetImapMailFolderSink(getter_AddRefs(folderSink));
    if (folderSink)
    {
      nsCOMPtr <nsIMsgMailNewsUrl> mailUrl = do_QueryInterface(m_url);
      rv = folderSink->SetUrlState(nsnull /* we don't know the protocol */, mailUrl, start, NS_OK); 
    }
  }
  return rv;
}

Here is the call graph for this function:

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 nsITransportEventSink::onTransportStatus ( in nsITransport  aTransport,
in nsresult  aStatus,
in unsigned long long  aProgress,
in unsigned long long  aProgressMax 
) [inherited]

Transport status notification.

Parameters:
aTransportthe transport sending this status notification.
aStatusthe transport status (resolvable to a string using nsIErrorService). See nsISocketTransport for socket specific status codes and more comments.
aProgressthe amount of data either read or written depending on the value of the status code. this value is relative to aProgressMax.
aProgressMaxthe maximum amount of data that will be read or written. if unknown, 0xFFFFFFFF will be passed.

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.

Definition at line 8284 of file nsImapProtocol.cpp.

{
  nsresult rv;
  // get the cache session from our imap service...
  nsCOMPtr<nsIImapService> imapService = do_GetService(NS_IMAPSERVICE_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsICacheSession> cacheSession;
  rv = imapService->GetCacheSession(getter_AddRefs(cacheSession));
  NS_ENSURE_SUCCESS(rv, rv);

  // we're going to need to extend this logic for the case where we're looking 
  // for a part. If we're looking for a part, we need to first ask for the part.
  // if that comes back with a writeable cache entry, we need to doom it right
  // away and not use it, and turn around and ask for a cache entry for the whole
  // message, if that's available. But it seems like we shouldn't write into that
  // cache entry if we just fetch that part - though we're doing that now. Maybe
  // we never try to download just a single part from imap because our mime parser
  // can't handle that, though I would think saving a single part as a file wouldn't
  // need to go through mime...

  // Open a cache entry with key = url
  nsCAutoString urlSpec;
  m_url->GetAsciiSpec(urlSpec);

  // for now, truncate of the query part so we don't duplicate urls in the cache...
  PRInt32 anchorIndex = urlSpec.RFindChar('?');
  if (anchorIndex > 0)
  {
    // if we were trying to read a part, we failed - fall back and look for whole msg
    if (mTryingToReadPart)
    {
      mTryingToReadPart = PR_FALSE;
      urlSpec.Truncate(anchorIndex);
    }
    else
    {
      // check if this is a filter plugin requesting the message. In that case,we're not
      // fetching a part, and we want the cache key to be just the uri.
      nsCAutoString anchor(Substring(urlSpec, anchorIndex));

      if (!anchor.EqualsLiteral("?header=filter") 
        && !anchor.EqualsLiteral("?header=attach") && !anchor.EqualsLiteral("?header=src"))
        mTryingToReadPart = PR_TRUE;
      else
        urlSpec.Truncate(anchorIndex);
    }
  }
  PRInt32 uidValidity = -1;
  nsCOMPtr <nsIImapUrl> imapUrl = do_QueryInterface(m_url, &rv);
  if (imapUrl)
  {
    nsCOMPtr <nsIImapMailFolderSink> folderSink;
    rv = imapUrl->GetImapMailFolderSink(getter_AddRefs(folderSink));
    if (folderSink)
      folderSink->GetUidValidity(&uidValidity);
  }
  // stick the uid validity in front of the url, so that if the uid validity
  // changes, we won't re-use the wrong cache entries.
  nsCAutoString cacheKey;
  cacheKey.AppendInt(uidValidity, 16);
  cacheKey.Append(urlSpec);
  return cacheSession->AsyncOpenCacheEntry(cacheKey, nsICache::ACCESS_READ_WRITE, this);
}

Here is the call graph for this function:

Definition at line 8432 of file nsImapProtocol.cpp.

{
  nsresult rv = NS_OK;  
  nsCOMPtr<nsIImapUrl> imapUrl = do_QueryInterface(m_url);
  nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_url);

  // okay, add the mock channel to the load group..
  imapUrl->AddChannelToLoadGroup();
  // loading the url consists of asking the server to add the url to it's imap event queue....
  nsCOMPtr<nsIMsgIncomingServer> server;
  rv = mailnewsUrl->GetServer(getter_AddRefs(server));
  NS_ENSURE_SUCCESS(rv, rv);
  nsCOMPtr<nsIImapIncomingServer> imapServer (do_QueryInterface(server, &rv));
  NS_ENSURE_SUCCESS(rv, rv);

  // Assume AsyncRead is always called from the UI thread.....
  nsCOMPtr<nsIEventQueue> queue;
  // get the Event Queue for this thread...
  nsCOMPtr<nsIEventQueueService> pEventQService (do_GetService(kEventQueueServiceCID, &rv));
  NS_ENSURE_SUCCESS(rv, rv);

  rv = pEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(queue));
  NS_ENSURE_SUCCESS(rv, rv);
  rv = imapServer->GetImapConnectionAndLoadUrl(queue, imapUrl, nsnull);
  return rv;
}

Here is the call graph for this function:

Definition at line 8462 of file nsImapProtocol.cpp.

{
  nsresult rv = NS_OK;
  
  nsCOMPtr<nsIImapUrl> imapUrl = do_QueryInterface(m_url);
  nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(m_url, &rv);

  PRBool useLocalCache = PR_FALSE;
  mailnewsUrl->GetMsgIsInLocalCache(&useLocalCache);
  if (useLocalCache)
  {
    nsXPIDLCString messageIdString;

    SetupPartExtractorListener(imapUrl, m_channelListener);

    imapUrl->CreateListOfMessageIdsString(getter_Copies(messageIdString));
    nsCOMPtr <nsIMsgFolder> folder;
    rv = mailnewsUrl->GetFolder(getter_AddRefs(folder));
    if (folder && NS_SUCCEEDED(rv))
    {
      // we want to create a file channel and read the msg from there.
      nsCOMPtr<nsIInputStream> fileStream;
      nsMsgKey msgKey = atoi(messageIdString);
      PRUint32 size, offset;
      rv = folder->GetOfflineFileStream(msgKey, &offset, &size, getter_AddRefs(fileStream));
      // get the file channel from the folder, somehow (through the message or
      // folder sink?) We also need to set the transfer offset to the message offset
      if (fileStream && NS_SUCCEEDED(rv))
      {
        // dougt - This may break the ablity to "cancel" a read from offline mail reading.
        // fileChannel->SetLoadGroup(m_loadGroup);
        
        // force the url to remove its reference on the mock channel...this is to solve
        // a nasty reference counting problem...
        imapUrl->SetMockChannel(nsnull);

        nsImapCacheStreamListener * cacheListener = new nsImapCacheStreamListener();
        NS_ADDREF(cacheListener);
        cacheListener->Init(m_channelListener, this);

        // create a stream pump that will async read the specified amount of data.
        // XXX make offset/size 64-bit ints
        nsCOMPtr<nsIInputStreamPump> pump;
        rv = NS_NewInputStreamPump(getter_AddRefs(pump), fileStream,
                                   nsInt64(offset), nsInt64(size));
        if (NS_SUCCEEDED(rv))
          rv = pump->AsyncRead(cacheListener, m_channelContext);

        NS_RELEASE(cacheListener);

        if (NS_SUCCEEDED(rv)) // ONLY if we succeeded in actually starting the read should we return
        {
          // if the msg is unread, we should mark it read on the server. This lets
          // the code running this url we're loading from the cache, if it cares.
          imapUrl->SetMsgLoadingFromCache(PR_TRUE);
          return PR_TRUE;
        }
      } // if we got an offline file transport
    } // if we got the folder for this url
  } // if use local cache

  return PR_FALSE;
}

Here is the call graph for this function:

Definition at line 8349 of file nsImapProtocol.cpp.

{
  NS_ENSURE_ARG(entry);

  PRUint32 annotationLength = 0;
  nsXPIDLCString annotation;
  nsCAutoString entryKey;
  nsXPIDLCString contentType;
  nsresult rv = NS_OK;
  PRBool shouldUseCacheEntry = PR_FALSE;

  entry->GetKey(entryKey);
  // if we have a part, then we should use the cache entry.
  if (entryKey.FindChar('?') != kNotFound)
  {
    entry->GetMetaDataElement("contentType", getter_Copies(contentType));
    if (!contentType.IsEmpty())
      SetContentType(contentType);
    shouldUseCacheEntry = PR_TRUE;
  }
  else
  {
    // otherwise, we have the whole msg, and we should make sure the content isn't modified.
    rv = entry->GetMetaDataElement("ContentModified", getter_Copies(annotation));
    if (NS_SUCCEEDED(rv) && (annotation.get()))
    {
      annotationLength = strlen(annotation.get());
      if (annotationLength == strlen("Not Modified") && !nsCRT::strncmp(annotation, "Not Modified", annotationLength))
        shouldUseCacheEntry = PR_TRUE;
    }
  }
  if (shouldUseCacheEntry)
  {
    nsCOMPtr<nsIInputStream> in;
    rv = entry->OpenInputStream(0, getter_AddRefs(in));
    if (NS_FAILED(rv)) return rv;
     // if mem cache entry is broken or empty, return error.
    PRUint32 bytesAvailable;
    rv = in->Available(&bytesAvailable);
    NS_ENSURE_SUCCESS(rv, rv);
    if (!bytesAvailable)
      return NS_ERROR_FAILURE;

    nsCOMPtr<nsIInputStreamPump> pump;
    rv = NS_NewInputStreamPump(getter_AddRefs(pump), in);
    if (NS_FAILED(rv)) return rv;

    // if we are going to read from the cache, then create a mock stream listener class and use it
    nsImapCacheStreamListener * cacheListener = new nsImapCacheStreamListener();
    NS_ADDREF(cacheListener);
    cacheListener->Init(m_channelListener, this);
    rv = pump->AsyncRead(cacheListener, m_channelContext);
    NS_RELEASE(cacheListener);

    if (NS_SUCCEEDED(rv)) // ONLY if we succeeded in actually starting the read should we return
    {
      mCacheRequest = pump;

      nsCOMPtr<nsIImapUrl> imapUrl = do_QueryInterface(m_url);

      // if the msg is unread, we should mark it read on the server. This lets
      // the code running this url we're loading from the cache, if it cares.
      imapUrl->SetMsgLoadingFromCache(PR_TRUE);

      // and force the url to remove its reference on the mock channel...this is to solve
      // a nasty reference counting problem...
      imapUrl->SetMockChannel(nsnull);

      // be sure to set the cache entry's security info status as our security info status...
      nsCOMPtr<nsISupports> securityInfo;
      entry->GetSecurityInfo(getter_AddRefs(securityInfo));
      SetSecurityInfo(securityInfo);
      return NS_OK;
    } // if AsyncRead succeeded.
  } // if contnet is not modified
  else
    rv = NS_ERROR_FAILURE; // content is modified so return an error so we try to open it the old fashioned way

  return rv;
}

Here is the call graph for this function:

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 nsIImapMockChannel::setSecurityInfo ( in nsISupports  securityInfo) [inherited]

Definition at line 8587 of file nsImapProtocol.cpp.

{
  // if the url we are loading refers to a specific part then we need 
  // libmime to extract that part from the message for us.
  PRBool refersToPart = PR_FALSE;
  aUrl->GetMimePartSelectorDetected(&refersToPart);
  if (refersToPart)
  {
    nsCOMPtr<nsIStreamConverterService> converter = do_GetService("@mozilla.org/streamConverters;1");
    if (converter && aConsumer)
    {
      nsCOMPtr<nsIStreamListener> newConsumer;
      converter->AsyncConvertData("message/rfc822", "*/*",
           aConsumer, NS_STATIC_CAST(nsIChannel *, this), getter_AddRefs(newConsumer));
      if (newConsumer)
        m_channelListener = newConsumer;
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIImapMockChannel::setURI ( in nsIURI  uri) [inherited]
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.

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 660 of file nsImapProtocol.h.

nsISupports* nsImapMockChannel::m_channelContext [protected]

Definition at line 659 of file nsImapProtocol.h.

Definition at line 656 of file nsImapProtocol.h.

Definition at line 667 of file nsImapProtocol.h.

Definition at line 655 of file nsImapProtocol.h.

Definition at line 654 of file nsImapProtocol.h.

Definition at line 668 of file nsImapProtocol.h.

Definition at line 652 of file nsImapProtocol.h.

Definition at line 666 of file nsImapProtocol.h.

Definition at line 663 of file nsImapProtocol.h.

Definition at line 670 of file nsImapProtocol.h.

Definition at line 673 of file nsImapProtocol.h.

Definition at line 661 of file nsImapProtocol.h.

nsCOMPtr<nsISupports> nsImapMockChannel::mOwner [protected]

Definition at line 664 of file nsImapProtocol.h.

Definition at line 662 of file nsImapProtocol.h.

Definition at line 671 of file nsImapProtocol.h.

nsCOMPtr<nsISupports> nsImapMockChannel::mSecurityInfo [protected]

Definition at line 665 of file nsImapProtocol.h.

Definition at line 672 of file nsImapProtocol.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.

Definition at line 73 of file nsIImapMockChannel.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.

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: