res = nsServiceManager::GetService(kRDFServiceCID, kIRDFServiceIID, (nsISupports **)&rdfServ); if (NS_FAILED(res)) goto done;
if (!mInitialized)  {
nsresult nsCharsetMenu::Init() {  nsresult res = NS_OK;  nsIRDFService * rdfServ = NULL;  nsIRDFContainerUtils * rdfUtil = NULL;  res = nsServiceManager::GetService(kRDFServiceCID, kIRDFServiceIID,       (nsISupports **)&rdfServ);  if (NS_FAILED(res)) goto done;  rdfServ->GetResource(kURINC_BrowserCharsetMenuRoot, &kNC_BrowserCharsetMenuRoot);  rdfServ->GetResource(kURINC_BrowserMoreCharsetMenuRoot, &kNC_BrowserMoreCharsetMenuRoot);  rdfServ->GetResource(kURINC_Name, &kNC_Name);  rdfServ->GetResource(kURINC_Checked, &kNC_Checked);  res = nsComponentManager::CreateInstance(kRDFInMemoryDataSourceCID, nsnull,     kIRDFDataSourceIID, (void**) &mInner);  if (NS_FAILED(res)) goto done;  res = nsServiceManager::GetService(kRDFContainerUtilsCID,       kIRDFContainerUtilsIID, (nsISupports **)&rdfUtil);  if (NS_FAILED(res)) goto done;  res = rdfUtil->MakeSeq(mInner, kNC_BrowserCharsetMenuRoot, NULL);  if (NS_FAILED(res)) goto done;  res = rdfUtil->MakeSeq(mInner, kNC_BrowserMoreCharsetMenuRoot, NULL);  if (NS_FAILED(res)) goto done;  res = rdfServ->RegisterDataSource(this, PR_FALSE);done:  if (rdfServ != NULL) nsServiceManager::ReleaseService(kRDFServiceCID,       rdfServ);  if (rdfUtil != NULL) nsServiceManager::ReleaseService(kRDFContainerUtilsCID,       rdfUtil);  return res;}