summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_storage_impl.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-21 02:39:40 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-21 02:39:40 +0000
commit9b7a0c551268395816959eb8df1c44086583824e (patch)
tree2be7bdf092e8776b0161b0eff83c0122626dc5bf /webkit/appcache/appcache_storage_impl.cc
parent6f526b9ac1ec6fb252d3cfe1f625a694d76f643f (diff)
downloadchromium_src-9b7a0c551268395816959eb8df1c44086583824e.zip
chromium_src-9b7a0c551268395816959eb8df1c44086583824e.tar.gz
chromium_src-9b7a0c551268395816959eb8df1c44086583824e.tar.bz2
Enforce a hard coded 5MB per origin quota for appcache storage.
TEST=yes BUG=none Review URL: http://codereview.chromium.org/554008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_storage_impl.cc')
-rw-r--r--webkit/appcache/appcache_storage_impl.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/webkit/appcache/appcache_storage_impl.cc b/webkit/appcache/appcache_storage_impl.cc
index 6e91892..50d2aef 100644
--- a/webkit/appcache/appcache_storage_impl.cc
+++ b/webkit/appcache/appcache_storage_impl.cc
@@ -408,14 +408,18 @@ void AppCacheStorageImpl::StoreGroupAndCacheTask::Run() {
database_->InsertEntryRecords(entry_records_) &&
database_->InsertFallbackNameSpaceRecords(fallback_namespace_records_)&&
database_->InsertOnlineWhiteListRecords(online_whitelist_records_) &&
+ (database_->GetOriginUsage(group_record_.origin) <=
+ database_->GetOriginQuota(group_record_.origin)) &&
transaction.Commit();
}
void AppCacheStorageImpl::StoreGroupAndCacheTask::RunCompleted() {
if (success_) {
storage_->origins_with_groups_.insert(group_->manifest_url().GetOrigin());
- if (cache_ != group_->newest_complete_cache())
+ if (cache_ != group_->newest_complete_cache()) {
+ cache_->set_complete(true);
group_->AddCache(cache_);
+ }
group_->AddNewlyDeletableResponseIds(&newly_deletable_response_ids_);
}
FOR_EACH_DELEGATE(delegates_, OnGroupAndNewestCacheStored(group_, success_));
@@ -826,8 +830,7 @@ void AppCacheStorageImpl::StoreGroupAndNewestCache(
// whole new cache. The StoreGroupAndCacheTask as written will handle
// the simple update case in a very heavy weight way (delete all and
// the reinsert all over again).
- DCHECK(group && delegate);
- DCHECK(newest_cache && newest_cache->is_complete());
+ DCHECK(group && delegate && newest_cache);
scoped_refptr<StoreGroupAndCacheTask> task =
new StoreGroupAndCacheTask(this, group, newest_cache);
task->AddDelegate(GetOrCreateDelegateReference(delegate));