Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsHttpChannel.cpp File Reference
#include "nsHttpChannel.h"
#include "nsHttpTransaction.h"
#include "nsHttpConnection.h"
#include "nsHttpHandler.h"
#include "nsHttpAuthCache.h"
#include "nsHttpResponseHead.h"
#include "nsHttp.h"
#include "nsIHttpAuthenticator.h"
#include "nsIAuthPrompt.h"
#include "nsIAuthPromptProvider.h"
#include "nsIStringBundle.h"
#include "nsXPCOM.h"
#include "nsISupportsPrimitives.h"
#include "nsIURL.h"
#include "nsIScriptSecurityManager.h"
#include "nsIIDNService.h"
#include "nsIStreamListenerTee.h"
#include "nsISeekableStream.h"
#include "nsCPasswordManager.h"
#include "nsMimeTypes.h"
#include "nsNetUtil.h"
#include "nsString.h"
#include "nsPrintfCString.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsAutoPtr.h"
#include "plstr.h"
#include "prprf.h"
#include "nsEscape.h"
#include "nsICookieService.h"
#include "nsIResumableChannel.h"
#include "nsInt64.h"
#include "nsIVariant.h"
#include "nsChannelProperties.h"
#include "nsIOService.h"

Go to the source code of this file.

Defines

#define BYPASS_LOCAL_CACHE(loadFlags)

Functions

static NS_DEFINE_CID (kStreamListenerTeeCID, NS_STREAMLISTENERTEE_CID)
static NS_METHOD DiscardSegments (nsIInputStream *input, void *closure, const char *buf, PRUint32 offset, PRUint32 count, PRUint32 *countRead)
static void CallTypeSniffers (void *aClosure, const PRUint8 *aData, PRUint32 aCount)
 CopyProperties (const nsAString &aKey, nsIVariant *aData, void *aClosure)
static void ParseUserDomain (PRUnichar *buf, const PRUnichar **user, const PRUnichar **domain)
static void SetIdent (nsHttpAuthIdentity &ident, PRUint32 authFlags, PRUnichar *userBuf, PRUnichar *passBuf)
static void GetAuthPrompt (nsIInterfaceRequestor *ifreq, PRBool proxyAuth, nsIAuthPrompt **result)

Define Documentation

#define BYPASS_LOCAL_CACHE (   loadFlags)

Function Documentation

static void CallTypeSniffers ( void aClosure,
const PRUint8 aData,
PRUint32  aCount 
) [static]

Definition at line 687 of file nsHttpChannel.cpp.

{
  nsIChannel *chan = NS_STATIC_CAST(nsIChannel*, aClosure);

  const nsCOMArray<nsIContentSniffer_MOZILLA_1_8_BRANCH>& sniffers =
    gIOService->GetContentSniffers();
  PRUint32 length = sniffers.Count();
  for (PRUint32 i = 0; i < length; ++i) {
    nsCAutoString newType;
    nsresult rv =
      sniffers[i]->GetMIMETypeFromContent(chan, aData, aCount, newType);
    if (NS_SUCCEEDED(rv) && !newType.IsEmpty()) {
      chan->SetContentType(newType);
      break;
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

CopyProperties ( const nsAString &  aKey,
nsIVariant aData,
void aClosure 
)

Definition at line 1891 of file nsHttpChannel.cpp.

{
    nsIWritablePropertyBag* bag = NS_STATIC_CAST(nsIWritablePropertyBag*,
                                                 aClosure);
    bag->SetProperty(aKey, aData);
    return PL_DHASH_NEXT;
}

Here is the caller graph for this function:

static NS_METHOD DiscardSegments ( nsIInputStream input,
void closure,
const char *  buf,
PRUint32  offset,
PRUint32  count,
PRUint32 countRead 
) [static]

Definition at line 84 of file nsHttpChannel.cpp.

{
    *countRead = count;
    return NS_OK;
}
static void GetAuthPrompt ( nsIInterfaceRequestor ifreq,
PRBool  proxyAuth,
nsIAuthPrompt **  result 
) [static]

Definition at line 2157 of file nsHttpChannel.cpp.

{
    if (!ifreq)
        return;

    PRUint32 promptReason;
    if (proxyAuth)
        promptReason = nsIAuthPromptProvider::PROMPT_PROXY;
    else 
        promptReason = nsIAuthPromptProvider::PROMPT_NORMAL;

    nsCOMPtr<nsIAuthPromptProvider> promptProvider = do_GetInterface(ifreq);
    if (promptProvider)
        promptProvider->GetAuthPrompt(promptReason, result);
    else
        CallGetInterface(ifreq, result);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kStreamListenerTeeCID  ,
NS_STREAMLISTENERTEE_CID   
) [static]
static void ParseUserDomain ( PRUnichar buf,
const PRUnichar **  user,
const PRUnichar **  domain 
) [static]

Definition at line 2126 of file nsHttpChannel.cpp.

{
    PRUnichar *p = buf;
    while (*p && *p != '\\') ++p;
    if (!*p)
        return;
    *p = '\0';
    *domain = buf;
    *user = p + 1;
}

Here is the caller graph for this function:

static void SetIdent ( nsHttpAuthIdentity ident,
PRUint32  authFlags,
PRUnichar userBuf,
PRUnichar passBuf 
) [static]

Definition at line 2141 of file nsHttpChannel.cpp.

{
    const PRUnichar *user = userBuf;
    const PRUnichar *domain = nsnull;

    if (authFlags & nsIHttpAuthenticator::IDENTITY_INCLUDES_DOMAIN)
        ParseUserDomain(userBuf, &user, &domain);

    ident.Set(domain, user, passBuf);
}

Here is the call graph for this function:

Here is the caller graph for this function: