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

Side by Side Diff: base/threading/post_task_and_reply_impl_unittest.cc

Issue 2637843002: Migrate base::TaskRunner from Closure to OnceClosure (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 unified diff | Download patch
« no previous file with comments | « base/threading/post_task_and_reply_impl.cc ('k') | base/threading/sequenced_worker_pool.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/threading/post_task_and_reply_impl.h" 5 #include "base/threading/post_task_and_reply_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 11 matching lines...) Expand all
22 22
23 namespace { 23 namespace {
24 24
25 class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl { 25 class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
26 public: 26 public:
27 explicit PostTaskAndReplyTaskRunner(TaskRunner* destination) 27 explicit PostTaskAndReplyTaskRunner(TaskRunner* destination)
28 : destination_(destination) {} 28 : destination_(destination) {}
29 29
30 private: 30 private:
31 bool PostTask(const tracked_objects::Location& from_here, 31 bool PostTask(const tracked_objects::Location& from_here,
32 Closure task) override { 32 OnceClosure task) override {
33 return destination_->PostTask(from_here, std::move(task)); 33 return destination_->PostTask(from_here, std::move(task));
34 } 34 }
35 35
36 // Non-owning. 36 // Non-owning.
37 TaskRunner* const destination_; 37 TaskRunner* const destination_;
38 }; 38 };
39 39
40 class ObjectToDelete : public RefCounted<ObjectToDelete> { 40 class ObjectToDelete : public RefCounted<ObjectToDelete> {
41 public: 41 public:
42 // |delete_flag| is set to true when this object is deleted 42 // |delete_flag| is set to true when this object is deleted
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 testing::Mock::VerifyAndClear(&mock_object); 103 testing::Mock::VerifyAndClear(&mock_object);
104 EXPECT_TRUE(delete_flag); 104 EXPECT_TRUE(delete_flag);
105 105
106 // Expect no pending task in |post_runner| and |reply_runner|. 106 // Expect no pending task in |post_runner| and |reply_runner|.
107 EXPECT_FALSE(post_runner->HasPendingTask()); 107 EXPECT_FALSE(post_runner->HasPendingTask());
108 EXPECT_FALSE(reply_runner->HasPendingTask()); 108 EXPECT_FALSE(reply_runner->HasPendingTask());
109 } 109 }
110 110
111 } // namespace internal 111 } // namespace internal
112 } // namespace base 112 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/post_task_and_reply_impl.cc ('k') | base/threading/sequenced_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698