diff options
author | jennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 17:11:05 +0000 |
---|---|---|
committer | jennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 17:11:05 +0000 |
commit | 43fdd14f0a15825532820cd6b12c233f2fd7be5a (patch) | |
tree | 29672c6892763c08989853392345758e03a84cf7 /webkit/appcache/appcache.cc | |
parent | 46739a21804b7ee71eb8368609e2c3592334bc79 (diff) | |
download | chromium_src-43fdd14f0a15825532820cd6b12c233f2fd7be5a.zip chromium_src-43fdd14f0a15825532820cd6b12c233f2fd7be5a.tar.gz chromium_src-43fdd14f0a15825532820cd6b12c233f2fd7be5a.tar.bz2 |
Implement cancelling an appcache update. An update is cancelled when its application cache group is no longer in use. Refcounting of caches and groups changed to make cancelling an update work.
TEST=updated existing tests, verify deleting group cancels update, verify new refcounting behavior
BUG=none
Review URL: http://codereview.chromium.org/274013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache.cc')
-rw-r--r-- | webkit/appcache/appcache.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/webkit/appcache/appcache.cc b/webkit/appcache/appcache.cc index 01bf37d..41c3f54 100644 --- a/webkit/appcache/appcache.cc +++ b/webkit/appcache/appcache.cc @@ -24,16 +24,16 @@ AppCache::AppCache(AppCacheService *service, int64 cache_id) AppCache::~AppCache() { DCHECK(associated_hosts_.empty()); + if (owning_group_) { + DCHECK(is_complete_); + owning_group_->RemoveCache(this); + } DCHECK(!owning_group_); service_->storage()->working_set()->RemoveCache(this); } void AppCache::UnassociateHost(AppCacheHost* host) { associated_hosts_.erase(host); - - // Inform group if this cache is no longer in use. - if (associated_hosts_.empty() && owning_group_) - owning_group_->RemoveCache(this); } void AppCache::AddEntry(const GURL& url, const AppCacheEntry& entry) { |