if (NS_FAILED(rv)) return rv;  rv = result->RestoreLastPageVisited();
NS_NewGlobalHistory(nsISupports* aOuter, REFNSIID aIID, void** aResult){  NS_PRECONDITION(aResult != nsnull, "null ptr");  if (! aResult)    return NS_ERROR_NULL_POINTER;  NS_PRECONDITION(aOuter == nsnull, "no aggregation");  if (aOuter)    return NS_ERROR_NO_AGGREGATION;  nsresult rv = NS_OK;  nsGlobalHistory* result = new nsGlobalHistory();  if (! result)    return NS_ERROR_OUT_OF_MEMORY;  rv = result->Init();  if (NS_SUCCEEDED(rv))    rv = result->QueryInterface(aIID, aResult);  if (NS_FAILED(rv)) {    delete result;    *aResult = nsnull;    return rv;  }  return rv;}