res = InitBrowserMoreXMenu(rdfServ, ccMan, decs); NS_ASSERTION(NS_SUCCEEDED(res), "error initializing browser static X charset menu");  res = InitMoreMenu(rdfServ, ccMan, decs, kNC_BrowserMoreCharsetMenuRoot, ".notForBrowser"); NS_ASSERTION(NS_SUCCEEDED(res), "error initializing browser more charset menu");
res = mPrefService->AddObserver(kBrowserStaticPrefKey, mCharsetMenuObserver);
nsresult nsCharsetMenu::InitBrowserMenu() {  nsresult res = NS_OK;  NS_WITH_SERVICE(nsIRDFService, rdfServ, kRDFServiceCID, &res);  if (NS_FAILED(res)) return res;  NS_WITH_SERVICE(nsICharsetConverterManager2, ccMan, kCharsetConverterManagerCID, &res);  if (NS_FAILED(res)) return res;  nsCOMPtr<nsISupportsArray> decs;  res = ccMan->GetDecoderList(getter_AddRefs(decs));  if (NS_FAILED(res)) return res;  NS_WITH_SERVICE(nsIPref, pref, NS_PREF_PROGID, &res);  if (NS_FAILED(res)) return res;  // even if we fail, the show must go on  char * prefKey = "intl.charsetmenu.browser.static";  res = InitStaticMenu(rdfServ, ccMan, pref, decs, kNC_BrowserCharsetMenuRoot,     prefKey, &mBrowserMenu);  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing browser static charset menu");  // mark the end of the static area, the rest is cache  mBrowserCacheStart = mBrowserMenu.Count();  char * prefKey2 = "intl.charsetmenu.browser.cache";  res = InitCacheMenu(rdfServ, ccMan, pref, decs, kNC_BrowserCharsetMenuRoot,     prefKey2, &mBrowserMenu);  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing browser cache charset menu");  res = InitBrowserMoreXMenu(rdfServ, ccMan, decs);  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing browser static X charset menu");  res = InitMoreMenu(rdfServ, ccMan, decs, kNC_BrowserMoreCharsetMenuRoot, ".notForBrowser");  NS_ASSERTION(NS_SUCCEEDED(res), "error initializing browser more charset menu");  return res;}