diff options
author | kkanetkar@chromium.org <kkanetkar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 03:14:37 +0000 |
---|---|---|
committer | kkanetkar@chromium.org <kkanetkar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 03:14:37 +0000 |
commit | ec5c192817606b55ad99edb256997b70eea41b85 (patch) | |
tree | 16e863d9b1fa02f029c050b028177b7c984da6eb /webkit/appcache/appcache_host.cc | |
parent | 16d35b25ec19b82c13dc7cd24f744951cc12fad0 (diff) | |
download | chromium_src-ec5c192817606b55ad99edb256997b70eea41b85.zip chromium_src-ec5c192817606b55ad99edb256997b70eea41b85.tar.gz chromium_src-ec5c192817606b55ad99edb256997b70eea41b85.tar.bz2 |
Chrome side of changes required to populate appcache resource list.
BUG = 2821005
TEST = Manually navigate.
Review URL: http://codereview.chromium.org/3009005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_host.cc')
-rw-r--r-- | webkit/appcache/appcache_host.cc | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/webkit/appcache/appcache_host.cc b/webkit/appcache/appcache_host.cc index c4e8b62..66cf2a8 100644 --- a/webkit/appcache/appcache_host.cc +++ b/webkit/appcache/appcache_host.cc @@ -252,6 +252,25 @@ AppCacheRequestHandler* AppCacheHost::CreateRequestHandler( return NULL; } +void AppCacheHost::GetResourceList( + std::vector<AppCacheResourceInfo>* resource_infos) { + if (associated_cache_.get() && associated_cache_->is_complete()) { + for (AppCache::EntryMap::const_iterator it = + associated_cache_->entries().begin(); + it != associated_cache_->entries().end(); ++it) { + AppCacheResourceInfo info; + info.url = it->first; + info.is_master = it->second.IsMaster(); + info.is_manifest = it->second.IsManifest(); + info.is_fallback = it->second.IsFallback(); + info.is_foreign = it->second.IsForeign(); + info.is_explicit = it->second.IsExplicit(); + info.size = it->second.response_size(); + resource_infos->push_back(info); + } + } +} + Status AppCacheHost::GetStatus() { // 6.9.8 Application cache API AppCache* cache = associated_cache(); @@ -417,12 +436,23 @@ void AppCacheHost::AssociateCache(AppCache* cache) { associated_cache_ = cache; SetSwappableCache(cache ? cache->owning_group() : NULL); - + AppCacheInfo info; if (cache) { cache->AssociateHost(this); - frontend_->OnCacheSelected(host_id_, cache->cache_id(), GetStatus()); + info.cache_id = cache->cache_id(); + info.status = GetStatus(); + info.is_complete = cache->is_complete(); + if (cache->is_complete()) { + // TODO(kkanetkar): Get manifest URL info for NULL owning_group(). + info.manifest_url = cache->owning_group()->manifest_url(); + info.last_update_time = cache->update_time(); + info.creation_time = cache->owning_group()->creation_time(); + info.size = cache->cache_size(); + } + frontend_->OnCacheSelected(host_id_, info); } else { - frontend_->OnCacheSelected(host_id_, kNoCacheId, UNCACHED); + // No Cache. + frontend_->OnCacheSelected(host_id_, info); } } |