Commit 4764f4e0 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

quota: Remove StaticHostQuota feature flag.

The feature has been enabled by default since
https://crrev.com/c/2090451 which landed in M83. The feature has been
enabled at 100% in Chrome via the field trials infrastructure since
March. At this point, it's fair to expect the feature is here to stay.

This CL cleans up the feature flag. No behavior change is expected.

Change-Id: Ie30a758f453c3a9d9fd96d43ae53d9c3893e0bb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2244654
Commit-Queue: Jarryd Goodman <jarrydg@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: default avatarJarryd Goodman <jarrydg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#778984}
parent ae07653e
...@@ -17,13 +17,6 @@ constexpr base::FeatureParam<double> kExperimentalPoolSizeRatio{ ...@@ -17,13 +17,6 @@ constexpr base::FeatureParam<double> kExperimentalPoolSizeRatio{
constexpr base::FeatureParam<double> kPerHostRatio{&kQuotaExpandPoolSize, constexpr base::FeatureParam<double> kPerHostRatio{&kQuotaExpandPoolSize,
"PerHostRatio", 0.75}; "PerHostRatio", 0.75};
// StaticHostQuota enables a simpler per-host quota model, where the quota is
// only based on disk capacity (partition size). When the flag is disabled, the
// quota computation takes into account free disk space, in addition to the
// disk's total capacity.
const base::Feature kStaticHostQuota{"StaticHostQuota",
base::FEATURE_ENABLED_BY_DEFAULT};
// QuotaUnlimitedPoolSize removes limitations around disk space consumption with // QuotaUnlimitedPoolSize removes limitations around disk space consumption with
// respect to client-side storage web platform APIs. When enabled, quota will // respect to client-side storage web platform APIs. When enabled, quota will
// set no limit on how much space a single origin can consume, as well as // set no limit on how much space a single origin can consume, as well as
......
...@@ -18,9 +18,6 @@ extern const base::Feature kQuotaExpandPoolSize; ...@@ -18,9 +18,6 @@ extern const base::Feature kQuotaExpandPoolSize;
extern const base::FeatureParam<double> kExperimentalPoolSizeRatio; extern const base::FeatureParam<double> kExperimentalPoolSizeRatio;
extern const base::FeatureParam<double> kPerHostRatio; extern const base::FeatureParam<double> kPerHostRatio;
COMPONENT_EXPORT(STORAGE_BROWSER)
extern const base::Feature kStaticHostQuota;
COMPONENT_EXPORT(STORAGE_BROWSER) COMPONENT_EXPORT(STORAGE_BROWSER)
extern const base::Feature kQuotaUnlimitedPoolSize; extern const base::Feature kQuotaUnlimitedPoolSize;
......
...@@ -289,8 +289,6 @@ class QuotaManager::UsageAndQuotaInfoGatherer : public QuotaTask { ...@@ -289,8 +289,6 @@ class QuotaManager::UsageAndQuotaInfoGatherer : public QuotaTask {
if (host_quota > temp_pool_free_space) { if (host_quota > temp_pool_free_space) {
if (is_unlimited_) { if (is_unlimited_) {
host_quota = available_space_ + host_usage_; host_quota = available_space_ + host_usage_;
} else if (!base::FeatureList::IsEnabled(features::kStaticHostQuota)) {
host_quota = temp_pool_free_space + host_usage_;
} }
} }
......
...@@ -1218,39 +1218,6 @@ TEST_F(QuotaManagerTest, GetQuotaLowAvailableDiskSpace) { ...@@ -1218,39 +1218,6 @@ TEST_F(QuotaManagerTest, GetQuotaLowAvailableDiskSpace) {
EXPECT_EQ(kPerHostQuota, quota()); EXPECT_EQ(kPerHostQuota, quota());
} }
TEST_F(QuotaManagerTest,
GetQuotaLowAvailableDiskSpace_StaticHostQuotaDisabled) {
// This test is the same as the previous but with the kStaticHostQuota Finch
// feature disabled.
// Simulating a low available disk space scenario by making
// kMustRemainAvailable 64KB less than GetAvailableDiskSpaceForTest(), which
// means there is 64KB of storage quota that can be used before triggering
// the low available space logic branch in quota_manager.cc. From the
// perspective of QuotaManager, there are 64KB of free space in the temporary
// pool, so it should return (64KB + usage) as quota since the sum is less
// than the default host quota.
scoped_feature_list_.InitAndDisableFeature(features::kStaticHostQuota);
static const MockOriginData kData[] = {
{"http://foo.com/", kTemp, 100000},
{"http://unlimited/", kTemp, 4000000},
};
CreateAndRegisterClient(kData, QuotaClientType::kFileSystem);
const int kPoolSize = 10000000;
const int kPerHostQuota = kPoolSize / 5;
const int kMustRemainAvailable =
static_cast<int>(GetAvailableDiskSpaceForTest() - 65536);
SetQuotaSettings(kPoolSize, kPerHostQuota, kMustRemainAvailable);
GetUsageAndQuotaForWebApps(ToOrigin("http://foo.com/"), kTemp);
task_environment_.RunUntilIdle();
EXPECT_EQ(QuotaStatusCode::kOk, status());
EXPECT_EQ(100000, usage());
EXPECT_GT(kPerHostQuota, quota());
EXPECT_EQ(65536 + usage(), quota());
}
TEST_F(QuotaManagerTest, GetSyncableQuota) { TEST_F(QuotaManagerTest, GetSyncableQuota) {
CreateAndRegisterClient(base::span<MockOriginData>(), CreateAndRegisterClient(base::span<MockOriginData>(),
QuotaClientType::kFileSystem); QuotaClientType::kFileSystem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment