summaryrefslogtreecommitdiffstats
path: root/webkit/appcache
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:40:45 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 23:40:45 +0000
commit122331d5cf1fdad245bb4e174c188ec3851b4d13 (patch)
treed9d47ff2304f96e0f5bbe97e080c80069ad45c9a /webkit/appcache
parentf164cea41472f9e9ec21579233e2c42a7b9d5184 (diff)
downloadchromium_src-122331d5cf1fdad245bb4e174c188ec3851b4d13.zip
chromium_src-122331d5cf1fdad245bb4e174c188ec3851b4d13.tar.gz
chromium_src-122331d5cf1fdad245bb4e174c188ec3851b4d13.tar.bz2
Third patch in making destructors of refcounted objects private.
BUG=26749 Review URL: http://codereview.chromium.org/363023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache')
-rw-r--r--webkit/appcache/appcache.h4
-rw-r--r--webkit/appcache/appcache_group.h4
-rw-r--r--webkit/appcache/appcache_response.cc2
-rw-r--r--webkit/appcache/appcache_response.h9
-rw-r--r--webkit/appcache/appcache_storage.h13
-rw-r--r--webkit/appcache/appcache_update_job_unittest.cc2
6 files changed, 26 insertions, 8 deletions
diff --git a/webkit/appcache/appcache.h b/webkit/appcache/appcache.h
index 203b582..57ca42a 100644
--- a/webkit/appcache/appcache.h
+++ b/webkit/appcache/appcache.h
@@ -32,7 +32,6 @@ class AppCache : public base::RefCounted<AppCache> {
typedef std::set<AppCacheHost*> AppCacheHosts;
AppCache(AppCacheService *service, int64 cache_id);
- ~AppCache();
int64 cache_id() const { return cache_id_; }
@@ -80,6 +79,9 @@ class AppCache : public base::RefCounted<AppCache> {
friend class AppCacheGroup;
friend class AppCacheHost;
friend class AppCacheUpdateJobTest;
+ friend class base::RefCounted<AppCache>;
+
+ ~AppCache();
// Use AppCacheGroup::Add/RemoveCache() to manipulate owning group.
void set_owning_group(AppCacheGroup* group) { owning_group_ = group; }
diff --git a/webkit/appcache/appcache_group.h b/webkit/appcache/appcache_group.h
index dece474..fa0f7da 100644
--- a/webkit/appcache/appcache_group.h
+++ b/webkit/appcache/appcache_group.h
@@ -38,7 +38,6 @@ class AppCacheGroup : public base::RefCounted<AppCacheGroup> {
};
AppCacheGroup(AppCacheService* service, const GURL& manifest_url);
- ~AppCacheGroup();
// Adds/removes an update observer, the AppCacheGroup does not take
// ownership of the observer.
@@ -77,8 +76,11 @@ class AppCacheGroup : public base::RefCounted<AppCacheGroup> {
private:
friend class AppCacheUpdateJob;
friend class AppCacheUpdateJobTest;
+ friend class base::RefCounted<AppCacheGroup>;
friend class MockAppCacheStorage; // for old_caches()
+ ~AppCacheGroup();
+
typedef std::vector<AppCache*> Caches;
AppCacheUpdateJob* update_job() { return update_job_; }
diff --git a/webkit/appcache/appcache_response.cc b/webkit/appcache/appcache_response.cc
index 3952d59..e827a14 100644
--- a/webkit/appcache/appcache_response.cc
+++ b/webkit/appcache/appcache_response.cc
@@ -41,6 +41,8 @@ class WrappedPickleIOBuffer : public net::WrappedIOBuffer {
}
private:
+ ~WrappedPickleIOBuffer() {}
+
scoped_ptr<const Pickle> pickle_;
};
diff --git a/webkit/appcache/appcache_response.h b/webkit/appcache/appcache_response.h
index e82521a..6b8e09a 100644
--- a/webkit/appcache/appcache_response.h
+++ b/webkit/appcache/appcache_response.h
@@ -32,7 +32,6 @@ class AppCacheResponseInfo
// AppCacheResponseInfo takes ownership of the http_info.
AppCacheResponseInfo(AppCacheService* service, int64 response_id,
net::HttpResponseInfo* http_info);
- ~AppCacheResponseInfo();
// TODO(michaeln): should the ctor/dtor be hidden from public view?
int64 response_id() const { return response_id_; }
@@ -42,6 +41,9 @@ class AppCacheResponseInfo
}
private:
+ friend class base::RefCounted<AppCacheResponseInfo>;
+ ~AppCacheResponseInfo();
+
const int64 response_id_;
const scoped_ptr<net::HttpResponseInfo> http_response_info_;
const AppCacheService* service_;
@@ -55,6 +57,11 @@ struct HttpResponseInfoIOBuffer
HttpResponseInfoIOBuffer() {}
HttpResponseInfoIOBuffer(net::HttpResponseInfo* info) : http_info(info) {}
+
+ private:
+ friend class base::RefCountedThreadSafe<HttpResponseInfoIOBuffer>;
+
+ ~HttpResponseInfoIOBuffer() {}
};
// Common base class for response reader and writer.
diff --git a/webkit/appcache/appcache_storage.h b/webkit/appcache/appcache_storage.h
index c221054..608ea34 100644
--- a/webkit/appcache/appcache_storage.h
+++ b/webkit/appcache/appcache_storage.h
@@ -177,16 +177,19 @@ class AppCacheStorage {
DelegateReferenceMap::value_type(delegate, this));
}
- ~DelegateReference() {
- if (delegate)
- storage->delegate_references_.erase(delegate);
- }
-
void CancelReference() {
storage->delegate_references_.erase(delegate);
storage = NULL;
delegate = NULL;
}
+
+ private:
+ friend class base::RefCounted<DelegateReference>;
+
+ ~DelegateReference() {
+ if (delegate)
+ storage->delegate_references_.erase(delegate);
+ }
};
typedef std::map<Delegate*, DelegateReference*> DelegateReferenceMap;
typedef std::vector<scoped_refptr<DelegateReference> >
diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc
index c4cb361..79ee787 100644
--- a/webkit/appcache/appcache_update_job_unittest.cc
+++ b/webkit/appcache/appcache_update_job_unittest.cc
@@ -118,6 +118,8 @@ class RetryRequestTestJob : public URLRequestTestJob {
virtual int GetResponseCode() const { return response_code_; }
private:
+ ~RetryRequestTestJob() {}
+
static std::string retry_headers() {
const char no_retry_after[] =
"HTTP/1.1 503 BOO HOO\0"