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

Side by Side Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: rebase & remove inline keyword Created 3 years, 7 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/worker_pool.cc ('k') | cc/test/ordered_simple_task_runner.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 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
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
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
OLDNEW
« no previous file with comments | « base/threading/worker_pool.cc ('k') | cc/test/ordered_simple_task_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698