nsCOMPtr<nsIObserver> observer = do_QueryInterface(mPrefService, &rv); if (NS_SUCCEEDED(rv)) rv = observer->Observe(aSubject, aTopic, someData); return rv;
if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-before-change").get())) { if (!nsCRT::strcmp(someData, NS_LITERAL_STRING("shutdown-cleanse").get())) { if (mFileSpec) { mFileSpec->Delete(PR_FALSE); NS_RELEASE(mFileSpec); } } else rv = SavePrefFile(); } else if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-do-change").get())) { PREF_ClearAllUserPrefs(); rv = ReadUserPrefs(); } return rv;
NS_IMETHODIMP nsPref::Observe(nsISupports *aSubject, const PRUnichar *aTopic, const PRUnichar *someData){  nsresult rv;  nsCOMPtr<nsIObserver> observer = do_QueryInterface(mPrefService, &rv);  if (NS_SUCCEEDED(rv))    rv = observer->Observe(aSubject, aTopic, someData);  return rv;}