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

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

Issue 2823103003: Introduce TaskRunner::RunsTasksInCurrentSequence() (Closed)
Patch Set: rebase Created 3 years, 8 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
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 OnceClosure task, 208 OnceClosure task,
209 TimeDelta delay) override { 209 TimeDelta delay) override {
210 num_of_post_tasks_++; 210 num_of_post_tasks_++;
211 if (enabled_) { 211 if (enabled_) {
212 return worker_pool_.pool()->PostSequencedWorkerTask(token_, from_here, 212 return worker_pool_.pool()->PostSequencedWorkerTask(token_, from_here,
213 std::move(task)); 213 std::move(task));
214 } 214 }
215 return false; 215 return false;
216 } 216 }
217 217
218 bool RunsTasksOnCurrentThread() const override { 218 bool RunsTasksInCurrentSequence() const override {
219 return worker_pool_.pool()->RunsTasksOnCurrentThread(); 219 return worker_pool_.pool()->RunsTasksInCurrentSequence();
220 } 220 }
221 221
222 private: 222 private:
223 ~TestSequencedTaskRunner() override {} 223 ~TestSequencedTaskRunner() override {}
224 224
225 SequencedWorkerPoolOwner worker_pool_; 225 SequencedWorkerPoolOwner worker_pool_;
226 const SequencedWorkerPool::SequenceToken token_; 226 const SequencedWorkerPool::SequenceToken token_;
227 bool enabled_; 227 bool enabled_;
228 unsigned num_of_post_tasks_; 228 unsigned num_of_post_tasks_;
229 }; 229 };
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 thread.Start(); 1303 thread.Start();
1304 RegisterDumpProvider(&mdp1, thread.task_runner(), kDefaultOptions, 1304 RegisterDumpProvider(&mdp1, thread.task_runner(), kDefaultOptions,
1305 "BlacklistTestDumpProvider"); 1305 "BlacklistTestDumpProvider");
1306 // Unregistering on wrong thread should not crash. 1306 // Unregistering on wrong thread should not crash.
1307 mdm_->UnregisterDumpProvider(&mdp1); 1307 mdm_->UnregisterDumpProvider(&mdp1);
1308 thread.Stop(); 1308 thread.Stop();
1309 } 1309 }
1310 1310
1311 } // namespace trace_event 1311 } // namespace trace_event
1312 } // namespace base 1312 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698