diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 22:07:15 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 22:07:15 +0000 |
commit | 97e3edc23314c476859c22c8db601f9b3dec552d (patch) | |
tree | 9c589f47545b88c1453c2481a7844a921636485c /webkit/appcache/appcache.h | |
parent | 34fce2a5030cb53a1e2decb37b5f7517f98457f7 (diff) | |
download | chromium_src-97e3edc23314c476859c22c8db601f9b3dec552d.zip chromium_src-97e3edc23314c476859c22c8db601f9b3dec552d.tar.gz chromium_src-97e3edc23314c476859c22c8db601f9b3dec552d.tar.bz2 |
* Fleshed out AppCacheHost class a fair amount, in particular the cache selection algorithm.
* Added some AppCacheHost unit tests.
* Introduced AppCacheRequestHandler class, which replaces the clunkyApp
CacheInterceptor::ExtraInfo struct. This impl is entirely skeletal
stubs for now.
TEST=appcache_unittest.cc, but really needs more
BUG=none
Review URL: http://codereview.chromium.org/192043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache.h')
-rw-r--r-- | webkit/appcache/appcache.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/webkit/appcache/appcache.h b/webkit/appcache/appcache.h index 15944b6..fcfa9d1 100644 --- a/webkit/appcache/appcache.h +++ b/webkit/appcache/appcache.h @@ -30,14 +30,16 @@ class AppCache : public base::RefCounted<AppCache> { AppCache(AppCacheService *service, int64 cache_id); ~AppCache(); - int64 cache_id() { return cache_id_; } + int64 cache_id() const { return cache_id_; } - AppCacheGroup* owning_group() { return owning_group_; } + AppCacheGroup* owning_group() const { return owning_group_; } void set_owning_group(AppCacheGroup* group) { owning_group_ = group; } - bool is_complete() { return is_complete_; } + bool is_complete() const { return is_complete_; } void set_complete(bool value) { is_complete_ = value; } + AppCacheService* service() const { return service_; } + // Adds a new entry. Entry must not already be in cache. void AddEntry(const GURL& url, const AppCacheEntry& entry); @@ -49,9 +51,9 @@ class AppCache : public base::RefCounted<AppCache> { AppCacheEntry* GetEntry(const GURL& url); typedef std::map<GURL, AppCacheEntry> EntryMap; - const EntryMap& entries() { return entries_; } + const EntryMap& entries() const { return entries_; } - bool IsNewerThan(AppCache* cache) { + bool IsNewerThan(AppCache* cache) const { return update_time_ > cache->update_time_; } @@ -62,13 +64,13 @@ class AppCache : public base::RefCounted<AppCache> { private: friend class AppCacheHost; - // Use AppCacheHost::set_selected_cache() to manipulate host association. + // Use AppCacheHost::AssociateCache() to manipulate host association. void AssociateHost(AppCacheHost* host) { associated_hosts_.insert(host); } void UnassociateHost(AppCacheHost* host); - int64 cache_id_; + const int64 cache_id_; AppCacheEntry* manifest_; // also in entry map AppCacheGroup* owning_group_; std::set<AppCacheHost*> associated_hosts_; |