nsCOMPtr<nsIPref> prefs(do_GetService(kCPrefServiceCID));
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
NS_IMETHODIMP nsBrowserContentHandler::GetDefaultArgs(PRUnichar **aDefaultArgs){  if (!aDefaultArgs)    return NS_ERROR_NULL_POINTER;  nsresult rv;  static PRBool timebombChecked = PR_FALSE;  nsAutoString args;  if (!timebombChecked) {    // timebomb check    timebombChecked = PR_TRUE;    PRBool expired;    nsCOMPtr<nsITimeBomb> timeBomb(do_GetService(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) {      nsXPIDLCString urlString;      rv = timeBomb->GetTimebombURL(getter_Copies(urlString));      if (NS_FAILED(rv)) return rv;      args.AssignWithConversion(urlString);    }  }  if (args.IsEmpty()) {    nsCOMPtr<nsIPref> prefs(do_GetService(kCPrefServiceCID));    if (!prefs) return NS_ERROR_FAILURE;    if (NeedHomepageOverride(prefs)) {      nsXPIDLString url;      rv = prefs->GetLocalizedUnicharPref(PREF_HOMEPAGE_OVERRIDE_URL, getter_Copies(url));      if (NS_SUCCEEDED(rv) && (const PRUnichar *)url) {        args = url;      }    }    if (args.IsEmpty()) {      PRInt32 choice = 0;      rv = prefs->GetIntPref(PREF_BROWSER_STARTUP_PAGE, &choice);      if (NS_SUCCEEDED(rv)) {        switch (choice) {          case 1: {            nsXPIDLString url;            rv = prefs->GetLocalizedUnicharPref(PREF_BROWSER_STARTUP_HOMEPAGE, getter_Copies(url));            args = url;            break;          }          case 2: {            nsCOMPtr<nsIBrowserHistory> history(do_GetService(kCGlobalHistoryCID));            if (history) {              nsXPIDLCString curl;              rv = history->GetLastPageVisited(getter_Copies(curl));              args.AssignWithConversion(curl);            }            break;          }          case 0:          default:            // fall through to about:blank below            break;        }      }      // the default, in case we fail somewhere      if (args.IsEmpty())        args.Assign(NS_LITERAL_STRING("about:blank"));    }  }  *aDefaultArgs = args.ToNewUnicode();  return NS_OK;}