diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-16 22:32:14 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-16 22:32:14 +0000 |
commit | 71fb13330dc1c2838b609fb8535479e535ebf2bd (patch) | |
tree | af0b45d502c8478314520a00452fa43f5e005c13 /base/observer_list_threadsafe.h | |
parent | e9f1520b42f2219ff5136f80c434cd9c4073b77b (diff) | |
download | chromium_src-71fb13330dc1c2838b609fb8535479e535ebf2bd.zip chromium_src-71fb13330dc1c2838b609fb8535479e535ebf2bd.tar.gz chromium_src-71fb13330dc1c2838b609fb8535479e535ebf2bd.tar.bz2 |
[Sync] Split DirectoryChangeListener for thread-safety
Split DirectoryChangeListener into DirectoryChangeDelegate and
TransactionObserver classes. This removes a remove/notify race
condition with the DirectoryChange events.
Make syncable::{Read,Write}Transaction take Locations instead of
file/line pairs.
Move construction of sync_manager_ into sync thread.
Add logging utils in sync/logging.{h,cc}.
Add overloads to ObserverListThreadSafe::Notify for 2, 3, and 4
arguments.
Fixed 'Inital' misspelling in SyncBackendHost (finally).
BUG=85656
TEST=
Review URL: http://codereview.chromium.org/7190001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89413 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/observer_list_threadsafe.h')
-rw-r--r-- | base/observer_list_threadsafe.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h index 883e285..f4ff68d 100644 --- a/base/observer_list_threadsafe.h +++ b/base/observer_list_threadsafe.h @@ -148,11 +148,32 @@ class ObserverListThreadSafe } template <class Method, class A> - void Notify(Method m, const A &a) { + void Notify(Method m, const A& a) { UnboundMethod<ObserverType, Method, Tuple1<A> > method(m, MakeTuple(a)); Notify<Method, Tuple1<A> >(method); } + template <class Method, class A, class B> + void Notify(Method m, const A& a, const B& b) { + UnboundMethod<ObserverType, Method, Tuple2<A, B> > method( + m, MakeTuple(a, b)); + Notify<Method, Tuple2<A, B> >(method); + } + + template <class Method, class A, class B, class C> + void Notify(Method m, const A& a, const B& b, const C& c) { + UnboundMethod<ObserverType, Method, Tuple3<A, B, C> > method( + m, MakeTuple(a, b, c)); + Notify<Method, Tuple3<A, B, C> >(method); + } + + template <class Method, class A, class B, class C, class D> + void Notify(Method m, const A& a, const B& b, const C& c, const D& d) { + UnboundMethod<ObserverType, Method, Tuple4<A, B, C, D> > method( + m, MakeTuple(a, b, c, d)); + Notify<Method, Tuple4<A, B, C, D> >(method); + } + // TODO(mbelshe): Add more wrappers for Notify() with more arguments. private: |