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

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

Issue 1406213005: [tracing] Add names to memory-infra dumpers for debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@memory-infra-runtime
Patch Set: Rebase + fix android Created 5 years, 1 month 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/trace_event/memory_dump_manager.cc ('k') | base/trace_event/trace_log.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 "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 25 matching lines...) Expand all
36 MATCHER(IsLightDump, "") { 36 MATCHER(IsLightDump, "") {
37 return arg.level_of_detail == MemoryDumpLevelOfDetail::LIGHT; 37 return arg.level_of_detail == MemoryDumpLevelOfDetail::LIGHT;
38 } 38 }
39 39
40 namespace { 40 namespace {
41 void RegisterDumpProvider( 41 void RegisterDumpProvider(
42 MemoryDumpProvider* mdp, 42 MemoryDumpProvider* mdp,
43 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { 43 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
44 MemoryDumpManager* mdm = MemoryDumpManager::GetInstance(); 44 MemoryDumpManager* mdm = MemoryDumpManager::GetInstance();
45 mdm->set_dumper_registrations_ignored_for_testing(false); 45 mdm->set_dumper_registrations_ignored_for_testing(false);
46 mdm->RegisterDumpProvider(mdp, task_runner); 46 mdm->RegisterDumpProvider(mdp, "TestDumpProvider", task_runner);
47 mdm->set_dumper_registrations_ignored_for_testing(true); 47 mdm->set_dumper_registrations_ignored_for_testing(true);
48 } 48 }
49 49
50 void RegisterDumpProvider(MemoryDumpProvider* mdp) { 50 void RegisterDumpProvider(MemoryDumpProvider* mdp) {
51 RegisterDumpProvider(mdp, nullptr); 51 RegisterDumpProvider(mdp, nullptr);
52 } 52 }
53 } // namespace 53 } // namespace
54 54
55 // Testing MemoryDumpManagerDelegate which, by default, short-circuits dump 55 // Testing MemoryDumpManagerDelegate which, by default, short-circuits dump
56 // requests locally to the MemoryDumpManager instead of performing IPC dances. 56 // requests locally to the MemoryDumpManager instead of performing IPC dances.
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 713
714 EnableTracingWithTraceConfig( 714 EnableTracingWithTraceConfig(
715 TraceConfigMemoryTestUtil::GetTraceConfig_PeriodicTriggers( 715 TraceConfigMemoryTestUtil::GetTraceConfig_PeriodicTriggers(
716 kLightDumpPeriodMs, kHeavyDumpPeriodMs)); 716 kLightDumpPeriodMs, kHeavyDumpPeriodMs));
717 run_loop.Run(); 717 run_loop.Run();
718 DisableTracing(); 718 DisableTracing();
719 } 719 }
720 720
721 } // namespace trace_event 721 } // namespace trace_event
722 } // namespace base 722 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | base/trace_event/trace_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698