rv = history->GetLastPageVisted(getter_Copies(curl));
rv = history->GetLastPageVisited(getter_Copies(curl));
NS_IMETHODIMP nsBrowserContentHandler::GetDefaultArgs(PRUnichar **aDefaultArgs) {     if (!aDefaultArgs) return NS_ERROR_FAILURE;     nsString args;    nsresult rv;    nsXPIDLString url;    static PRBool timebombChecked = PR_FALSE;    if (timebombChecked == PR_FALSE)    {        // timebomb check        timebombChecked = PR_TRUE;                PRBool expired;        NS_WITH_SERVICE(nsITimeBomb, timeBomb, kTimeBombCID, &rv);        if ( NS_FAILED(rv) ) return rv;         rv = timeBomb->Init();        if ( NS_FAILED(rv) ) return rv;         rv = timeBomb->CheckWithUI(&expired);        if ( NS_FAILED(rv) ) return rv;         if ( expired )         {            char* urlString;            rv = timeBomb->GetTimebombURL(&urlString);            if ( NS_FAILED(rv) ) return rv;            *aDefaultArgs =  nsXPIDLString::Copy(url);            nsMemory::Free(urlString);            return rv;        }    }    /* the default, in case we fail somewhere */    args.AssignWithConversion("about:blank");    nsCOMPtr<nsIPref> prefs(do_GetService(kCPrefServiceCID));    if (!prefs) return NS_ERROR_FAILURE;    nsCOMPtr<nsIGlobalHistory> history(do_GetService(kCGlobalHistoryCID));    PRBool override = PR_FALSE;    rv = prefs->GetBoolPref(PREF_HOMEPAGE_OVERRIDE, &override);    if (NS_SUCCEEDED(rv) && override) {        rv = prefs->GetLocalizedUnicharPref(PREF_HOMEPAGE_OVERRIDE_URL, getter_Copies(url));        if (NS_SUCCEEDED(rv) && (const PRUnichar *)url) {            rv = prefs->SetBoolPref(PREF_HOMEPAGE_OVERRIDE, PR_FALSE);        }    }        nsAutoString tmp(url);    if (!url || !tmp.Length()) {        PRInt32 choice = 0;        rv = prefs->GetIntPref(PREF_BROWSER_STARTUP_PAGE, &choice);        if (NS_SUCCEEDED(rv)) {            switch (choice) {                case 1:                    rv = prefs->GetLocalizedUnicharPref(PREF_BROWSER_STARTUP_HOMEPAGE, getter_Copies(url));                    tmp = url;                    break;                case 2:                    if (history) {                        nsXPIDLCString curl;                        rv = history->GetLastPageVisted(getter_Copies(curl));                        tmp = NS_ConvertUTF8toUCS2((const char *)curl);                    }                    break;                case 0:                default:                    args.AssignWithConversion("about:blank");                    break;            }        }    }    if (NS_SUCCEEDED(rv) && tmp.Length()) {                      args = tmp;    }    *aDefaultArgs = args.ToNewUnicode();     return NS_OK;}