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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 OnceClosure task, | 200 OnceClosure task, |
201 TimeDelta delay) override { | 201 TimeDelta delay) override { |
202 num_of_post_tasks_++; | 202 num_of_post_tasks_++; |
203 if (enabled_) { | 203 if (enabled_) { |
204 return worker_pool_.pool()->PostSequencedWorkerTask(token_, from_here, | 204 return worker_pool_.pool()->PostSequencedWorkerTask(token_, from_here, |
205 std::move(task)); | 205 std::move(task)); |
206 } | 206 } |
207 return false; | 207 return false; |
208 } | 208 } |
209 | 209 |
210 bool RunsTasksOnCurrentThread() const override { | 210 bool RunsTasksInCurrentSequence() const override { |
211 return worker_pool_.pool()->RunsTasksOnCurrentThread(); | 211 return worker_pool_.pool()->RunsTasksInCurrentSequence(); |
212 } | 212 } |
213 | 213 |
214 private: | 214 private: |
215 ~TestSequencedTaskRunner() override {} | 215 ~TestSequencedTaskRunner() override {} |
216 | 216 |
217 SequencedWorkerPoolOwner worker_pool_; | 217 SequencedWorkerPoolOwner worker_pool_; |
218 const SequencedWorkerPool::SequenceToken token_; | 218 const SequencedWorkerPool::SequenceToken token_; |
219 bool enabled_; | 219 bool enabled_; |
220 unsigned num_of_post_tasks_; | 220 unsigned num_of_post_tasks_; |
221 }; | 221 }; |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 EXPECT_EQ(3u, result.chrome_dump.v8_total_kb); | 1405 EXPECT_EQ(3u, result.chrome_dump.v8_total_kb); |
1406 // partition_alloc has partition_alloc/allocated_objects/* which is a subset | 1406 // partition_alloc has partition_alloc/allocated_objects/* which is a subset |
1407 // of partition_alloc/partitions/* so we only count the latter. | 1407 // of partition_alloc/partitions/* so we only count the latter. |
1408 EXPECT_EQ(4u, result.chrome_dump.partition_alloc_total_kb); | 1408 EXPECT_EQ(4u, result.chrome_dump.partition_alloc_total_kb); |
1409 // resident_set_kb should read from process_totals. | 1409 // resident_set_kb should read from process_totals. |
1410 EXPECT_EQ(5u, result.os_dump.resident_set_kb); | 1410 EXPECT_EQ(5u, result.os_dump.resident_set_kb); |
1411 }; | 1411 }; |
1412 | 1412 |
1413 } // namespace trace_event | 1413 } // namespace trace_event |
1414 } // namespace base | 1414 } // namespace base |
OLD | NEW |