OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |