Skip to content

Commit ae22ab0

Browse files
author
Cristian Tuns
committed
Revert "Bug 1781277: Implement DiskStorageLimit RFP target. r=tjr,dom-storage-reviewers,asuth" for causing xpcshell failures in test_temporaryStorageRFP.js
This reverts commit 7a92b22.
1 parent 1f3cbcb commit ae22ab0

File tree

7 files changed

+4
-103
lines changed

7 files changed

+4
-103
lines changed

dom/quota/ActorsParent.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,12 +1332,6 @@ void GetJarPrefix(bool aInIsolatedMozBrowser, nsACString& aJarPrefix) {
13321332
// This method computes and returns our best guess for the temporary storage
13331333
// limit (in bytes), based on disk capacity.
13341334
Result<uint64_t, nsresult> GetTemporaryStorageLimit(nsIFile& aStorageDir) {
1335-
if (nsContentUtils::ShouldResistFingerprinting(
1336-
"The storage limit is set only once and not webpage specific.",
1337-
RFPTarget::DiskStorageLimit)) {
1338-
return nsRFPService::GetSpoofedStorageLimit();
1339-
}
1340-
13411335
// The fixed limit pref can be used to override temporary storage limit
13421336
// calculation.
13431337
if (StaticPrefs::dom_quotaManager_temporaryStorage_fixedLimit() >= 0) {
@@ -7513,21 +7507,17 @@ void QuotaManager::SetThumbnailPrivateIdentityId(
75137507
}
75147508
}
75157509

7516-
/* static */
7517-
uint64_t QuotaManager::GetGroupLimitForLimit(uint64_t aLimit) {
7510+
uint64_t QuotaManager::GetGroupLimit() const {
75187511
// To avoid one group evicting all the rest, limit the amount any one group
75197512
// can use to 20% resp. a fifth. To prevent individual sites from using
75207513
// exorbitant amounts of storage where there is a lot of free space, cap the
75217514
// group limit to 10GB.
7522-
const auto x = std::min<uint64_t>(aLimit / 5, 10 GB);
7515+
const auto x = std::min<uint64_t>(mTemporaryStorageLimit / 5, 10 GB);
75237516

75247517
// In low-storage situations, make an exception (while not exceeding the total
75257518
// storage limit).
7526-
return std::min<uint64_t>(aLimit, std::max<uint64_t>(x, 10 MB));
7527-
}
7528-
7529-
uint64_t QuotaManager::GetGroupLimit() const {
7530-
return GetGroupLimitForLimit(mTemporaryStorageLimit);
7519+
return std::min<uint64_t>(mTemporaryStorageLimit,
7520+
std::max<uint64_t>(x, 10 MB));
75317521
}
75327522

75337523
Maybe<OriginStateMetadata> QuotaManager::GetOriginStateMetadata(

dom/quota/QuotaManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ class QuotaManager final : public BackgroundThreadObject {
681681
void SetThumbnailPrivateIdentityId(uint32_t aThumbnailPrivateIdentityId);
682682

683683
uint64_t GetGroupLimit() const;
684-
static uint64_t GetGroupLimitForLimit(uint64_t aLimit);
685684

686685
Maybe<OriginStateMetadata> GetOriginStateMetadata(
687686
const OriginMetadata& aOriginMetadata);

dom/quota/test/xpcshell/test_temporaryStorageRFP.js

Lines changed: 0 additions & 68 deletions
This file was deleted.

dom/quota/test/xpcshell/xpcshell.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,3 @@ run-if = ["!condprof"]
170170
support-files = ["unsetLastAccessTime_profile.zip"]
171171

172172
["test_validOrigins.js"]
173-
174-
["test_temporaryStorageRFP.js"]

toolkit/components/resistfingerprinting/RFPTargets.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ ITEM_VALUE(WebGPUSubgroupSizes, 66)
100100
ITEM_VALUE(JSLocalePrompt, 67)
101101
ITEM_VALUE(ScreenAvailToResolution, 68)
102102
ITEM_VALUE(UseHardcodedFontSubstitutes, 69)
103-
ITEM_VALUE(DiskStorageLimit, 70)
104103

105104

106105
// !!! Don't forget to update kDefaultFingerprintingProtections in nsRFPService.cpp

toolkit/components/resistfingerprinting/nsRFPService.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
#include "mozilla/dom/KeyboardEventBinding.h"
5454
#include "mozilla/dom/WindowGlobalParent.h"
5555
#include "mozilla/dom/MediaDeviceInfoBinding.h"
56-
#include "mozilla/dom/quota/QuotaManager.h"
5756
#include "mozilla/fallible.h"
5857
#include "mozilla/XorShift128PlusRNG.h"
5958
#include "mozilla/dom/CanvasUtils.h"
@@ -2688,17 +2687,3 @@ CSSIntRect nsRFPService::GetSpoofedScreenAvailSize(const nsRect& aRect,
26882687
return CSSIntRect::FromAppUnitsRounded(
26892688
nsRect{0, 0, aRect.width, aRect.height - spoofedHeightOffset});
26902689
}
2691-
2692-
/* static */
2693-
uint64_t nsRFPService::GetSpoofedStorageLimit() {
2694-
uint64_t gib = 1024ULL * 1024ULL * 1024ULL; // 1 GiB
2695-
#ifdef ANDROID
2696-
uint64_t limit = 32ULL * gib; // 32 GiB
2697-
#else
2698-
uint64_t limit = 50ULL * gib; // 50 GiB
2699-
#endif
2700-
MOZ_ASSERT(limit / 5 ==
2701-
dom::quota::QuotaManager::GetGroupLimitForLimit(limit));
2702-
2703-
return limit;
2704-
}

toolkit/components/resistfingerprinting/nsRFPService.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,6 @@ class nsRFPService final : public nsIObserver, public nsIRFPService {
414414
static CSSIntRect GetSpoofedScreenAvailSize(const nsRect& aRect, float aScale,
415415
bool aIsFullscreen);
416416

417-
static uint64_t GetSpoofedStorageLimit();
418-
419417
private:
420418
nsresult Init();
421419

0 commit comments

Comments
 (0)