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

Unified Diff: base/threading/thread_perftest.cc

Issue 1113953002: Revert of base: Remove use 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
« 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 3bc9fb409ce7b3e4bbc42992f4cd5d0d732aceed..a08cc5bf87274ee1ab950d169313720d19a594e7 100644
--- a/base/threading/thread_perftest.cc
+++ b/base/threading/thread_perftest.cc
@@ -5,9 +5,7 @@
#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"
@@ -56,9 +54,12 @@
base::TimeTicks ThreadNow(base::Thread* thread) {
base::WaitableEvent done(false, false);
base::TimeTicks ticks;
- thread->task_runner()->PostTask(
- FROM_HERE, base::Bind(&ThreadPerfTest::TimeOnThread,
- base::Unretained(this), &ticks, &done));
+ thread->message_loop_proxy()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadPerfTest::TimeOnThread,
+ base::Unretained(this),
+ &ticks,
+ &done));
done.Wait();
return ticks;
}
@@ -127,9 +128,10 @@
FinishMeasurement();
return;
}
- NextThread(hops)->task_runner()->PostTask(
- FROM_HERE, base::Bind(&ThreadPerfTest::PingPong, base::Unretained(this),
- hops - 1));
+ NextThread(hops)->message_loop_proxy()->PostTask(
+ FROM_HERE,
+ base::Bind(
+ &ThreadPerfTest::PingPong, base::Unretained(this), hops - 1));
}
};
@@ -196,9 +198,11 @@
void PingPong(int hops) override {
remaining_hops_ = hops;
for (size_t i = 0; i < threads_.size(); i++) {
- threads_[i]->task_runner()->PostTask(
- FROM_HERE, base::Bind(&EventPerfTest::WaitAndSignalOnThread,
- base::Unretained(this), i));
+ threads_[i]->message_loop_proxy()->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