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

Unified Diff: base/threading/thread_perftest.cc

Issue 1100773004: base: Remove most uses of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
Index: base/threading/thread_perftest.cc
diff --git a/base/threading/thread_perftest.cc b/base/threading/thread_perftest.cc
index b94f942fbb02b19c52b3735c0d4c9722ccc72f54..24ad5651a74985105b2497734c0809d61faf406d 100644
--- a/base/threading/thread_perftest.cc
+++ b/base/threading/thread_perftest.cc
@@ -5,7 +5,9 @@
#include "base/base_switches.h"
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/location.h"
#include "base/memory/scoped_vector.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
@@ -54,12 +56,9 @@ class ThreadPerfTest : public testing::Test {
base::TimeTicks ThreadNow(base::Thread* thread) {
base::WaitableEvent done(false, false);
base::TimeTicks ticks;
- thread->message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&ThreadPerfTest::TimeOnThread,
- base::Unretained(this),
- &ticks,
- &done));
+ thread->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&ThreadPerfTest::TimeOnThread,
+ base::Unretained(this), &ticks, &done));
done.Wait();
return ticks;
}
@@ -128,10 +127,9 @@ class TaskPerfTest : public ThreadPerfTest {
FinishMeasurement();
return;
}
- NextThread(hops)->message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(
- &ThreadPerfTest::PingPong, base::Unretained(this), hops - 1));
+ NextThread(hops)->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&ThreadPerfTest::PingPong, base::Unretained(this),
+ hops - 1));
}
};
@@ -198,11 +196,9 @@ class EventPerfTest : public ThreadPerfTest {
virtual void PingPong(int hops) override {
remaining_hops_ = hops;
for (size_t i = 0; i < threads_.size(); i++) {
- threads_[i]->message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&EventPerfTest::WaitAndSignalOnThread,
- base::Unretained(this),
- i));
+ threads_[i]->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&EventPerfTest::WaitAndSignalOnThread,
+ base::Unretained(this), i));
}
// Kick off the Signal ping-ponging.

Powered by Google App Engine
This is Rietveld 408576698