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

Side by Side Diff: base/task.h

Issue 7062013: Move media library AutoTaskRunner to base and rename ScopedTaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add innocuous but critical BASE_API modifier to ScopedTaskRunner declaration. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/task.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base_api.h" 9 #include "base/base_api.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 539
540 template <class Function, class A, class B, class C, class D, class E, 540 template <class Function, class A, class B, class C, class D, class E,
541 class F, class G, class H> 541 class F, class G, class H>
542 inline Task* NewRunnableFunction(Function function, const A& a, const B& b, 542 inline Task* NewRunnableFunction(Function function, const A& a, const B& b,
543 const C& c, const D& d, const E& e, const F& f, 543 const C& c, const D& d, const E& e, const F& f,
544 const G& g, const H& h) { 544 const G& g, const H& h) {
545 return new RunnableFunction<Function, Tuple8<A, B, C, D, E, F, G, H> >( 545 return new RunnableFunction<Function, Tuple8<A, B, C, D, E, F, G, H> >(
546 function, MakeTuple(a, b, c, d, e, f, g, h)); 546 function, MakeTuple(a, b, c, d, e, f, g, h));
547 } 547 }
548 548
549 namespace base {
550
551 // ScopedTaskRunner is akin to scoped_ptr for Tasks. It ensures that the Task
552 // is executed and deleted no matter how the current scope exits.
553 class BASE_API ScopedTaskRunner {
554 public:
555 // Takes ownership of the task.
556 explicit ScopedTaskRunner(Task* task);
557 ~ScopedTaskRunner();
558
559 Task* Release();
560
561 private:
562 Task* task_;
563
564 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTaskRunner);
565 };
566
567 } // namespace base
568
549 #endif // BASE_TASK_H_ 569 #endif // BASE_TASK_H_
OLDNEW
« no previous file with comments | « no previous file | base/task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698