summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_host.h
diff options
context:
space:
mode:
authorjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 23:17:33 +0000
committerjennb@chromium.org <jennb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 23:17:33 +0000
commiteaa0885f7f32060ea7313e25dc1104d5a9b6b3ba (patch)
treee81482931ebf2e92e2e3302d45c6b5470820752b /webkit/appcache/appcache_host.h
parent900950e1a35c75ad3089e1f78c03e8c497cdb6f0 (diff)
downloadchromium_src-eaa0885f7f32060ea7313e25dc1104d5a9b6b3ba.zip
chromium_src-eaa0885f7f32060ea7313e25dc1104d5a9b6b3ba.tar.gz
chromium_src-eaa0885f7f32060ea7313e25dc1104d5a9b6b3ba.tar.bz2
Change AppCache and AppCacheGroup to be ref counted classes.Adjusted API of framework classes accordingly.Added unittests for appcache framework classes.TEST=verify objects are cleaned up properly, verify api implBUG=none
Review URL: http://codereview.chromium.org/179071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_host.h')
-rw-r--r--webkit/appcache/appcache_host.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/webkit/appcache/appcache_host.h b/webkit/appcache/appcache_host.h
index bebc22d..420e3d4 100644
--- a/webkit/appcache/appcache_host.h
+++ b/webkit/appcache/appcache_host.h
@@ -5,10 +5,13 @@
#ifndef WEBKIT_APPCACHE_APPCACHE_HOST_H_
#define WEBKIT_APPCACHE_APPCACHE_HOST_H_
+#include "base/ref_counted.h"
+
namespace appcache {
class AppCache;
class AppCacheFrontend;
+class AppCacheGroup;
// Server-side representation of an application cache host.
class AppCacheHost {
@@ -20,9 +23,7 @@ class AppCacheHost {
AppCacheFrontend* frontend() { return frontend_; }
AppCache* selected_cache() { return selected_cache_; }
- void set_selected_cache(AppCache* cache) {
- selected_cache_ = cache;
- }
+ void set_selected_cache(AppCache* cache);
bool is_selection_pending() {
return false; // TODO(michaeln)
@@ -33,7 +34,11 @@ class AppCacheHost {
int host_id_;
// application cache associated with this host, if any
- AppCache* selected_cache_;
+ scoped_refptr<AppCache> selected_cache_;
+
+ // The reference to the appcache group ensures the group exists as long
+ // as there is a host using a cache belonging to that group.
+ scoped_refptr<AppCacheGroup> group_;
// frontend to deliver notifications about this host to child process
AppCacheFrontend* frontend_;