Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsDOMDocumentType.h File Reference
#include "nsCOMPtr.h"
#include "nsIDOMDocumentType.h"
#include "nsIContent.h"
#include "nsGenericDOMDataNode.h"
#include "nsString.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  nsDOMDocumentType

Functions

nsresult NS_NewDOMDocumentType (nsIDOMDocumentType **aDocType, nsNodeInfoManager *aOwnerDoc, nsIPrincipal *aPrincipal, nsIAtom *aName, nsIDOMNamedNodeMap *aEntities, nsIDOMNamedNodeMap *aNotations, const nsAString &aPublicId, const nsAString &aSystemId, const nsAString &aInternalSubset)

Function Documentation

nsresult NS_NewDOMDocumentType ( nsIDOMDocumentType **  aDocType,
nsNodeInfoManager aOwnerDoc,
nsIPrincipal aPrincipal,
nsIAtom aName,
nsIDOMNamedNodeMap aEntities,
nsIDOMNamedNodeMap aNotations,
const nsAString &  aPublicId,
const nsAString &  aSystemId,
const nsAString &  aInternalSubset 
)

Definition at line 49 of file nsDOMDocumentType.cpp.

{
  NS_PRECONDITION(aNodeInfoManager || aPrincipal,
                  "Must have a principal if no nodeinfo manager.");
  NS_ENSURE_ARG_POINTER(aDocType);
  NS_ENSURE_ARG_POINTER(aName);

  nsresult rv;

  nsRefPtr<nsNodeInfoManager> nimgr;
  if (aNodeInfoManager) {
    nimgr = aNodeInfoManager;
  }
  else {
    nimgr = new nsNodeInfoManager();
    NS_ENSURE_TRUE(nimgr, NS_ERROR_OUT_OF_MEMORY);
    
    rv = nimgr->Init(nsnull);
    NS_ENSURE_SUCCESS(rv, rv);

    nimgr->SetDocumentPrincipal(aPrincipal);
  }

  *aDocType = new nsDOMDocumentType(nimgr, aName, aEntities, aNotations,
                                    aPublicId, aSystemId, aInternalSubset);
  if (!*aDocType) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  NS_ADDREF(*aDocType);

  return NS_OK;
}

Here is the call graph for this function: