Index: content/browser/appcache/appcache_update_job.cc |
diff --git a/content/browser/appcache/appcache_update_job.cc b/content/browser/appcache/appcache_update_job.cc |
index ff065503c4deb7afec59aae1bc2645d02b06d095..24700465026d5d4c12961a8a545e4c8e4281071c 100644 |
--- a/content/browser/appcache/appcache_update_job.cc |
+++ b/content/browser/appcache/appcache_update_job.cc |
@@ -405,11 +405,13 @@ AppCacheUpdateJob::~AppCacheUpdateJob() { |
if (internal_state_ != COMPLETED) |
Cancel(); |
- DCHECK(!manifest_fetcher_); |
- DCHECK(pending_url_fetches_.empty()); |
DCHECK(!inprogress_cache_.get()); |
DCHECK(pending_master_entries_.empty()); |
- DCHECK(master_entry_fetches_.empty()); |
+ |
+ // The job must not outlive any of its fetchers. |
+ CHECK(!manifest_fetcher_); |
+ CHECK(pending_url_fetches_.empty()); |
+ CHECK(master_entry_fetches_.empty()); |
if (group_) |
group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); |
@@ -426,6 +428,9 @@ void AppCacheUpdateJob::StartUpdate(AppCacheHost* host, |
DCHECK(!new_master_resource.has_ref()); |
DCHECK(new_master_resource.GetOrigin() == manifest_url_.GetOrigin()); |
+ if (ContainsKey(failed_master_entries_, new_master_resource)) |
+ return; |
+ |
// Cannot add more to this update if already terminating. |
if (IsTerminating()) { |
group_->QueueUpdate(host, new_master_resource); |
@@ -863,6 +868,8 @@ void AppCacheUpdateJob::HandleMasterEntryFetchCompleted( |
} |
hosts.clear(); |
+ failed_master_entries_.insert(url); |
+ |
const char* kFormatString = "Manifest fetch failed (%d) %s"; |
std::string message = FormatUrlErrorMessage( |
kFormatString, request->url(), fetcher->result(), response_code); |