NS_ENSURE_ARG_POINTER(aChild);  if(mChildren.RemoveElement(aChild)) { NS_ENSURE_SUCCESS(aChild->SetParent(nsnull), NS_ERROR_FAILURE); NS_RELEASE(aChild); } else NS_ENSURE_TRUE(PR_FALSE, NS_ERROR_INVALID_ARG);  return NS_OK;
NS_ENSURE_ARG(aChild); nsCOMPtr<nsIDocShellTreeItem> treeItemChild(do_QueryInterface(aChild)); return RemoveChild(treeItemChild);
NS_IMETHODIMP nsWebShell::RemoveChild(nsIDocShellTreeItem *aChild){   NS_ENSURE_ARG_POINTER(aChild);   if(mChildren.RemoveElement(aChild))      {      NS_ENSURE_SUCCESS(aChild->SetParent(nsnull), NS_ERROR_FAILURE);      NS_RELEASE(aChild);      }   else      NS_ENSURE_TRUE(PR_FALSE, NS_ERROR_INVALID_ARG);   return NS_OK;}