nsCOMPtr<nsIPresContext> presContext; presShell->GetPresContext(getter_AddRefs(presContext)); if (!presContext) return;
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));  nsCOMPtr<nsIPresShell> presShell(getter_AddRefs(GetPresShellFor(docShell)));  if (!presShell) return;  nsCOMPtr<nsIPresContext> presContext;  presShell->GetPresContext(getter_AddRefs(presContext));  if (!presContext) return;  nsCOMPtr<nsIDocument> doc;  presShell->GetDocument(getter_AddRefs(doc));  if (!doc) return;  doc->GetRootContent(aContent); // this addrefs  *aPresShell = presShell.get();  NS_ADDREF(*aPresShell);}