nsresult rv;
NS_ENSURE_ARG_POINTER(domain); NS_ENSURE_ARG_POINTER(observer);  nsresult rv = NS_OK; if (!mObservers) { rv = NS_NewISupportsArray(getter_AddRefs(mObservers)); NS_ENSURE_SUCCESS(rv, rv); }
NS_IMETHODIMP nsPref::AddObserver(const char *aDomain, nsIObserver *aObserver){  nsresult rv;  nsCOMPtr<nsIPrefBranchInternal> prefBranch = do_QueryInterface(mPrefService, &rv);  if (NS_SUCCEEDED(rv))    rv = prefBranch->AddObserver(aDomain, aObserver);  return rv;}