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

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 3 years, 10 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 8c151a35513f9114b7306dbb911c10ee50170ce3..f4e7668c24615722a82f6fe7c73ed192548395d6 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -122,27 +122,25 @@ 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,
- BrowserContext::GetDefaultStoragePartition(
- shell()->web_contents()->GetBrowserContext())->GetQuotaManager());
+ 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));
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ 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;
+ qm->SetQuotaSettings(
+ storage::GetHardCodedSettings(per_host_quota_kilobytes * KB));
}
virtual int64_t RequestDiskUsage() {
« no previous file with comments | « content/browser/fileapi/obfuscated_file_util_unittest.cc ('k') | content/browser/quota/mock_quota_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698