doc->GetRootContent(aContent); *aPresShell = presShell; NS_ADDREF(*aPresShell);
NS_IF_ADDREF(*aContent = doc->GetRootContent()); NS_ADDREF(*aPresShell = presShell);
DocumentViewerImpl::GetPresShellAndRootContent(nsIWebShell *  aWebShell,                                               nsIPresShell** aPresShell,                                               nsIContent**   aContent){  NS_ASSERTION(aWebShell, "Pointer is null!");  NS_ASSERTION(aPresShell, "Pointer is null!");  NS_ASSERTION(aContent, "Pointer is null!");  *aContent   = nsnull;  *aPresShell = nsnull;  nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aWebShell));  nsIPresShell *presShell = GetPresShellFor(docShell);  if (!presShell)    return;  nsCOMPtr<nsIDocument> doc;  presShell->GetDocument(getter_AddRefs(doc));  if (!doc)    return;  doc->GetRootContent(aContent); // this addrefs  *aPresShell = presShell;  NS_ADDREF(*aPresShell);}