storage: Move testing code from namespace content to storage.
Testing code that was moved from //content to //storage is still under
the content namespace. This is hindering Storage Service-related
refactoring. This CL updates the namespace to reflect the directory
structure.
This CL also makes mechanical code health improvements (such as new ->
base::MakeRefCounted) applied when obvious. clang-tidy improvements are
applied where requested by Tricium.
Bug: 653751
Change-Id: I3d0b5712b531d0d33205ee2a3de3de5dce73e84d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2048986
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Jarryd Goodman <jarrydg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740558}
diff --git a/storage/browser/quota/quota_settings.cc b/storage/browser/quota/quota_settings.cc
index b2210b5..316b2d7 100644
--- a/storage/browser/quota/quota_settings.cc
+++ b/storage/browser/quota/quota_settings.cc
@@ -5,7 +5,9 @@
#include "storage/browser/quota/quota_settings.h"
#include <algorithm>
+#include <limits>
#include <memory>
+#include <utility>
#include "base/bind.h"
#include "base/rand_util.h"
@@ -30,7 +32,7 @@
return value + (value * (random_percent / 100.0));
}
-storage::QuotaSettings CalculateIncognitoDynamicSettings(
+QuotaSettings CalculateIncognitoDynamicSettings(
int64_t physical_memory_amount) {
// The incognito pool size is a fraction of the amount of system memory,
// and the amount is capped to a hard limit.
@@ -47,7 +49,7 @@
RandomizeByPercent(max_incognito_pool_size, kRandomizedPercentage);
}
- storage::QuotaSettings settings;
+ QuotaSettings settings;
settings.pool_size = std::min(
max_incognito_pool_size,
static_cast<int64_t>(physical_memory_amount * incognito_pool_size_ratio));
@@ -57,7 +59,7 @@
return settings;
}
-base::Optional<storage::QuotaSettings> CalculateNominalDynamicSettings(
+base::Optional<QuotaSettings> CalculateNominalDynamicSettings(
const base::FilePath& partition_path,
bool is_incognito,
QuotaDeviceInfoHelper* device_info_helper) {
@@ -118,7 +120,7 @@
const double kSessionOnlyHostQuotaRatio = 0.1; // 10%
const int64_t kMaxSessionOnlyHostQuota = 300 * kMBytes;
- storage::QuotaSettings settings;
+ QuotaSettings settings;
int64_t total = device_info_helper->AmountOfTotalDiskSpace(partition_path);
if (total == -1) {