diff options
Diffstat (limited to 'media/base/callback.cc')
-rw-r--r-- | media/base/callback.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/media/base/callback.cc b/media/base/callback.cc new file mode 100644 index 0000000..1e2b400 --- /dev/null +++ b/media/base/callback.cc @@ -0,0 +1,27 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/base/callback.h" + +namespace media { + +AutoTaskRunner::~AutoTaskRunner() { + if (task_.get()) { + task_->Run(); + } +} + +Callback0::Type* TaskToCallbackAdapter::NewCallback(Task* task) { + return new TaskToCallbackAdapter(task); +} + +TaskToCallbackAdapter::~TaskToCallbackAdapter() {} + +void TaskToCallbackAdapter::RunWithParams(const Tuple0& params) { + task_->Run(); +} + +TaskToCallbackAdapter::TaskToCallbackAdapter(Task* task) : task_(task) {} + +} // namespace media |