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

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

Issue 2077413009: Add TaskPriority as a parameter to SequencedWorkerPool in preparation for TaskScheduler experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a2_hook
Patch Set: tweak comment Created 4 years, 5 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/sequenced_worker_pool.cc ('k') | chrome/service/service_process.cc » ('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 <vector> 10 #include <vector>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 if (enable_mock_destructor) 140 if (enable_mock_destructor)
141 Destructor(); 141 Destructor();
142 } 142 }
143 143
144 bool enable_mock_destructor; 144 bool enable_mock_destructor;
145 }; 145 };
146 146
147 class TestSequencedTaskRunner : public SequencedTaskRunner { 147 class TestSequencedTaskRunner : public SequencedTaskRunner {
148 public: 148 public:
149 TestSequencedTaskRunner() 149 TestSequencedTaskRunner()
150 : worker_pool_( 150 : worker_pool_(new SequencedWorkerPool(2 /* max_threads */,
151 new SequencedWorkerPool(2 /* max_threads */, "Test Task Runner")), 151 "Test Task Runner",
152 base::TaskPriority::USER_VISIBLE)),
152 enabled_(true), 153 enabled_(true),
153 num_of_post_tasks_(0) {} 154 num_of_post_tasks_(0) {}
154 155
155 void set_enabled(bool value) { enabled_ = value; } 156 void set_enabled(bool value) { enabled_ = value; }
156 unsigned no_of_post_tasks() const { return num_of_post_tasks_; } 157 unsigned no_of_post_tasks() const { return num_of_post_tasks_; }
157 158
158 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, 159 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here,
159 const Closure& task, 160 const Closure& task,
160 TimeDelta delay) override { 161 TimeDelta delay) override {
161 NOTREACHED(); 162 NOTREACHED();
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 MemoryDumpLevelOfDetail::DETAILED); 1163 MemoryDumpLevelOfDetail::DETAILED);
1163 EXPECT_FALSE(last_callback_success_); 1164 EXPECT_FALSE(last_callback_success_);
1164 1165
1165 ASSERT_TRUE(IsPeriodicDumpingEnabled()); 1166 ASSERT_TRUE(IsPeriodicDumpingEnabled());
1166 run_loop.Run(); 1167 run_loop.Run();
1167 DisableTracing(); 1168 DisableTracing();
1168 } 1169 }
1169 1170
1170 } // namespace trace_event 1171 } // namespace trace_event
1171 } // namespace base 1172 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/sequenced_worker_pool.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698