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

Side by Side Diff: base/task.h

Issue 7353: Create a thread-safe observer list. Will be used (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/observer_list_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TASK_H__ 5 #ifndef BASE_TASK_H__
6 #define BASE_TASK_H__ 6 #define BASE_TASK_H__
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 618
619 template <class T, typename Arg1, typename Arg2, 619 template <class T, typename Arg1, typename Arg2,
620 typename Arg3, typename Arg4, typename Arg5> 620 typename Arg3, typename Arg4, typename Arg5>
621 typename Callback5<Arg1, Arg2, Arg3, Arg4, Arg5>::Type* NewCallback( 621 typename Callback5<Arg1, Arg2, Arg3, Arg4, Arg5>::Type* NewCallback(
622 T* object, 622 T* object,
623 void (T::*method)(Arg1, Arg2, Arg3, Arg4, Arg5)) { 623 void (T::*method)(Arg1, Arg2, Arg3, Arg4, Arg5)) {
624 return new CallbackImpl<T, void (T::*)(Arg1, Arg2, Arg3, Arg4, Arg5), 624 return new CallbackImpl<T, void (T::*)(Arg1, Arg2, Arg3, Arg4, Arg5),
625 Tuple5<Arg1, Arg2, Arg3, Arg4, Arg5> >(object, method); 625 Tuple5<Arg1, Arg2, Arg3, Arg4, Arg5> >(object, method);
626 } 626 }
627 627
628 // An UnboundMethod is a wrapper for a method where the actual object is
629 // provided at Run dispatch time.
630 template <class T, class Method, class Params>
631 class UnboundMethod {
632 public:
633 UnboundMethod(Method m, Params p) : m_(m), p_(p) {}
634 void Run(T* obj) const {
635 DispatchToMethod(obj, m_, p_);
636 }
637 private:
638 Method m_;
639 Params p_;
640 };
641
628 #endif // BASE_TASK_H__ 642 #endif // BASE_TASK_H__
629 643
OLDNEW
« no previous file with comments | « base/observer_list_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698