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

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

Issue 2592793002: Revert of Change how the quota system computes the total poolsize for temporary storage (Closed)
Patch Set: Created 4 years 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 f4e7668c24615722a82f6fe7c73ed192548395d6..8c151a35513f9114b7306dbb911c10ee50170ce3 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -122,25 +122,27 @@ class IndexedDBBrowserTest : public ContentBrowserTest,
return static_cast<IndexedDBContextImpl*>(partition->GetIndexedDBContext());
}
- void SetQuota(int per_host_quota_kilobytes) {
- SetTempQuota(per_host_quota_kilobytes,
- BrowserContext::GetDefaultStoragePartition(
- shell()->web_contents()->GetBrowserContext())
- ->GetQuotaManager());
+ void SetQuota(int quota_kilobytes) {
+ const int kTemporaryStorageQuotaSize =
+ quota_kilobytes * 1024 * QuotaManager::kPerHostTemporaryPortion;
+ SetTempQuota(kTemporaryStorageQuotaSize,
+ BrowserContext::GetDefaultStoragePartition(
+ shell()->web_contents()->GetBrowserContext())->GetQuotaManager());
}
- static void SetTempQuota(int per_host_quota_kilobytes,
- scoped_refptr<QuotaManager> qm) {
+ static void SetTempQuota(int64_t bytes, scoped_refptr<QuotaManager> qm) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- base::Bind(&IndexedDBBrowserTest::SetTempQuota,
- per_host_quota_kilobytes, qm));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&IndexedDBBrowserTest::SetTempQuota, bytes, qm));
return;
}
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- const int KB = 1024;
- qm->SetQuotaSettings(
- storage::GetHardCodedSettings(per_host_quota_kilobytes * KB));
+ 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());
}
virtual int64_t RequestDiskUsage() {

Powered by Google App Engine
This is Rietveld 408576698