nsXULTemplateBuilder::Init(nsIContent* aElement) { NS_PRECONDITION(aElement, "null ptr"); mRoot = aElement;  nsCOMPtr<nsIDocument> doc = mRoot->GetDocument(); NS_ASSERTION(doc, "element has no document"); if (! doc) return NS_ERROR_UNEXPECTED;  nsresult rv = LoadDataSources(doc);  if (NS_SUCCEEDED(rv)) {  doc->AddObserver(this); }  return rv; }
Init() { PL_DHashTableInit(&mTable, PL_DHashGetStubOps(), nsnull, sizeof(Entry), PL_DHASH_MIN_SIZE); }
nsXULTemplateBuilder::Init(nsIContent* aElement){    NS_PRECONDITION(aElement, "null ptr");    mRoot = aElement;    nsCOMPtr<nsIDocument> doc = mRoot->GetDocument();    NS_ASSERTION(doc, "element has no document");    if (! doc)        return NS_ERROR_UNEXPECTED;    nsresult rv = LoadDataSources(doc);    if (NS_SUCCEEDED(rv)) {        // Add ourselves as a document observer        doc->AddObserver(this);    }    return rv;}