summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_host.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-16 20:12:24 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-16 20:12:24 +0000
commitf2df52f47562df771d94c51ed94ed930a3524889 (patch)
tree233a3fcf2f130489348d77e93a41dd33ae9f3f8a /webkit/appcache/appcache_host.cc
parent578d748527882756aaf1c04ac76175ede8baed50 (diff)
downloadchromium_src-f2df52f47562df771d94c51ed94ed930a3524889.zip
chromium_src-f2df52f47562df771d94c51ed94ed930a3524889.tar.gz
chromium_src-f2df52f47562df771d94c51ed94ed930a3524889.tar.bz2
Fix a simple crashing bug, don't assume an associated host has an owning group. The host can be associated with an incomplete 'inprogress' that has not yet been added to its group. When in this state, we return UNCACHED for the 'status' attribute.
TEST=yes, a layout test covers this BUG=none Review URL: http://codereview.chromium.org/395021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32080 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_host.cc')
-rw-r--r--webkit/appcache/appcache_host.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/webkit/appcache/appcache_host.cc b/webkit/appcache/appcache_host.cc
index c79aba0..7fd18fd 100644
--- a/webkit/appcache/appcache_host.cc
+++ b/webkit/appcache/appcache_host.cc
@@ -139,7 +139,7 @@ void AppCacheHost::DoPendingStartUpdate() {
// 6.9.8 Application cache API
bool success = false;
- if (associated_cache_) {
+ if (associated_cache_ && associated_cache_->owning_group()) {
AppCacheGroup* group = associated_cache_->owning_group();
if (!group->is_obsolete()) {
success = true;
@@ -173,7 +173,7 @@ void AppCacheHost::DoPendingSwapCache() {
// 6.9.8 Application cache API
bool success = false;
- if (associated_cache_) {
+ if (associated_cache_ && associated_cache_->owning_group()) {
if (associated_cache_->owning_group()->is_obsolete()) {
success = true;
AssociateCache(NULL);
@@ -208,11 +208,9 @@ AppCacheRequestHandler* AppCacheHost::CreateRequestHandler(
Status AppCacheHost::GetStatus() {
// 6.9.8 Application cache API
AppCache* cache = associated_cache();
- if (!cache)
+ if (!cache || !cache->owning_group())
return UNCACHED;
- DCHECK(cache->owning_group());
-
if (cache->owning_group()->is_obsolete())
return OBSOLETE;
if (cache->owning_group()->update_status() == AppCacheGroup::CHECKING)