diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 23:34:34 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 23:34:34 +0000 |
commit | 59326aacf6020c3cfa8978a334c36b2dcc1a99bb (patch) | |
tree | 698940cee180d498131c98b9efbb2de30b642161 /net/http/http_cache.h | |
parent | 754f7e974507e71f6ac40eec66bcb73f13d868c6 (diff) | |
download | chromium_src-59326aacf6020c3cfa8978a334c36b2dcc1a99bb.zip chromium_src-59326aacf6020c3cfa8978a334c36b2dcc1a99bb.tar.gz chromium_src-59326aacf6020c3cfa8978a334c36b2dcc1a99bb.tar.bz2 |
Implement ScopedRunnableMethodFactory using WeakPtr.
This required some changes to WeakPtr to support the addition
of WeakPtrFactory::HasWeakPtrs(), which is used to implement
ScopedRunnableMethodFactory::empty().
Now, the WeakReferenceOwner just holds a pointer to the Flag
class, and the Flag holds a back-pointer that it can use to
clear the WeakReferenceOwner's pointer when the Flag is
destroyed. I use the null'ness of this back-pointer in place
of the bool member that was previously used to indicate if the
WeakReference is valid.
It was also necessary to expose a HasOneRef method on
RefCounted. I included one on RefCountedThreadSafe for
completeness.
Finally, I switched HttpCache over to using WeakPtr instead
of RevocableStore so that I could delete RevocableStore.
(I'm making this change to consolidate similar functionality.)
R=abarth
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/235027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27287 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache.h')
-rw-r--r-- | net/http/http_cache.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/http/http_cache.h b/net/http/http_cache.h index 652f3a4..15163b07 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -21,6 +21,7 @@ #include "base/hash_tables.h" #include "base/scoped_ptr.h" #include "base/task.h" +#include "base/weak_ptr.h" #include "net/base/cache_type.h" #include "net/http/http_transaction_factory.h" @@ -38,7 +39,8 @@ class HttpResponseInfo; class ProxyService; class SSLConfigService; -class HttpCache : public HttpTransactionFactory { +class HttpCache : public HttpTransactionFactory, + public base::SupportsWeakPtr<HttpCache> { public: ~HttpCache(); @@ -206,8 +208,6 @@ class HttpCache : public HttpTransactionFactory { typedef base::hash_map<std::string, int> PlaybackCacheMap; scoped_ptr<PlaybackCacheMap> playback_cache_map_; - RevocableStore transactions_; - DISALLOW_COPY_AND_ASSIGN(HttpCache); }; |