diff options
author | Ben Murdoch <benm@google.com> | 2010-07-29 17:14:53 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-08-04 14:29:45 +0100 |
commit | c407dc5cd9bdc5668497f21b26b09d988ab439de (patch) | |
tree | 7eaf8707c0309516bdb042ad976feedaf72b0bb1 /base/observer_list_threadsafe.h | |
parent | 0998b1cdac5733f299c12d88bc31ef9c8035b8fa (diff) | |
download | external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.zip external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.gz external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.bz2 |
Merge Chromium src@r53293
Change-Id: Ia79acf8670f385cee48c45b0a75371d8e950af34
Diffstat (limited to 'base/observer_list_threadsafe.h')
-rw-r--r-- | base/observer_list_threadsafe.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h index ce30ce0..f7dabef 100644 --- a/base/observer_list_threadsafe.h +++ b/base/observer_list_threadsafe.h @@ -1,14 +1,16 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_OBSERVER_LIST_THREADSAFE_H_ #define BASE_OBSERVER_LIST_THREADSAFE_H_ -#include <vector> #include <algorithm> +#include <map> +#include <vector> #include "base/basictypes.h" +#include "base/callback.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/observer_list.h" @@ -27,7 +29,7 @@ // * Observers can register for notifications from any thread. // Callbacks to the observer will occur on the same thread where // the observer initially called AddObserver() from. -// * Any thread may trigger a notification via NOTIFY_OBSERVERS. +// * Any thread may trigger a notification via Notify(). // * Observers can remove themselves from the observer list inside // of a callback. // * If one thread is notifying observers concurrently with an observer @@ -137,7 +139,8 @@ class ObserverListThreadSafe for (it = observer_lists_.begin(); it != observer_lists_.end(); ++it) { MessageLoop* loop = (*it).first; ObserverList<ObserverType>* list = (*it).second; - loop->PostTask(FROM_HERE, + loop->PostTask( + FROM_HERE, NewRunnableMethod(this, &ObserverListThreadSafe<ObserverType>:: template NotifyWrapper<Method, Params>, list, method)); @@ -193,7 +196,7 @@ class ObserverListThreadSafe Lock list_lock_; // Protects the observer_lists_. ObserversListMap observer_lists_; - DISALLOW_EVIL_CONSTRUCTORS(ObserverListThreadSafe); + DISALLOW_COPY_AND_ASSIGN(ObserverListThreadSafe); }; #endif // BASE_OBSERVER_LIST_THREADSAFE_H_ |