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

Unified Diff: media/audio/null_audio_sink.cc

Issue 66183002: Replace MessageLoopProxy with SingleThreadTaskRunner for the rest of media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win and audio tests Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/null_audio_sink.h ('k') | media/audio/pulse/pulse_output.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/null_audio_sink.cc
diff --git a/media/audio/null_audio_sink.cc b/media/audio/null_audio_sink.cc
index 607d7d861e2f74dfea2958b86fa578f7261e907a..dfd07fcee6afab0b075071e654609b52cea6680d 100644
--- a/media/audio/null_audio_sink.cc
+++ b/media/audio/null_audio_sink.cc
@@ -5,18 +5,18 @@
#include "media/audio/null_audio_sink.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
#include "media/audio/fake_audio_consumer.h"
#include "media/base/audio_hash.h"
namespace media {
NullAudioSink::NullAudioSink(
- const scoped_refptr<base::MessageLoopProxy>& message_loop)
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
: initialized_(false),
playing_(false),
callback_(NULL),
- message_loop_(message_loop) {
+ task_runner_(task_runner) {
}
NullAudioSink::~NullAudioSink() {}
@@ -24,18 +24,18 @@ NullAudioSink::~NullAudioSink() {}
void NullAudioSink::Initialize(const AudioParameters& params,
RenderCallback* callback) {
DCHECK(!initialized_);
- fake_consumer_.reset(new FakeAudioConsumer(message_loop_, params));
+ fake_consumer_.reset(new FakeAudioConsumer(task_runner_, params));
callback_ = callback;
initialized_ = true;
}
void NullAudioSink::Start() {
- DCHECK(message_loop_->BelongsToCurrentThread());
+ DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK(!playing_);
}
void NullAudioSink::Stop() {
- DCHECK(message_loop_->BelongsToCurrentThread());
+ DCHECK(task_runner_->BelongsToCurrentThread());
// Stop may be called at any time, so we have to check before stopping.
if (fake_consumer_)
@@ -43,7 +43,7 @@ void NullAudioSink::Stop() {
}
void NullAudioSink::Play() {
- DCHECK(message_loop_->BelongsToCurrentThread());
+ DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK(initialized_);
if (playing_)
@@ -55,7 +55,7 @@ void NullAudioSink::Play() {
}
void NullAudioSink::Pause() {
- DCHECK(message_loop_->BelongsToCurrentThread());
+ DCHECK(task_runner_->BelongsToCurrentThread());
if (!playing_)
return;
@@ -70,7 +70,7 @@ bool NullAudioSink::SetVolume(double volume) {
}
void NullAudioSink::CallRender(AudioBus* audio_bus) {
- DCHECK(message_loop_->BelongsToCurrentThread());
+ DCHECK(task_runner_->BelongsToCurrentThread());
int frames_received = callback_->Render(audio_bus, 0);
if (!audio_hash_ || frames_received <= 0)
« no previous file with comments | « media/audio/null_audio_sink.h ('k') | media/audio/pulse/pulse_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698