nsCOMPtr<nsIPrefBranchInternal> prefBranch = do_QueryInterface(mPrefService, &rv); if (NS_SUCCEEDED(rv)) rv = prefBranch->RemoveObserver(aDomain, aObserver); return rv;
nsresult rv;  if (!mObservers) return NS_OK;    PRUint32 count; rv = mObservers->Count(&count); if (NS_FAILED(rv)) return NS_OK;  PRUint32 i; nsCOMPtr<nsIObserver> obs; nsCAutoString domain; for (i=0; i< count; i++) { rv = mObservers->QueryElementAt(i, NS_GET_IID(nsIObserver), getter_AddRefs(obs)); if (NS_SUCCEEDED(rv) && obs.get() == aObserver) { mObserverDomains.CStringAt(i, domain); if (domain.Equals(aDomain)) break; } }  if (i == count) return NS_OK;   obs = nsnull;  mObservers->RemoveElementAt(i); mObserverDomains.RemoveCStringAt(i);  return UnregisterCallback(aDomain, NotifyObserver, aObserver);
NS_IMETHODIMP nsPref::RemoveObserver(const char *aDomain, nsIObserver *aObserver){  nsresult rv;  nsCOMPtr<nsIPrefBranchInternal> prefBranch = do_QueryInterface(mPrefService, &rv);  if (NS_SUCCEEDED(rv))    rv = prefBranch->RemoveObserver(aDomain, aObserver);  return rv;}