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/non_thread_safe.h" | 9 #include "base/non_thread_safe.h" |
10 #include "base/raw_scoped_refptr_mismatch_checker.h" | 10 #include "base/raw_scoped_refptr_mismatch_checker.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // | 264 // |
265 // The invocation of DISABLE_RUNNABLE_METHOD_REFCOUNT should be done at the | 265 // The invocation of DISABLE_RUNNABLE_METHOD_REFCOUNT should be done at the |
266 // global namespace scope. Example: | 266 // global namespace scope. Example: |
267 // | 267 // |
268 // namespace foo { | 268 // namespace foo { |
269 // class Bar { | 269 // class Bar { |
270 // ... | 270 // ... |
271 // }; | 271 // }; |
272 // } // namespace foo | 272 // } // namespace foo |
273 // | 273 // |
274 // DISABLE_RUNNABLE_METHOD_REFCOUNT(foo::Bar) | 274 // DISABLE_RUNNABLE_METHOD_REFCOUNT(foo::Bar); |
275 // | 275 // |
276 // This is different from DISALLOW_COPY_AND_ASSIGN which is declared inside the | 276 // This is different from DISALLOW_COPY_AND_ASSIGN which is declared inside the |
277 // class. | 277 // class. |
278 #define DISABLE_RUNNABLE_METHOD_REFCOUNT(TypeName) \ | 278 #define DISABLE_RUNNABLE_METHOD_REFCOUNT(TypeName) \ |
279 template <> \ | 279 template <> \ |
280 struct RunnableMethodTraits<TypeName> { \ | 280 struct RunnableMethodTraits<TypeName> { \ |
281 void RetainCallee(TypeName* manager) {} \ | 281 void RetainCallee(TypeName* manager) {} \ |
282 void ReleaseCallee(TypeName* manager) {} \ | 282 void ReleaseCallee(TypeName* manager) {} \ |
283 } | 283 } |
284 | 284 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 inline CancelableTask* NewRunnableFunction(Function function, | 517 inline CancelableTask* NewRunnableFunction(Function function, |
518 const A& a, const B& b, | 518 const A& a, const B& b, |
519 const C& c, const D& d, | 519 const C& c, const D& d, |
520 const E& e, const F& f, | 520 const E& e, const F& f, |
521 const G& g, const H& h) { | 521 const G& g, const H& h) { |
522 return new RunnableFunction<Function, Tuple8<A, B, C, D, E, F, G, H> >( | 522 return new RunnableFunction<Function, Tuple8<A, B, C, D, E, F, G, H> >( |
523 function, MakeTuple(a, b, c, d, e, f, g, h)); | 523 function, MakeTuple(a, b, c, d, e, f, g, h)); |
524 } | 524 } |
525 | 525 |
526 #endif // BASE_TASK_H_ | 526 #endif // BASE_TASK_H_ |
OLD | NEW |