summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-10 20:40:36 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-10 20:40:36 +0000
commit9230ac4333edf1449bfba5a3eea17e6b8064f3b0 (patch)
tree294b453bf67474a04b21e569fe990ed063919143 /base
parent24864e4e13f014b00340d37e9328b479b3c7e887 (diff)
downloadchromium_src-9230ac4333edf1449bfba5a3eea17e6b8064f3b0.zip
chromium_src-9230ac4333edf1449bfba5a3eea17e6b8064f3b0.tar.gz
chromium_src-9230ac4333edf1449bfba5a3eea17e6b8064f3b0.tar.bz2
Made ObserverListThreadSafe's destructor private since it's ref-counted.
BUG=None TEST=Compiles Review URL: http://codereview.chromium.org/3832006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/observer_list_threadsafe.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h
index d034e6c..6085fde 100644
--- a/base/observer_list_threadsafe.h
+++ b/base/observer_list_threadsafe.h
@@ -60,13 +60,6 @@ class ObserverListThreadSafe
: type_(ObserverListBase<ObserverType>::NOTIFY_ALL) {}
explicit ObserverListThreadSafe(NotificationType type) : type_(type) {}
- ~ObserverListThreadSafe() {
- typename ObserversListMap::const_iterator it;
- for (it = observer_lists_.begin(); it != observer_lists_.end(); ++it)
- delete (*it).second;
- observer_lists_.clear();
- }
-
// Add an observer to the list.
void AddObserver(ObserverType* obs) {
ObserverList<ObserverType>* list = NULL;
@@ -137,6 +130,15 @@ class ObserverListThreadSafe
// TODO(mbelshe): Add more wrappers for Notify() with more arguments.
private:
+ friend class
+ base::RefCountedThreadSafe<ObserverListThreadSafe<ObserverType> >;
+ ~ObserverListThreadSafe() {
+ typename ObserversListMap::const_iterator it;
+ for (it = observer_lists_.begin(); it != observer_lists_.end(); ++it)
+ delete (*it).second;
+ observer_lists_.clear();
+ }
+
template <class Method, class Params>
void Notify(const UnboundMethod<ObserverType, Method, Params>& method) {
AutoLock lock(list_lock_);