PR_AtomicIncrement(&g_InstanceCount); NS_INIT_REFCNT();  NS_WITH_SERVICE(nsIPrefService, pService, NS_PREFSERVICE_CONTRACTID, &rv); mPrefService = pService;  mPrefService->GetDefaultBranch("", &pBranch); mDefaultBranch = (nsIPrefBranch *)pBranch;
nsresult rv; NS_WITH_SERVICE(nsIObserverService, observerService, NS_OBSERVERSERVICE_CONTRACTID, &rv); if (observerService) {  ++mRefCnt; rv = observerService->AddObserver(this, NS_LITERAL_STRING("profile-before-change").get()); rv = observerService->AddObserver(this, NS_LITERAL_STRING("profile-do-change").get()); --mRefCnt; }
nsPref::nsPref()//----------------------------------------------------------------------------------------{  nsIPrefBranch *pBranch;  nsresult     rv;  PR_AtomicIncrement(&g_InstanceCount);  NS_INIT_REFCNT();  NS_WITH_SERVICE(nsIPrefService, pService, NS_PREFSERVICE_CONTRACTID, &rv);  mPrefService = pService;  mPrefService->GetDefaultBranch("", &pBranch);  mDefaultBranch = (nsIPrefBranch *)pBranch;}