nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID, &rv);
nsCachePrefObserver::Install(){    nsresult rv, rv2;    nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);    if (NS_FAILED(rv)) return rv;    nsCOMPtr<nsIPrefBranchInternal> prefInternal = do_QueryInterface(prefs, &rv);    if (NS_FAILED(rv)) return rv;    rv = prefInternal->AddObserver(ENABLE_MEMORY_CACHE_PREF, this);    if (NS_FAILED(rv)) rv2 = rv;    rv = prefInternal->AddObserver(ENABLE_DISK_CACHE_PREF, this);    if (NS_FAILED(rv)) rv2 = rv;    nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(prefs, &rv);    if (NS_FAILED(rv)) return rv;    rv = prefBranch->GetBoolPref(ENABLE_DISK_CACHE_PREF, &mDiskCacheEnabled);    if (NS_FAILED(rv)) rv2 = rv;    rv = prefBranch->GetBoolPref(ENABLE_MEMORY_CACHE_PREF, &mMemoryCacheEnabled);    // if (NS_FAILED(rv)) rv2 = rv;    if (NS_SUCCEEDED(rv)) rv = rv2;    return rv;}