| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/raw_scoped_refptr_mismatch_checker.h" | 9 #include "base/raw_scoped_refptr_mismatch_checker.h" |
| 10 #include "base/tracked.h" | 10 #include "base/tracked.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 const C& c, const D& d, const E& e, | 416 const C& c, const D& d, const E& e, |
| 417 const F& f, const G& g) { | 417 const F& f, const G& g) { |
| 418 return new RunnableMethod<T, | 418 return new RunnableMethod<T, |
| 419 Method, | 419 Method, |
| 420 Tuple7<A, B, C, D, E, F, G> >(object, | 420 Tuple7<A, B, C, D, E, F, G> >(object, |
| 421 method, | 421 method, |
| 422 MakeTuple(a, b, c, d, | 422 MakeTuple(a, b, c, d, |
| 423 e, f, g)); | 423 e, f, g)); |
| 424 } | 424 } |
| 425 | 425 |
| 426 template <class T, class Method, class A, class B, class C, class D, class E, |
| 427 class F, class G, class H> |
| 428 inline CancelableTask* NewRunnableMethod(T* object, Method method, |
| 429 const A& a, const B& b, |
| 430 const C& c, const D& d, const E& e, |
| 431 const F& f, const G& g, const H& h) { |
| 432 return new RunnableMethod<T, |
| 433 Method, |
| 434 Tuple8<A, B, C, D, E, F, G, H> >(object, |
| 435 method, |
| 436 MakeTuple(a, b, c, |
| 437 d, e, f, |
| 438 g, h)); |
| 439 } |
| 440 |
| 426 // RunnableFunction and NewRunnableFunction implementation --------------------- | 441 // RunnableFunction and NewRunnableFunction implementation --------------------- |
| 427 | 442 |
| 428 template <class Function, class Params> | 443 template <class Function, class Params> |
| 429 class RunnableFunction : public CancelableTask { | 444 class RunnableFunction : public CancelableTask { |
| 430 public: | 445 public: |
| 431 RunnableFunction(Function function, const Params& params) | 446 RunnableFunction(Function function, const Params& params) |
| 432 : function_(function), params_(params) { | 447 : function_(function), params_(params) { |
| 433 COMPILE_ASSERT( | 448 COMPILE_ASSERT( |
| 434 (base::internal::ParamsUseScopedRefptrCorrectly<Params>::value), | 449 (base::internal::ParamsUseScopedRefptrCorrectly<Params>::value), |
| 435 badrunnablefunctionparams); | 450 badrunnablefunctionparams); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 inline CancelableTask* NewRunnableFunction(Function function, | 537 inline CancelableTask* NewRunnableFunction(Function function, |
| 523 const A& a, const B& b, | 538 const A& a, const B& b, |
| 524 const C& c, const D& d, | 539 const C& c, const D& d, |
| 525 const E& e, const F& f, | 540 const E& e, const F& f, |
| 526 const G& g, const H& h) { | 541 const G& g, const H& h) { |
| 527 return new RunnableFunction<Function, Tuple8<A, B, C, D, E, F, G, H> >( | 542 return new RunnableFunction<Function, Tuple8<A, B, C, D, E, F, G, H> >( |
| 528 function, MakeTuple(a, b, c, d, e, f, g, h)); | 543 function, MakeTuple(a, b, c, d, e, f, g, h)); |
| 529 } | 544 } |
| 530 | 545 |
| 531 #endif // BASE_TASK_H_ | 546 #endif // BASE_TASK_H_ |
| OLD | NEW |