Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsContentSink.cpp File Reference
#include "nsContentSink.h"
#include "nsIScriptLoader.h"
#include "nsIDocument.h"
#include "nsICSSLoader.h"
#include "nsStyleConsts.h"
#include "nsStyleLinkElement.h"
#include "nsINodeInfo.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsCPrefetchService.h"
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "nsIHttpChannel.h"
#include "nsIContent.h"
#include "nsIScriptElement.h"
#include "nsIParser.h"
#include "nsContentErrors.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIViewManager.h"
#include "nsIScrollableView.h"
#include "nsIContentViewer.h"
#include "nsIAtom.h"
#include "nsHTMLAtoms.h"
#include "nsIDOMWindowInternal.h"
#include "nsIPrincipal.h"
#include "nsIScriptSecurityManager.h"
#include "nsIScriptGlobalObject.h"
#include "nsNetCID.h"
#include "nsICookieService.h"
#include "nsIPrompt.h"
#include "nsServiceManagerUtils.h"
#include "nsICharsetConverterManager.h"
#include "nsContentUtils.h"
#include "nsParserUtils.h"
#include "nsCRT.h"
#include "nsEscape.h"
#include "nsWeakReference.h"
#include "nsUnicharUtils.h"
#include "nsNodeInfoManager.h"

Go to the source code of this file.

Classes

class  nsScriptLoaderObserverProxy

Functions

 NS_IMPL_ISUPPORTS3 (nsContentSink, nsICSSLoaderObserver, nsISupportsWeakReference, nsIScriptLoaderObserver) nsContentSink
static nsresult CharsetConvRef (const nsACString &aDocCharset, const nsCString &aRefInDocCharset, nsString &aRefInUnicode)

Variables

const PRBool kBlockByDefault = PR_TRUE
static const PRUnichar kSemiCh = PRUnichar(';')
static const PRUnichar kCommaCh = PRUnichar(',')
static const PRUnichar kEqualsCh = PRUnichar('=')
static const PRUnichar kLessThanCh = PRUnichar('<')
static const PRUnichar kGreaterThanCh = PRUnichar('>')

Function Documentation

static nsresult CharsetConvRef ( const nsACString &  aDocCharset,
const nsCString aRefInDocCharset,
nsString aRefInUnicode 
) [static]

Definition at line 768 of file nsContentSink.cpp.

{
  nsresult rv;

  nsCOMPtr <nsIAtom> docCharsetAtom;
  nsCOMPtr<nsICharsetConverterManager> ccm =
    do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);

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

  nsCOMPtr<nsIUnicodeDecoder> decoder;
  rv = ccm->GetUnicodeDecoder(PromiseFlatCString(aDocCharset).get(),
                              getter_AddRefs(decoder));
  if (NS_FAILED(rv)) {
    return rv;
  }

  PRInt32 srcLen = aRefInDocCharset.Length();
  PRInt32 dstLen;
  rv = decoder->GetMaxLength(aRefInDocCharset.get(), srcLen, &dstLen);
  if (NS_FAILED(rv)) {
    return rv;
  }

  PRUnichar *ustr = (PRUnichar *)nsMemory::Alloc((dstLen + 1) *
                                                 sizeof(PRUnichar));
  if (!ustr) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  rv = decoder->Convert(aRefInDocCharset.get(), &srcLen, ustr, &dstLen);
  if (NS_SUCCEEDED(rv)) {
    ustr[dstLen] = 0;
    aRefInUnicode.Assign(ustr, dstLen);
  }

  nsMemory::Free(ustr);

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 141 of file nsContentSink.cpp.

  : mNeedToBlockParser(PR_FALSE)
{
}

Variable Documentation

Definition at line 83 of file nsContentSink.cpp.

const PRUnichar kCommaCh = PRUnichar(',') [static]

Definition at line 409 of file nsContentSink.cpp.

Definition at line 410 of file nsContentSink.cpp.

Definition at line 412 of file nsContentSink.cpp.

Definition at line 411 of file nsContentSink.cpp.

const PRUnichar kSemiCh = PRUnichar(';') [static]

Definition at line 408 of file nsContentSink.cpp.