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

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: Added some missing includes. 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
« no previous file with comments | « base/threading/thread.cc ('k') | base/threading/thread_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/thread_perftest.cc
diff --git a/base/threading/thread_perftest.cc b/base/threading/thread_perftest.cc
index a08cc5bf87274ee1ab950d169313720d19a594e7..3bc9fb409ce7b3e4bbc42992f4cd5d0d732aceed 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 {
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.
« no previous file with comments | « base/threading/thread.cc ('k') | base/threading/thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698