| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/appcache/appcache_update_job.h" | 5 #include "content/browser/appcache/appcache_update_job.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 | 1098 |
| 1099 AppCache* newest_cache = group_->newest_complete_cache(); | 1099 AppCache* newest_cache = group_->newest_complete_cache(); |
| 1100 if (newest_cache) | 1100 if (newest_cache) |
| 1101 host_notifier->AddHosts(newest_cache->associated_hosts()); | 1101 host_notifier->AddHosts(newest_cache->associated_hosts()); |
| 1102 } | 1102 } |
| 1103 | 1103 |
| 1104 void AppCacheUpdateJob::OnDestructionImminent(AppCacheHost* host) { | 1104 void AppCacheUpdateJob::OnDestructionImminent(AppCacheHost* host) { |
| 1105 // The host is about to be deleted; remove from our collection. | 1105 // The host is about to be deleted; remove from our collection. |
| 1106 PendingMasters::iterator found = | 1106 PendingMasters::iterator found = |
| 1107 pending_master_entries_.find(host->pending_master_entry_url()); | 1107 pending_master_entries_.find(host->pending_master_entry_url()); |
| 1108 DCHECK(found != pending_master_entries_.end()); | 1108 CHECK(found != pending_master_entries_.end()); |
| 1109 PendingHosts& hosts = found->second; | 1109 PendingHosts& hosts = found->second; |
| 1110 PendingHosts::iterator it = std::find(hosts.begin(), hosts.end(), host); | 1110 PendingHosts::iterator it = std::find(hosts.begin(), hosts.end(), host); |
| 1111 DCHECK(it != hosts.end()); | 1111 CHECK(it != hosts.end()); |
| 1112 hosts.erase(it); | 1112 hosts.erase(it); |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 void AppCacheUpdateJob::OnServiceReinitialized( | 1115 void AppCacheUpdateJob::OnServiceReinitialized( |
| 1116 AppCacheStorageReference* old_storage_ref) { | 1116 AppCacheStorageReference* old_storage_ref) { |
| 1117 // We continue to use the disabled instance, but arrange for its | 1117 // We continue to use the disabled instance, but arrange for its |
| 1118 // deletion when its no longer needed. | 1118 // deletion when its no longer needed. |
| 1119 if (old_storage_ref->storage() == storage_) | 1119 if (old_storage_ref->storage() == storage_) |
| 1120 disabled_storage_reference_ = old_storage_ref; | 1120 disabled_storage_reference_ = old_storage_ref; |
| 1121 } | 1121 } |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 // on this object after we've posted a task to delete ourselves. | 1698 // on this object after we've posted a task to delete ourselves. |
| 1699 if (group_) { | 1699 if (group_) { |
| 1700 group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); | 1700 group_->SetUpdateAppCacheStatus(AppCacheGroup::IDLE); |
| 1701 group_ = NULL; | 1701 group_ = NULL; |
| 1702 } | 1702 } |
| 1703 | 1703 |
| 1704 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 1704 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 1705 } | 1705 } |
| 1706 | 1706 |
| 1707 } // namespace content | 1707 } // namespace content |
| OLD | NEW |