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

Unified Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 1800743003: base: Remove some unnecessary const scoped_refptr<>&. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/process_memory_dump.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_manager_unittest.cc
diff --git a/base/trace_event/memory_dump_manager_unittest.cc b/base/trace_event/memory_dump_manager_unittest.cc
index 138ba69d5553863d408a9cc49d8a2f10c194de33..12227ee745d0cb061591f6bb33cee35c17608d94 100644
--- a/base/trace_event/memory_dump_manager_unittest.cc
+++ b/base/trace_event/memory_dump_manager_unittest.cc
@@ -51,42 +51,29 @@ namespace {
void RegisterDumpProvider(
MemoryDumpProvider* mdp,
- const scoped_refptr<base::SequencedTaskRunner>& task_runner,
- const MemoryDumpProvider::Options& options,
- bool dumps_on_single_thread_task_runner) {
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ const MemoryDumpProvider::Options& options) {
MemoryDumpManager* mdm = MemoryDumpManager::GetInstance();
mdm->set_dumper_registrations_ignored_for_testing(false);
const char* kMDPName = "TestDumpProvider";
- if (dumps_on_single_thread_task_runner) {
- scoped_refptr<base::SingleThreadTaskRunner> single_thread_task_runner =
- static_cast<base::SingleThreadTaskRunner*>(task_runner.get());
- mdm->RegisterDumpProvider(mdp, kMDPName,
- std::move(single_thread_task_runner), options);
- } else {
- mdm->RegisterDumpProviderWithSequencedTaskRunner(mdp, kMDPName, task_runner,
- options);
- }
+ mdm->RegisterDumpProvider(mdp, kMDPName, std::move(task_runner), options);
mdm->set_dumper_registrations_ignored_for_testing(true);
}
-void RegisterDumpProvider(
- MemoryDumpProvider* mdp,
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
- const MemoryDumpProvider::Options& options) {
- RegisterDumpProvider(mdp, task_runner, options,
- true /* dumps_on_single_thread_task_runner */);
-}
-
void RegisterDumpProvider(MemoryDumpProvider* mdp) {
RegisterDumpProvider(mdp, nullptr, MemoryDumpProvider::Options());
}
void RegisterDumpProviderWithSequencedTaskRunner(
MemoryDumpProvider* mdp,
- const scoped_refptr<base::SequencedTaskRunner>& task_runner,
+ scoped_refptr<base::SequencedTaskRunner> task_runner,
const MemoryDumpProvider::Options& options) {
- RegisterDumpProvider(mdp, task_runner, options,
- false /* dumps_on_single_thread_task_runner */);
+ MemoryDumpManager* mdm = MemoryDumpManager::GetInstance();
+ mdm->set_dumper_registrations_ignored_for_testing(false);
+ const char* kMDPName = "TestDumpProvider";
Primiano Tucci (use gerrit) 2016/03/15 15:58:11 Why are we re-duplicating the code here? The point
vmpstr 2016/03/15 18:57:38 The part that was a bit awkward was on lines 61-62
+ mdm->RegisterDumpProviderWithSequencedTaskRunner(mdp, kMDPName, task_runner,
danakj 2016/03/15 18:27:36 move the task runner?
+ options);
+ mdm->set_dumper_registrations_ignored_for_testing(true);
}
void OnTraceDataCollected(Closure quit_closure,
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/process_memory_dump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698