Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Unified Diff: content/browser/indexed_db/indexed_db_browsertest.cc

Issue 1782053004: Change how the quota system computes the total poolsize for temporary storage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/indexed_db_browsertest.cc
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc
index 52b1192a6e537513b0a895fb967da0c6ef0b4187..94265846b4f05dbb6c18c31d79a1446e61b26aa7 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -122,27 +122,29 @@ class IndexedDBBrowserTest : public ContentBrowserTest,
return static_cast<IndexedDBContextImpl*>(partition->GetIndexedDBContext());
}
- void SetQuota(int quota_kilobytes) {
- const int kTemporaryStorageQuotaSize =
- quota_kilobytes * 1024 * QuotaManager::kPerHostTemporaryPortion;
- SetTempQuota(kTemporaryStorageQuotaSize,
+ void SetQuota(int per_host_quota_kilobytes) {
+ SetTempQuota(per_host_quota_kilobytes,
BrowserContext::GetDefaultStoragePartition(
shell()->web_contents()->GetBrowserContext())->GetQuotaManager());
}
- static void SetTempQuota(int64_t bytes, scoped_refptr<QuotaManager> qm) {
+ static void SetTempQuota(int per_host_quota_kilobytes,
+ scoped_refptr<QuotaManager> qm) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- base::Bind(&IndexedDBBrowserTest::SetTempQuota, bytes, qm));
+ base::Bind(&IndexedDBBrowserTest::SetTempQuota,
+ per_host_quota_kilobytes, qm));
return;
}
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- qm->SetTemporaryGlobalOverrideQuota(bytes, storage::QuotaCallback());
- // Don't return until the quota has been set.
- scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
- BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)));
- ASSERT_TRUE(helper->Run());
+ const int KB = 1024;
+ storage::TemporaryStorageConfiguration config;
+ config.per_host_quota = per_host_quota_kilobytes * KB;
+ config.pool_size = config.per_host_quota * 5;
+ config.must_remain_available = 100 * KB * KB;
+ config.refresh_interval = base::TimeDelta::Max();
+ qm->SetTemporaryStorageConfiguration(config);
}
virtual int64_t RequestDiskUsage() {

Powered by Google App Engine
This is Rietveld 408576698