OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/appcache/appcache_update_job.h" | 5 #include "webkit/appcache/appcache_update_job.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 } | 862 } |
863 } | 863 } |
864 | 864 |
865 void AppCacheUpdateJob::BuildUrlFileList(const Manifest& manifest) { | 865 void AppCacheUpdateJob::BuildUrlFileList(const Manifest& manifest) { |
866 for (base::hash_set<std::string>::const_iterator it = | 866 for (base::hash_set<std::string>::const_iterator it = |
867 manifest.explicit_urls.begin(); | 867 manifest.explicit_urls.begin(); |
868 it != manifest.explicit_urls.end(); ++it) { | 868 it != manifest.explicit_urls.end(); ++it) { |
869 AddUrlToFileList(GURL(*it), AppCacheEntry::EXPLICIT); | 869 AddUrlToFileList(GURL(*it), AppCacheEntry::EXPLICIT); |
870 } | 870 } |
871 | 871 |
872 // TODO(michaeln): Add resources from intercept namepsaces too. | 872 const std::vector<Namespace>& intercepts = |
873 // http://code.google.com/p/chromium/issues/detail?id=101565 | 873 manifest.intercept_namespaces; |
| 874 for (std::vector<Namespace>::const_iterator it = intercepts.begin(); |
| 875 it != intercepts.end(); ++it) { |
| 876 AddUrlToFileList(it->target_url, AppCacheEntry::INTERCEPT); |
| 877 } |
874 | 878 |
875 const std::vector<FallbackNamespace>& fallbacks = | 879 const std::vector<Namespace>& fallbacks = |
876 manifest.fallback_namespaces; | 880 manifest.fallback_namespaces; |
877 for (std::vector<FallbackNamespace>::const_iterator it = fallbacks.begin(); | 881 for (std::vector<Namespace>::const_iterator it = fallbacks.begin(); |
878 it != fallbacks.end(); ++it) { | 882 it != fallbacks.end(); ++it) { |
879 AddUrlToFileList(it->second, AppCacheEntry::FALLBACK); | 883 AddUrlToFileList(it->target_url, AppCacheEntry::FALLBACK); |
880 } | 884 } |
881 | 885 |
882 // Add all master entries from newest complete cache. | 886 // Add all master entries from newest complete cache. |
883 if (update_type_ == UPGRADE_ATTEMPT) { | 887 if (update_type_ == UPGRADE_ATTEMPT) { |
884 const AppCache::EntryMap& entries = | 888 const AppCache::EntryMap& entries = |
885 group_->newest_complete_cache()->entries(); | 889 group_->newest_complete_cache()->entries(); |
886 for (AppCache::EntryMap::const_iterator it = entries.begin(); | 890 for (AppCache::EntryMap::const_iterator it = entries.begin(); |
887 it != entries.end(); ++it) { | 891 it != entries.end(); ++it) { |
888 const AppCacheEntry& entry = it->second; | 892 const AppCacheEntry& entry = it->second; |
889 if (entry.IsMaster()) | 893 if (entry.IsMaster()) |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 | 1320 |
1317 // Break the connection with the group so the group cannot call delete | 1321 // Break the connection with the group so the group cannot call delete |
1318 // on this object after we've posted a task to delete ourselves. | 1322 // on this object after we've posted a task to delete ourselves. |
1319 group_->SetUpdateStatus(AppCacheGroup::IDLE); | 1323 group_->SetUpdateStatus(AppCacheGroup::IDLE); |
1320 group_ = NULL; | 1324 group_ = NULL; |
1321 | 1325 |
1322 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 1326 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
1323 } | 1327 } |
1324 | 1328 |
1325 } // namespace appcache | 1329 } // namespace appcache |
OLD | NEW |