diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-29 22:46:55 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-29 22:46:55 +0000 |
commit | 35f2094cd0ac27018aff2646445f44c3f9ee8d36 (patch) | |
tree | 0f4892fb2f6bcf9d5f044e70c1cf1ed0d42bb882 /webkit/appcache/appcache_working_set.cc | |
parent | 6d38a7fc2594f14cbb87e28389c81965381b64e8 (diff) | |
download | chromium_src-35f2094cd0ac27018aff2646445f44c3f9ee8d36.zip chromium_src-35f2094cd0ac27018aff2646445f44c3f9ee8d36.tar.gz chromium_src-35f2094cd0ac27018aff2646445f44c3f9ee8d36.tar.bz2 |
AppCacheDatabase and SQL based AppCacheStorageImpl.
Still nothing is being written to disk with this CL,
in-memory SQLite and DiskCaches are being utilized.
Responses are not yet being removed from the DiskCasche
when the should be. Once that's done (in the next CL), we'll
start saving things on disk.
BUG=none
TEST=appcache_database_unittest.cc, appcache_storage_impl_unittest.cc
Review URL: http://codereview.chromium.org/518020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_working_set.cc')
-rw-r--r-- | webkit/appcache/appcache_working_set.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/webkit/appcache/appcache_working_set.cc b/webkit/appcache/appcache_working_set.cc index 2b61ea3..652116c 100644 --- a/webkit/appcache/appcache_working_set.cc +++ b/webkit/appcache/appcache_working_set.cc @@ -14,6 +14,7 @@ namespace appcache { AppCacheWorkingSet::~AppCacheWorkingSet() { DCHECK(caches_.empty()); DCHECK(groups_.empty()); + DCHECK(groups_by_origin_.empty()); } void AppCacheWorkingSet::AddCache(AppCache* cache) { @@ -31,10 +32,20 @@ void AppCacheWorkingSet::AddGroup(AppCacheGroup* group) { const GURL& url = group->manifest_url(); DCHECK(groups_.find(url) == groups_.end()); groups_.insert(GroupMap::value_type(url, group)); + groups_by_origin_[url.GetOrigin()].insert(GroupMap::value_type(url, group)); } void AppCacheWorkingSet::RemoveGroup(AppCacheGroup* group) { - groups_.erase(group->manifest_url()); + const GURL& url = group->manifest_url(); + groups_.erase(url); + + GURL origin_url = url.GetOrigin(); + GroupMap* groups_in_origin = GetMutableGroupsInOrigin(origin_url); + if (groups_in_origin) { + groups_in_origin->erase(url); + if (groups_in_origin->empty()) + groups_by_origin_.erase(origin_url); + } } void AppCacheWorkingSet::AddResponseInfo(AppCacheResponseInfo* info) { |