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