Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2327)

Unified Diff: base/observer_list_threadsafe.h

Issue 7190001: [Sync] Split DirectoryChangeListener for thread-safety (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix copyright Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/sync_internals/chrome_sync.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/observer_list_threadsafe.h
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h
index 883e28503e575939c54d3f1fb2aba596bd2677fc..f4ff68d7c942513dddcb79f2c26bd90549eeab5e 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:
« no previous file with comments | « no previous file | chrome/browser/resources/sync_internals/chrome_sync.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698