diff options
author | jennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-06 17:19:37 +0000 |
---|---|---|
committer | jennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-06 17:19:37 +0000 |
commit | ae3c0b266d4a3f7f2f121589e24e76528d44f4f7 (patch) | |
tree | 85af04a19120db4a75b1ad07ca2a6e1473f1767e /webkit/appcache/appcache.cc | |
parent | ff9cfce7ec2ae06df4ac413cfde3bfd7ae503677 (diff) | |
download | chromium_src-ae3c0b266d4a3f7f2f121589e24e76528d44f4f7.zip chromium_src-ae3c0b266d4a3f7f2f121589e24e76528d44f4f7.tar.gz chromium_src-ae3c0b266d4a3f7f2f121589e24e76528d44f4f7.tar.bz2 |
Implementation of application cache update algorithm.
Does not include storage nor processing of pending master entries.
TEST=verify update functionality
BUG=none
Review URL: http://codereview.chromium.org/201070
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache.cc')
-rw-r--r-- | webkit/appcache/appcache.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/webkit/appcache/appcache.cc b/webkit/appcache/appcache.cc index 5e7bca63..450f978 100644 --- a/webkit/appcache/appcache.cc +++ b/webkit/appcache/appcache.cc @@ -7,17 +7,17 @@ #include "base/logging.h" #include "webkit/appcache/appcache_group.h" #include "webkit/appcache/appcache_host.h" +#include "webkit/appcache/appcache_interfaces.h" #include "webkit/appcache/appcache_service.h" namespace appcache { AppCache::AppCache(AppCacheService *service, int64 cache_id) - : cache_id_(cache_id), - manifest_(NULL), - owning_group_(NULL), - online_whitelist_all_(false), - is_complete_(false), - service_(service) { + : cache_id_(cache_id), + owning_group_(NULL), + online_whitelist_all_(false), + is_complete_(false), + service_(service) { service_->AddCache(this); } @@ -42,7 +42,7 @@ void AppCache::AddEntry(const GURL& url, const AppCacheEntry& entry) { void AppCache::AddOrModifyEntry(const GURL& url, const AppCacheEntry& entry) { std::pair<EntryMap::iterator, bool> ret = - entries_.insert(EntryMap::value_type(url, entry)); + entries_.insert(EntryMap::value_type(url, entry)); // Entry already exists. Merge the types of the new and existing entries. if (!ret.second) @@ -54,4 +54,11 @@ AppCacheEntry* AppCache::GetEntry(const GURL& url) { return (it != entries_.end()) ? &(it->second) : NULL; } +void AppCache::InitializeWithManifest(Manifest* manifest) { + DCHECK(manifest); + fallback_namespaces_.swap(manifest->fallback_namespaces); + online_whitelist_namespaces_.swap(manifest->online_whitelist_namespaces); + online_whitelist_all_ = manifest->online_whitelist_all; +} + } // namespace appcache |