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

Side by Side Diff: base/task.cc

Issue 9071023: base::Bind: Remove CancelableTask and ScopedTaskRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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/task.h ('k') | base/task_unittest.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 #include "base/task.h" 5 #include "base/task.h"
6 6
7 Task::Task() { 7 Task::Task() {
8 } 8 }
9 9
10 Task::~Task() { 10 Task::~Task() {
11 } 11 }
12 12
13 CancelableTask::CancelableTask() {
14 }
15
16 CancelableTask::~CancelableTask() {
17 }
18
19 namespace base { 13 namespace base {
20 14
21 ScopedTaskRunner::ScopedTaskRunner(Task* task) : task_(task) {
22 }
23
24 ScopedTaskRunner::~ScopedTaskRunner() {
25 if (task_) {
26 task_->Run();
27 delete task_;
28 }
29 }
30
31 Task* ScopedTaskRunner::Release() {
32 Task* tmp = task_;
33 task_ = NULL;
34 return tmp;
35 }
36
37 ScopedClosureRunner::ScopedClosureRunner(const Closure& closure) 15 ScopedClosureRunner::ScopedClosureRunner(const Closure& closure)
38 : closure_(closure) { 16 : closure_(closure) {
39 } 17 }
40 18
41 ScopedClosureRunner::~ScopedClosureRunner() { 19 ScopedClosureRunner::~ScopedClosureRunner() {
42 if (!closure_.is_null()) 20 if (!closure_.is_null())
43 closure_.Run(); 21 closure_.Run();
44 } 22 }
45 23
46 Closure ScopedClosureRunner::Release() { 24 Closure ScopedClosureRunner::Release() {
(...skipping 25 matching lines...) Expand all
72 delete task_; 50 delete task_;
73 task_ = NULL; 51 task_ = NULL;
74 } 52 }
75 53
76 // Don't leak tasks by default. 54 // Don't leak tasks by default.
77 bool TaskClosureAdapter::kTaskLeakingDefault = false; 55 bool TaskClosureAdapter::kTaskLeakingDefault = false;
78 56
79 } // namespace subtle 57 } // namespace subtle
80 58
81 } // namespace base 59 } // namespace base
OLDNEW
« no previous file with comments | « base/task.h ('k') | base/task_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698