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

Unified Diff: base/threading/worker_pool_unittest.cc

Issue 2791243002: Rewrite base::Bind into base::BindOnce on trivial cases in base (Closed)
Patch Set: rebase Created 3 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_unittest.cc ('k') | base/timer/timer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_unittest.cc
diff --git a/base/threading/worker_pool_unittest.cc b/base/threading/worker_pool_unittest.cc
index ef4bed136e95357ac52b6426c74dcfe00a03c715..a6d2e757452d430e8c2a11b667e971a337ce414c 100644
--- a/base/threading/worker_pool_unittest.cc
+++ b/base/threading/worker_pool_unittest.cc
@@ -34,10 +34,9 @@ class PostTaskAndReplyTester
void RunTest() {
ASSERT_TRUE(thread_checker_.CalledOnValidThread());
WorkerPool::PostTaskAndReply(
- FROM_HERE,
- base::Bind(&PostTaskAndReplyTester::OnWorkerThread, this),
- base::Bind(&PostTaskAndReplyTester::OnOriginalThread, this),
- false);
+ FROM_HERE,
+ base::BindOnce(&PostTaskAndReplyTester::OnWorkerThread, this),
+ base::BindOnce(&PostTaskAndReplyTester::OnOriginalThread, this), false);
test_event_.Wait();
}
@@ -77,13 +76,13 @@ TEST_F(WorkerPoolTest, PostTask) {
WaitableEvent long_test_event(WaitableEvent::ResetPolicy::AUTOMATIC,
WaitableEvent::InitialState::NOT_SIGNALED);
+ WorkerPool::PostTask(
+ FROM_HERE,
+ base::BindOnce(&WaitableEvent::Signal, base::Unretained(&test_event)),
+ false);
WorkerPool::PostTask(FROM_HERE,
- base::Bind(&WaitableEvent::Signal,
- base::Unretained(&test_event)),
- false);
- WorkerPool::PostTask(FROM_HERE,
- base::Bind(&WaitableEvent::Signal,
- base::Unretained(&long_test_event)),
+ base::BindOnce(&WaitableEvent::Signal,
+ base::Unretained(&long_test_event)),
true);
test_event.Wait();
« no previous file with comments | « base/threading/thread_unittest.cc ('k') | base/timer/timer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698