OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "media/base/callback.h" | 5 #include "media/base/callback.h" |
6 | 6 |
7 namespace media { | 7 namespace media { |
8 | 8 |
| 9 AutoTaskRunner::~AutoTaskRunner() { |
| 10 if (task_.get()) { |
| 11 task_->Run(); |
| 12 } |
| 13 } |
| 14 |
9 AutoCallbackRunner::~AutoCallbackRunner() { | 15 AutoCallbackRunner::~AutoCallbackRunner() { |
10 if (callback_.get()) { | 16 if (callback_.get()) { |
11 callback_->Run(); | 17 callback_->Run(); |
12 } | 18 } |
13 } | 19 } |
14 | 20 |
15 Callback0::Type* TaskToCallbackAdapter::NewCallback(Task* task) { | 21 Callback0::Type* TaskToCallbackAdapter::NewCallback(Task* task) { |
16 return new TaskToCallbackAdapter(task); | 22 return new TaskToCallbackAdapter(task); |
17 } | 23 } |
18 | 24 |
19 TaskToCallbackAdapter::~TaskToCallbackAdapter() {} | 25 TaskToCallbackAdapter::~TaskToCallbackAdapter() {} |
20 | 26 |
21 void TaskToCallbackAdapter::RunWithParams(const Tuple0& params) { | 27 void TaskToCallbackAdapter::RunWithParams(const Tuple0& params) { |
22 task_->Run(); | 28 task_->Run(); |
23 } | 29 } |
24 | 30 |
25 TaskToCallbackAdapter::TaskToCallbackAdapter(Task* task) : task_(task) {} | 31 TaskToCallbackAdapter::TaskToCallbackAdapter(Task* task) : task_(task) {} |
26 | 32 |
27 } // namespace media | 33 } // namespace media |
OLD | NEW |