diff options
author | jennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 22:22:37 +0000 |
---|---|---|
committer | jennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 22:22:37 +0000 |
commit | 91fce0c025e0ff1516d1a8ea762bc4eab326b8de (patch) | |
tree | 3a8f22ff91e21328dcb5d9db7ad3b4f4cc7c609f /webkit/appcache/mock_appcache_storage.cc | |
parent | 7f1654c7b6a85ec08b0080b68124bb39471b1a16 (diff) | |
download | chromium_src-91fce0c025e0ff1516d1a8ea762bc4eab326b8de.zip chromium_src-91fce0c025e0ff1516d1a8ea762bc4eab326b8de.tar.gz chromium_src-91fce0c025e0ff1516d1a8ea762bc4eab326b8de.tar.bz2 |
Mock appcache storage bug fix for storing group and changes to its existing newest cache.
TEST=test added to catch bug
BUG=none
Review URL: http://codereview.chromium.org/399078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32417 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/mock_appcache_storage.cc')
-rw-r--r-- | webkit/appcache/mock_appcache_storage.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/webkit/appcache/mock_appcache_storage.cc b/webkit/appcache/mock_appcache_storage.cc index bc4a385..d176288 100644 --- a/webkit/appcache/mock_appcache_storage.cc +++ b/webkit/appcache/mock_appcache_storage.cc @@ -187,13 +187,15 @@ void MockAppCacheStorage::ProcessStoreGroupAndNewestCache( } AddStoredGroup(group); - AddStoredCache(newest_cache); - group->AddCache(newest_cache); - - // Copy the collection prior to removal, on final release - // of a cache the group's collection will change. - AppCacheGroup::Caches copy = group->old_caches(); - RemoveStoredCaches(copy); + if (newest_cache != group->newest_complete_cache()) { + AddStoredCache(newest_cache); + group->AddCache(newest_cache); + + // Copy the collection prior to removal, on final release + // of a cache the group's collection will change. + AppCacheGroup::Caches copy = group->old_caches(); + RemoveStoredCaches(copy); + } if (delegate_ref->delegate) delegate_ref->delegate->OnGroupAndNewestCacheStored(group, true); |