summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/web_application_cache_host_impl.cc
diff options
context:
space:
mode:
authorjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-01 23:55:04 +0000
committerjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-01 23:55:04 +0000
commit2cd1b419704881832767acda830bd817fcaa5fad (patch)
treec8c8cef065c6c34ffdb51001d1efcfb65999e047 /webkit/appcache/web_application_cache_host_impl.cc
parent6173a33a7ae279d20227528e5eddf402b5456213 (diff)
downloadchromium_src-2cd1b419704881832767acda830bd817fcaa5fad.zip
chromium_src-2cd1b419704881832767acda830bd817fcaa5fad.tar.gz
chromium_src-2cd1b419704881832767acda830bd817fcaa5fad.tar.bz2
Fix host status bug:
* Return DOWNLOADING status for cache without owning group. * Clear out saved notion of status in host on event raised and before swapping cache as those invalidate any saved notion of cache status. TEST=no new tests; covered by existing appcache layout tests BUG=none Review URL: http://codereview.chromium.org/449063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/web_application_cache_host_impl.cc')
-rw-r--r--webkit/appcache/web_application_cache_host_impl.cc11
1 files changed, 11 insertions, 0 deletions
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_);
}