summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_working_set.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-18 23:27:27 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-18 23:27:27 +0000
commit1ededee8107fd0e40e6371a5d35f7d2b451ca433 (patch)
treee180d5419e246f0f3bb69ba274d7abcf409741f9 /webkit/appcache/appcache_working_set.cc
parent5510cff445f38b167c8ca9c734e9311fd0505212 (diff)
downloadchromium_src-1ededee8107fd0e40e6371a5d35f7d2b451ca433.zip
chromium_src-1ededee8107fd0e40e6371a5d35f7d2b451ca433.tar.gz
chromium_src-1ededee8107fd0e40e6371a5d35f7d2b451ca433.tar.bz2
Put appcache storage on disk and add a means of disabling the appcache system when certain error conditions arise.
TEST=existing tests apply BUG=none Review URL: http://codereview.chromium.org/542071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_working_set.cc')
-rw-r--r--webkit/appcache/appcache_working_set.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/webkit/appcache/appcache_working_set.cc b/webkit/appcache/appcache_working_set.cc
index 652116c..1c3f40b 100644
--- a/webkit/appcache/appcache_working_set.cc
+++ b/webkit/appcache/appcache_working_set.cc
@@ -17,7 +17,19 @@ AppCacheWorkingSet::~AppCacheWorkingSet() {
DCHECK(groups_by_origin_.empty());
}
+void AppCacheWorkingSet::Disable() {
+ if (is_disabled_)
+ return;
+ is_disabled_ = true;
+ caches_.clear();
+ groups_.clear();
+ groups_by_origin_.clear();
+ response_infos_.clear();
+}
+
void AppCacheWorkingSet::AddCache(AppCache* cache) {
+ if (is_disabled_)
+ return;
DCHECK(cache->cache_id() != kNoCacheId);
int64 cache_id = cache->cache_id();
DCHECK(caches_.find(cache_id) == caches_.end());
@@ -29,6 +41,8 @@ void AppCacheWorkingSet::RemoveCache(AppCache* cache) {
}
void AppCacheWorkingSet::AddGroup(AppCacheGroup* group) {
+ if (is_disabled_)
+ return;
const GURL& url = group->manifest_url();
DCHECK(groups_.find(url) == groups_.end());
groups_.insert(GroupMap::value_type(url, group));
@@ -49,6 +63,8 @@ void AppCacheWorkingSet::RemoveGroup(AppCacheGroup* group) {
}
void AppCacheWorkingSet::AddResponseInfo(AppCacheResponseInfo* info) {
+ if (is_disabled_)
+ return;
DCHECK(info->response_id() != kNoResponseId);
int64 response_id = info->response_id();
DCHECK(response_infos_.find(response_id) == response_infos_.end());