OLD | NEW |
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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 inline CancelableTask* NewRunnableMethod(T* object, Method method, | 366 inline CancelableTask* NewRunnableMethod(T* object, Method method, |
367 const A& a, const B& b, | 367 const A& a, const B& b, |
368 const C& c, const D& d, const E& e) { | 368 const C& c, const D& d, const E& e) { |
369 return new RunnableMethod<T, | 369 return new RunnableMethod<T, |
370 Method, | 370 Method, |
371 Tuple5<A, B, C, D, E> >(object, | 371 Tuple5<A, B, C, D, E> >(object, |
372 method, | 372 method, |
373 MakeTuple(a, b, c, d, e)); | 373 MakeTuple(a, b, c, d, e)); |
374 } | 374 } |
375 | 375 |
| 376 template <class T, class Method, class A, class B, class C, class D, class E, |
| 377 class F> |
| 378 inline CancelableTask* NewRunnableMethod(T* object, Method method, |
| 379 const A& a, const B& b, |
| 380 const C& c, const D& d, const E& e, |
| 381 const F& f) { |
| 382 return new RunnableMethod<T, |
| 383 Method, |
| 384 Tuple6<A, B, C, D, E, F> >(object, |
| 385 method, |
| 386 MakeTuple(a, b, c, d, e, |
| 387 f)); |
| 388 } |
| 389 |
376 // RunnableFunction and NewRunnableFunction implementation --------------------- | 390 // RunnableFunction and NewRunnableFunction implementation --------------------- |
377 | 391 |
378 template <class Function, class Params> | 392 template <class Function, class Params> |
379 class RunnableFunction : public CancelableTask { | 393 class RunnableFunction : public CancelableTask { |
380 public: | 394 public: |
381 RunnableFunction(Function function, const Params& params) | 395 RunnableFunction(Function function, const Params& params) |
382 : function_(function), params_(params) { | 396 : function_(function), params_(params) { |
383 } | 397 } |
384 | 398 |
385 ~RunnableFunction() { | 399 ~RunnableFunction() { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 void Run(T* obj) const { | 648 void Run(T* obj) const { |
635 DispatchToMethod(obj, m_, p_); | 649 DispatchToMethod(obj, m_, p_); |
636 } | 650 } |
637 private: | 651 private: |
638 Method m_; | 652 Method m_; |
639 Params p_; | 653 Params p_; |
640 }; | 654 }; |
641 | 655 |
642 #endif // BASE_TASK_H__ | 656 #endif // BASE_TASK_H__ |
643 | 657 |
OLD | NEW |