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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 10855051: Use enum instead of string in MessageLoopFactory::GetMessageLoop* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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/filters/ffmpeg_audio_decoder.h ('k') | media/filters/ffmpeg_audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index 903edba437ee7484239326add7b4daebc30a0566..7a6ee41545da0e8abcbeb5e57223c82ff5678e27 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -6,6 +6,8 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
+#include "base/location.h"
+#include "base/message_loop_proxy.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/data_buffer.h"
#include "media/base/decoder_buffer.h"
@@ -26,8 +28,8 @@ static inline bool IsEndOfStream(int result, int decoded_size, Buffer* input) {
}
FFmpegAudioDecoder::FFmpegAudioDecoder(
- const base::Callback<MessageLoop*()>& message_loop_cb)
- : message_loop_factory_cb_(message_loop_cb),
+ const MessageLoopFactoryCB& message_loop_factory_cb)
+ : message_loop_factory_cb_(message_loop_factory_cb),
message_loop_(NULL),
codec_context_(NULL),
bits_per_channel_(0),
@@ -49,8 +51,7 @@ void FFmpegAudioDecoder::Initialize(
FFmpegGlue::GetInstance();
if (!message_loop_) {
- message_loop_ = message_loop_factory_cb_.Run();
- message_loop_factory_cb_.Reset();
+ message_loop_ = base::ResetAndReturn(&message_loop_factory_cb_).Run();
} else {
// TODO(scherkus): initialization currently happens more than once in
// PipelineIntegrationTest.BasicPlayback.
@@ -154,7 +155,7 @@ void FFmpegAudioDecoder::DoReset(const base::Closure& closure) {
}
void FFmpegAudioDecoder::DoRead(const ReadCB& read_cb) {
- DCHECK_EQ(MessageLoop::current(), message_loop_);
+ DCHECK(message_loop_->BelongsToCurrentThread());
DCHECK(!read_cb.is_null());
CHECK(read_cb_.is_null()) << "Overlapping decodes are not supported.";
@@ -165,7 +166,7 @@ void FFmpegAudioDecoder::DoRead(const ReadCB& read_cb) {
void FFmpegAudioDecoder::DoDecodeBuffer(
DemuxerStream::Status status,
const scoped_refptr<DecoderBuffer>& input) {
- DCHECK_EQ(MessageLoop::current(), message_loop_);
+ DCHECK(message_loop_->BelongsToCurrentThread());
DCHECK(!read_cb_.is_null());
if (status != DemuxerStream::kOk) {
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.h ('k') | media/filters/ffmpeg_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698