NS_ADDREF(*aLayoutHistoryState);
nsWebShell::GetHistoryState(nsISupports** aLayoutHistoryState){  nsresult rv = NS_OK;  // XXX Need to think about what to do for framesets.  // For now, return an error if this webshell  // contains a frame or a frameset document.  // The main content area will always have a parent. It is  // enough to check the children count to verify frames.  if (mChildren.Count() > 0) {    return NS_ERROR_NOT_IMPLEMENTED;  }  // Ask the pres shell for the history state  if (mContentViewer) {    nsCOMPtr<nsIDocumentViewer> docv = do_QueryInterface(mContentViewer);    if (nsnull != docv) {      nsCOMPtr<nsIPresShell> shell;      rv = docv->GetPresShell(*getter_AddRefs(shell));      if (NS_SUCCEEDED(rv)) {        rv = shell->GetHistoryState((nsILayoutHistoryState**) aLayoutHistoryState);      }    }  }  return rv;}