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

Unified Diff: base/threading/thread_perftest.cc

Issue 2032603002: Migrate WaitableEvent to enum-based constructor in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: Created 4 years, 7 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_local_unittest.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 5958f1aa6de792f6d8c32c0246504a93446793b0..9d69ac36e499838365b691654e97339f285530eb 100644
--- a/base/threading/thread_perftest.cc
+++ b/base/threading/thread_perftest.cc
@@ -35,7 +35,8 @@ const int kNumRuns = 100000;
class ThreadPerfTest : public testing::Test {
public:
ThreadPerfTest()
- : done_(false, false) {
+ : done_(WaitableEvent::ResetPolicy::AUTOMATIC,
+ WaitableEvent::InitialState::NOT_SIGNALED) {
// Disable the task profiler as it adds significant cost!
CommandLine::Init(0, NULL);
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
@@ -59,7 +60,8 @@ class ThreadPerfTest : public testing::Test {
}
base::ThreadTicks ThreadNow(base::Thread* thread) {
- base::WaitableEvent done(false, false);
+ base::WaitableEvent done(WaitableEvent::ResetPolicy::AUTOMATIC,
+ WaitableEvent::InitialState::NOT_SIGNALED);
base::ThreadTicks ticks;
thread->task_runner()->PostTask(
FROM_HERE, base::Bind(&ThreadPerfTest::TimeOnThread,
@@ -179,7 +181,9 @@ class EventPerfTest : public ThreadPerfTest {
public:
void Init() override {
for (size_t i = 0; i < threads_.size(); i++)
- events_.push_back(new WaitableEventType(false, false));
+ events_.push_back(
+ new WaitableEventType(WaitableEvent::ResetPolicy::AUTOMATIC,
+ WaitableEvent::InitialState::NOT_SIGNALED));
gab 2016/06/01 19:16:05 @etienneb: weird that clang-tidy made this change
etienneb 2016/06/01 19:53:27 You can use this to avoid template instantiation.
}
void Reset() override { events_.clear(); }
« no previous file with comments | « base/threading/thread_local_unittest.cc ('k') | base/threading/thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698