diff options
Diffstat (limited to 'webkit/appcache')
-rw-r--r-- | webkit/appcache/appcache_host.cc | 7 | ||||
-rw-r--r-- | webkit/appcache/web_application_cache_host_impl.cc | 11 |
2 files changed, 17 insertions, 1 deletions
diff --git a/webkit/appcache/appcache_host.cc b/webkit/appcache/appcache_host.cc index 7fd18fd..6a62a44 100644 --- a/webkit/appcache/appcache_host.cc +++ b/webkit/appcache/appcache_host.cc @@ -208,9 +208,14 @@ AppCacheRequestHandler* AppCacheHost::CreateRequestHandler( Status AppCacheHost::GetStatus() { // 6.9.8 Application cache API AppCache* cache = associated_cache(); - if (!cache || !cache->owning_group()) + if (!cache) return UNCACHED; + // A cache without an owning group represents the cache being constructed + // during the application cache update process. + if (!cache->owning_group()) + return DOWNLOADING; + if (cache->owning_group()->is_obsolete()) return OBSOLETE; if (cache->owning_group()->update_status() == AppCacheGroup::CHECKING) diff --git a/webkit/appcache/web_application_cache_host_impl.cc b/webkit/appcache/web_application_cache_host_impl.cc index 0d09cde..427ec87 100644 --- a/webkit/appcache/web_application_cache_host_impl.cc +++ b/webkit/appcache/web_application_cache_host_impl.cc @@ -60,6 +60,13 @@ void WebApplicationCacheHostImpl::OnStatusChanged(appcache::Status status) { } void WebApplicationCacheHostImpl::OnEventRaised(appcache::EventID event_id) { + // Most events change the status. Clear out what we know so that the latest + // status will be obtained from the backend. + if (PROGRESS_EVENT != event_id) { + has_status_ = false; + has_cached_status_ = false; + } + client_->notifyEventListener(static_cast<EventID>(event_id)); } @@ -195,6 +202,10 @@ bool WebApplicationCacheHostImpl::startUpdate() { } bool WebApplicationCacheHostImpl::swapCache() { + // Cache status will change when cache is swapped. Clear out any saved idea + // of status so that backend will be queried for actual status. + has_status_ = false; + has_cached_status_ = false; return backend_->SwapCache(host_id_); } |