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

Side by Side Diff: base/test/test_io_thread.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: undo incorrect template change 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 unified diff | Download patch
« no previous file with comments | « base/task_scheduler/task_tracker_unittest.cc ('k') | base/test/thread_test_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/test/test_io_thread.h" 5 #include "base/test/test_io_thread.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 io_thread_started_ = false; 49 io_thread_started_ = false;
50 } 50 }
51 51
52 void TestIOThread::PostTask(const tracked_objects::Location& from_here, 52 void TestIOThread::PostTask(const tracked_objects::Location& from_here,
53 const base::Closure& task) { 53 const base::Closure& task) {
54 task_runner()->PostTask(from_here, task); 54 task_runner()->PostTask(from_here, task);
55 } 55 }
56 56
57 void TestIOThread::PostTaskAndWait(const tracked_objects::Location& from_here, 57 void TestIOThread::PostTaskAndWait(const tracked_objects::Location& from_here,
58 const base::Closure& task) { 58 const base::Closure& task) {
59 base::WaitableEvent event(false, false); 59 base::WaitableEvent event(WaitableEvent::ResetPolicy::AUTOMATIC,
60 WaitableEvent::InitialState::NOT_SIGNALED);
60 task_runner()->PostTask(from_here, 61 task_runner()->PostTask(from_here,
61 base::Bind(&PostTaskAndWaitHelper, &event, task)); 62 base::Bind(&PostTaskAndWaitHelper, &event, task));
62 event.Wait(); 63 event.Wait();
63 } 64 }
64 65
65 } // namespace base 66 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/task_tracker_unittest.cc ('k') | base/test/thread_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698