Commit 31f17812 authored by Caitlin Fischer's avatar Caitlin Fischer Committed by Commit Bot

Quota: Clean up QuotaExpandPoolSize feature.

Bug: 1126640
Change-Id: Ibb6fd1bcea8aae9878051fa4b50bcbff87ba3ca7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2436549Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarJarryd Goodman <jarrydg@chromium.org>
Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
Cr-Commit-Position: refs/heads/master@{#811639}
parent a7d1d438
...@@ -8,15 +8,6 @@ namespace storage { ...@@ -8,15 +8,6 @@ namespace storage {
namespace features { namespace features {
const base::Feature kQuotaExpandPoolSize{"QuotaExpandPoolSize",
base::FEATURE_ENABLED_BY_DEFAULT};
constexpr base::FeatureParam<double> kExperimentalPoolSizeRatio{
&kQuotaExpandPoolSize, "PoolSizeRatio", 0.8};
constexpr base::FeatureParam<double> kPerHostRatio{&kQuotaExpandPoolSize,
"PerHostRatio", 0.75};
// 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
......
...@@ -13,11 +13,6 @@ namespace storage { ...@@ -13,11 +13,6 @@ namespace storage {
namespace features { namespace features {
COMPONENT_EXPORT(STORAGE_BROWSER)
extern const base::Feature kQuotaExpandPoolSize;
extern const base::FeatureParam<double> kExperimentalPoolSizeRatio;
extern const base::FeatureParam<double> kPerHostRatio;
COMPONENT_EXPORT(STORAGE_BROWSER) COMPONENT_EXPORT(STORAGE_BROWSER)
extern const base::Feature kQuotaUnlimitedPoolSize; extern const base::Feature kQuotaUnlimitedPoolSize;
......
...@@ -26,6 +26,8 @@ namespace { ...@@ -26,6 +26,8 @@ namespace {
const int64_t kMBytes = 1024 * 1024; const int64_t kMBytes = 1024 * 1024;
const int kRandomizedPercentage = 10; const int kRandomizedPercentage = 10;
const double kDefaultPerHostRatio = 0.75;
const double kDefaultPoolSizeRatio = 0.8;
// Skews |value| by +/- |percent|. // Skews |value| by +/- |percent|.
int64_t RandomizeByPercent(int64_t value, int percent) { int64_t RandomizeByPercent(int64_t value, int percent) {
...@@ -77,7 +79,7 @@ base::Optional<QuotaSettings> CalculateNominalDynamicSettings( ...@@ -77,7 +79,7 @@ base::Optional<QuotaSettings> CalculateNominalDynamicSettings(
const double kTemporaryPoolSizeRatio = const double kTemporaryPoolSizeRatio =
base::FeatureList::IsEnabled(features::kQuotaUnlimitedPoolSize) base::FeatureList::IsEnabled(features::kQuotaUnlimitedPoolSize)
? 1.0 ? 1.0
: features::kExperimentalPoolSizeRatio.Get(); : kDefaultPoolSizeRatio;
// The amount of the device's storage the browser attempts to // The amount of the device's storage the browser attempts to
// keep free. If there is less than this amount of storage free // keep free. If there is less than this amount of storage free
...@@ -114,7 +116,7 @@ base::Optional<QuotaSettings> CalculateNominalDynamicSettings( ...@@ -114,7 +116,7 @@ base::Optional<QuotaSettings> CalculateNominalDynamicSettings(
const double kPerHostTemporaryRatio = const double kPerHostTemporaryRatio =
base::FeatureList::IsEnabled(features::kQuotaUnlimitedPoolSize) base::FeatureList::IsEnabled(features::kQuotaUnlimitedPoolSize)
? 1.0 ? 1.0
: features::kPerHostRatio.Get(); : kDefaultPerHostRatio;
// SessionOnly (or ephemeral) origins are allotted a fraction of what // SessionOnly (or ephemeral) origins are allotted a fraction of what
// normal origins are provided, and the amount is capped to a hard limit. // normal origins are provided, and the amount is capped to a hard limit.
......
...@@ -140,29 +140,6 @@ TEST_F(QuotaSettingsTest, Default) { ...@@ -140,29 +140,6 @@ TEST_F(QuotaSettingsTest, Default) {
EXPECT_TRUE(callback_executed); EXPECT_TRUE(callback_executed);
} }
TEST_F(QuotaSettingsTest, ExpandedTempPool) {
MockQuotaDeviceInfoHelper device_info_helper;
ON_CALL(device_info_helper, AmountOfTotalDiskSpace(_))
.WillByDefault(::testing::Return(2000));
scoped_feature_list_.InitAndEnableFeatureWithParameters(
features::kQuotaExpandPoolSize,
{{"PoolSizeRatio", "0.75"}, {"PerHostRatio", "0.5"}});
bool callback_executed = false;
GetNominalDynamicSettings(
profile_path(), false, &device_info_helper,
base::BindLambdaForTesting([&](base::Optional<QuotaSettings> settings) {
callback_executed = true;
ASSERT_NE(settings, base::nullopt);
// 1500 = 2000 * PoolSizeRatio
EXPECT_EQ(settings->pool_size, 1500);
// 750 = 1500 * PerHostRatio
EXPECT_EQ(settings->per_host_quota, 750);
}));
task_environment_.RunUntilIdle();
EXPECT_TRUE(callback_executed);
}
TEST_F(QuotaSettingsTest, UnlimitedTempPool) { TEST_F(QuotaSettingsTest, UnlimitedTempPool) {
MockQuotaDeviceInfoHelper device_info_helper; MockQuotaDeviceInfoHelper device_info_helper;
ON_CALL(device_info_helper, AmountOfTotalDiskSpace(_)) ON_CALL(device_info_helper, AmountOfTotalDiskSpace(_))
......
...@@ -5778,30 +5778,6 @@ ...@@ -5778,30 +5778,6 @@
] ]
} }
], ],
"QuotaExpandPoolSize": [
{
"platforms": [
"android",
"android_weblayer",
"chromeos",
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Enabled_Pool_Four_Fifths_Origin_ThreeQuarters_20190710",
"params": {
"PerHostRatio": "0.75",
"PoolSizeRatio": "0.8"
},
"enable_features": [
"QuotaExpandPoolSize"
]
}
]
}
],
"ReleaseNotesNotification": [ "ReleaseNotesNotification": [
{ {
"platforms": [ "platforms": [
......
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