mMemoryCacheCapacity = (PRUint32) PR_MAX(0, capacity);
mMemoryCacheCapacity = PR_MAX(0, capacity);
nsCacheProfilePrefObserver::ReadPrefs(){    nsresult rv, rv2 = NS_OK;    PRInt32 capacity = 0;    nsCOMPtr<nsIPrefService> prefService = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);    if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(prefService, &rv);    if (NS_FAILED(rv))  return rv;    // read disk cache device prefs    rv = prefBranch->GetBoolPref(DISK_CACHE_ENABLE_PREF, &mDiskCacheEnabled);    if (NS_FAILED(rv)) rv2 = rv;    rv = prefBranch->GetIntPref(DISK_CACHE_CAPACITY_PREF, &capacity);    if (NS_FAILED(rv)) rv2 = rv;    mDiskCacheCapacity = (PRUint32) PR_MAX(0, capacity);    (void) prefBranch->GetComplexValue(DISK_CACHE_DIR_PREF,     // ignore error                                     NS_GET_IID(nsILocalFile),                                     getter_AddRefs(mDiskCacheParentDirectory));        if (!mDiskCacheParentDirectory) {        nsCOMPtr<nsIFile>  directory;        // try to get the profile directory (there may not be a profile yet)        rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(directory));#if DEBUG        if (NS_FAILED(rv)) {            // use current process directory during development            rv = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR, getter_AddRefs(directory));        }#endif        if (directory)            mDiskCacheParentDirectory = do_QueryInterface(directory, &rv);    }        // read memory cache device prefs    rv = prefBranch->GetBoolPref(MEMORY_CACHE_ENABLE_PREF, &mMemoryCacheEnabled);    if (NS_FAILED(rv)) rv2 = rv;        capacity = 0;    rv = prefBranch->GetIntPref(MEMORY_CACHE_CAPACITY_PREF, &capacity);    mMemoryCacheCapacity = (PRUint32) PR_MAX(0, capacity);            return NS_SUCCEEDED(rv) ? rv2 : rv;}