summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-29 21:14:05 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-29 21:14:05 +0000
commit62bf213f70f3fa3ebbe2eaa9353ca9ac9f8264fb (patch)
tree9040e07832c545e0abb5754da126f0b314afb17f /chrome
parentfcfa89d8845754ceb5680805b5726de002a030be (diff)
downloadchromium_src-62bf213f70f3fa3ebbe2eaa9353ca9ac9f8264fb.zip
chromium_src-62bf213f70f3fa3ebbe2eaa9353ca9ac9f8264fb.tar.gz
chromium_src-62bf213f70f3fa3ebbe2eaa9353ca9ac9f8264fb.tar.bz2
Retain support for 'UnlimitedStorage' in the QuotaManager.
Track unlimited_usage in parallel with total global_usage. The latter value is the sum of all usage by any origin (same as before). The new value is the amount of the total that is attributable to origins with the unlimited storage permission. Widened the GlobalUsageCallback to take two int64 params, one for the total global_usage and the other for the unlimited_usage. Modified the eviction logic to exempt origins with the unlimited storage right from eviction. Modified the behavior of QuotaManager::GetUsageAndQuota(origin) method to return kint64max for unlimited origins. Also modified the return value in the limited case to be 10% of the total limit for temp storage, unless the system is over the total limit in which case they're capped at their current usage level. // Allow an individual host to utilize no more than 10% of the total // pool available for temp storage. int64 host_quota = quota() / 10; // If total temp usage is over-budget, stop letting new data in until we reclaim space. limited_global_usage = global_usage() - unlimted_global_usage(); if (limited_global_usage > quota()) host_quota = std::min(host_quota, host_usage()); return host_quota; At this time, the total limit for temp storage is 1G, that gives each site 100M to work with (no prompts involved). BUG=61676 TEST=unittests Review URL: http://codereview.chromium.org/6962005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/profiles/profile.cc3
-rw-r--r--chrome/browser/profiles/profile_impl.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index 4a8f9bb..f35020c 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -701,7 +701,8 @@ class OffTheRecordProfileImpl : public Profile,
IsOffTheRecord(),
GetPath(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB));
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
+ GetExtensionSpecialStoragePolicy());
// Each consumer is responsible for registering its QuotaClient during
// its construction.
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 96f344d..e25d9f7 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -1311,7 +1311,8 @@ void ProfileImpl::CreateQuotaManagerAndClients() {
IsOffTheRecord(),
GetPath(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB));
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
+ GetExtensionSpecialStoragePolicy());
// Each consumer is responsible for registering its QuotaClient during
// its construction.