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

Side by Side Diff: media/base/callback.cc

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, 7 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 | « media/base/callback.h ('k') | media/filters/decoder_base.h » ('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) 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
OLDNEW
« no previous file with comments | « media/base/callback.h ('k') | media/filters/decoder_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698