OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/trace_event/memory_dump_manager.h" | 5 #include "base/trace_event/memory_dump_manager.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 OnceClosure task, | 192 OnceClosure task, |
193 TimeDelta delay) override { | 193 TimeDelta delay) override { |
194 num_of_post_tasks_++; | 194 num_of_post_tasks_++; |
195 if (enabled_) { | 195 if (enabled_) { |
196 return worker_pool_.pool()->PostSequencedWorkerTask(token_, from_here, | 196 return worker_pool_.pool()->PostSequencedWorkerTask(token_, from_here, |
197 std::move(task)); | 197 std::move(task)); |
198 } | 198 } |
199 return false; | 199 return false; |
200 } | 200 } |
201 | 201 |
202 bool RunsTasksOnCurrentThread() const override { | 202 bool RunsTasksInCurrentSequence() const override { |
203 return worker_pool_.pool()->RunsTasksOnCurrentThread(); | 203 return worker_pool_.pool()->RunsTasksInCurrentSequence(); |
204 } | 204 } |
205 | 205 |
206 private: | 206 private: |
207 ~TestSequencedTaskRunner() override {} | 207 ~TestSequencedTaskRunner() override {} |
208 | 208 |
209 SequencedWorkerPoolOwner worker_pool_; | 209 SequencedWorkerPoolOwner worker_pool_; |
210 const SequencedWorkerPool::SequenceToken token_; | 210 const SequencedWorkerPool::SequenceToken token_; |
211 bool enabled_; | 211 bool enabled_; |
212 unsigned num_of_post_tasks_; | 212 unsigned num_of_post_tasks_; |
213 }; | 213 }; |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 thread.Start(); | 1302 thread.Start(); |
1303 RegisterDumpProvider(&mdp1, thread.task_runner(), kDefaultOptions, | 1303 RegisterDumpProvider(&mdp1, thread.task_runner(), kDefaultOptions, |
1304 "BlacklistTestDumpProvider"); | 1304 "BlacklistTestDumpProvider"); |
1305 // Unregistering on wrong thread should not crash. | 1305 // Unregistering on wrong thread should not crash. |
1306 mdm_->UnregisterDumpProvider(&mdp1); | 1306 mdm_->UnregisterDumpProvider(&mdp1); |
1307 thread.Stop(); | 1307 thread.Stop(); |
1308 } | 1308 } |
1309 | 1309 |
1310 } // namespace trace_event | 1310 } // namespace trace_event |
1311 } // namespace base | 1311 } // namespace base |
OLD | NEW |