summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorskyostil <skyostil@chromium.org>2015-06-12 11:21:58 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-12 18:22:20 +0000
commita3899866682a1e846fc978368b00531a0e21d266 (patch)
treeca4ac5fd794e239361dabdca6aafcc830d927102 /media
parentb2134362e27459f1098a35effedad91e2d553192 (diff)
downloadchromium_src-a3899866682a1e846fc978368b00531a0e21d266.zip
chromium_src-a3899866682a1e846fc978368b00531a0e21d266.tar.gz
chromium_src-a3899866682a1e846fc978368b00531a0e21d266.tar.bz2
Remove remaining use of the deprecated MessageLoopProxy
This patch removes the remaining usage of MessageLoopProxy outside base/. Note that there are still some call sites for Thread::message_loop_proxy() and MessageLoop::message_loop_proxy() which will be cleaned up separately. BUG=465354 Review URL: https://codereview.chromium.org/1169923009 Cr-Commit-Position: refs/heads/master@{#334198}
Diffstat (limited to 'media')
-rw-r--r--media/audio/audio_output_device_unittest.cc10
-rw-r--r--media/audio/win/audio_low_latency_output_win_unittest.cc23
-rw-r--r--media/base/android/media_codec_player.cc3
3 files changed, 17 insertions, 19 deletions
diff --git a/media/audio/audio_output_device_unittest.cc b/media/audio/audio_output_device_unittest.cc
index 363ee38..d803483 100644
--- a/media/audio/audio_output_device_unittest.cc
+++ b/media/audio/audio_output_device_unittest.cc
@@ -59,9 +59,9 @@ ACTION_P2(SendPendingBytes, socket, pending_bytes) {
}
// Used to terminate a loop from a different thread than the loop belongs to.
-// |loop| should be a MessageLoopProxy.
-ACTION_P(QuitLoop, loop) {
- loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
+// |task_runner| should be a SingleThreadTaskRunner.
+ACTION_P(QuitLoop, task_runner) {
+ task_runner->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
}
} // namespace.
@@ -112,7 +112,7 @@ AudioOutputDeviceTest::AudioOutputDeviceTest() {
audio_output_ipc_ = new MockAudioOutputIPC();
audio_device_ = new AudioOutputDevice(
scoped_ptr<AudioOutputIPC>(audio_output_ipc_),
- io_loop_.message_loop_proxy());
+ io_loop_.task_runner());
audio_device_->Initialize(default_audio_parameters_,
&callback_);
@@ -177,7 +177,7 @@ void AudioOutputDeviceTest::ExpectRenderCallback() {
const int kNumberOfFramesToProcess = 0;
EXPECT_CALL(callback_, Render(_, _))
.WillOnce(DoAll(
- QuitLoop(io_loop_.message_loop_proxy()),
+ QuitLoop(io_loop_.task_runner()),
Return(kNumberOfFramesToProcess)));
}
diff --git a/media/audio/win/audio_low_latency_output_win_unittest.cc b/media/audio/win/audio_low_latency_output_win_unittest.cc
index 85516de..348543c 100644
--- a/media/audio/win/audio_low_latency_output_win_unittest.cc
+++ b/media/audio/win/audio_low_latency_output_win_unittest.cc
@@ -56,9 +56,9 @@ MATCHER_P(HasValidDelay, value, "") {
}
// Used to terminate a loop from a different thread than the loop belongs to.
-// |loop| should be a MessageLoopProxy.
-ACTION_P(QuitLoop, loop) {
- loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
+// |task_runner| should be a SingleThreadTaskRunner.
+ACTION_P(QuitLoop, task_runner) {
+ task_runner->PostTask(FROM_HERE, base::MessageLoop::QuitClosure());
}
// This audio source implementation should be used for manual tests only since
@@ -381,9 +381,8 @@ TEST(WASAPIAudioOutputStreamTest, ValidPacketSize) {
// Wait for the first callback and verify its parameters.
EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
- .WillOnce(DoAll(
- QuitLoop(loop.message_loop_proxy()),
- Return(aosw.samples_per_packet())));
+ .WillOnce(DoAll(QuitLoop(loop.task_runner()),
+ Return(aosw.samples_per_packet())));
aos->Start(&source);
loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(),
@@ -575,9 +574,8 @@ TEST(WASAPIAudioOutputStreamTest, DISABLED_ExclusiveModeMinBufferSizeAt48kHz) {
// Wait for the first callback and verify its parameters.
EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
- .WillOnce(DoAll(
- QuitLoop(loop.message_loop_proxy()),
- Return(aosw.samples_per_packet())))
+ .WillOnce(DoAll(QuitLoop(loop.task_runner()),
+ Return(aosw.samples_per_packet())))
.WillRepeatedly(Return(aosw.samples_per_packet()));
aos->Start(&source);
@@ -610,10 +608,9 @@ TEST(WASAPIAudioOutputStreamTest, DISABLED_ExclusiveModeMinBufferSizeAt44kHz) {
// Wait for the first callback and verify its parameters.
EXPECT_CALL(source, OnMoreData(NotNull(), HasValidDelay(bytes_per_packet)))
- .WillOnce(DoAll(
- QuitLoop(loop.message_loop_proxy()),
- Return(aosw.samples_per_packet())))
- .WillRepeatedly(Return(aosw.samples_per_packet()));
+ .WillOnce(DoAll(QuitLoop(loop.task_runner()),
+ Return(aosw.samples_per_packet())))
+ .WillRepeatedly(Return(aosw.samples_per_packet()));
aos->Start(&source);
loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(),
diff --git a/media/base/android/media_codec_player.cc b/media/base/android/media_codec_player.cc
index d7f84733..ca6f01e 100644
--- a/media/base/android/media_codec_player.cc
+++ b/media/base/android/media_codec_player.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "base/thread_task_runner_handle.h"
#define RUN_ON_MEDIA_THREAD(METHOD, ...) \
do { \
@@ -49,7 +50,7 @@ MediaCodecPlayer::MediaCodecPlayer(
manager,
request_media_resources_cb,
frame_url),
- ui_task_runner_(base::MessageLoopProxy::current()),
+ ui_task_runner_(base::ThreadTaskRunnerHandle::Get()),
demuxer_(demuxer.Pass()),
weak_factory_(this) {
// UI thread