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

Unified Diff: media/base/demuxer_perftest.cc

Issue 2086353002: Remove calls to deprecated MessageLoop methods in media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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/base/bind_to_current_loop_unittest.cc ('k') | media/base/fake_demuxer_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/demuxer_perftest.cc
diff --git a/media/base/demuxer_perftest.cc b/media/base/demuxer_perftest.cc
index aa755354a43cda1921ba1438c6b72365af67b072..06e804eb26729f48e1d7f610175d11347a13b706 100644
--- a/media/base/demuxer_perftest.cc
+++ b/media/base/demuxer_perftest.cc
@@ -10,6 +10,8 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
@@ -48,7 +50,8 @@ class DemuxerHostImpl : public media::DemuxerHost {
static void QuitLoopWithStatus(base::MessageLoop* message_loop,
media::PipelineStatus status) {
CHECK_EQ(status, media::PIPELINE_OK);
- message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
+ message_loop->task_runner()->PostTask(
+ FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
}
static void OnEncryptedMediaInitData(EmeInitDataType init_data_type,
@@ -128,7 +131,7 @@ void StreamReader::Read() {
streams_[index]->Read(base::Bind(
&StreamReader::OnReadDone, base::Unretained(this),
base::MessageLoop::current(), &end_of_stream, &timestamp));
- base::MessageLoop::current()->Run();
+ base::RunLoop().Run();
CHECK(end_of_stream || timestamp != media::kNoTimestamp());
end_of_stream_[index] = end_of_stream;
@@ -154,7 +157,8 @@ void StreamReader::OnReadDone(
CHECK(buffer.get());
*end_of_stream = buffer->end_of_stream();
*timestamp = *end_of_stream ? media::kNoTimestamp() : buffer->timestamp();
- message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
+ message_loop->task_runner()->PostTask(
+ FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
}
int StreamReader::GetNextStreamIndexToRead() {
@@ -198,7 +202,7 @@ static void RunDemuxerBenchmark(const std::string& filename) {
demuxer.Initialize(&demuxer_host,
base::Bind(&QuitLoopWithStatus, &message_loop),
false);
- message_loop.Run();
+ base::RunLoop().Run();
StreamReader stream_reader(&demuxer, false);
// Benchmark.
@@ -210,7 +214,7 @@ static void RunDemuxerBenchmark(const std::string& filename) {
total_time += (end - start).InSecondsF();
demuxer.Stop();
QuitLoopWithStatus(&message_loop, PIPELINE_OK);
- message_loop.Run();
+ base::RunLoop().Run();
}
perf_test::PrintResult("demuxer_bench",
« no previous file with comments | « media/base/bind_to_current_loop_unittest.cc ('k') | media/base/fake_demuxer_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698