OLD | NEW |
---|---|
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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 | 111 |
112 if (skip_core_dumpers_auto_registration_for_testing_) | 112 if (skip_core_dumpers_auto_registration_for_testing_) |
113 return; | 113 return; |
114 | 114 |
115 // Enable the core dump providers. | 115 // Enable the core dump providers. |
116 #if !defined(OS_NACL) | 116 #if !defined(OS_NACL) |
117 RegisterDumpProvider(ProcessMemoryTotalsDumpProvider::GetInstance()); | 117 RegisterDumpProvider(ProcessMemoryTotalsDumpProvider::GetInstance()); |
118 #endif | 118 #endif |
119 | 119 |
120 #if defined(OS_LINUX) || defined(OS_ANDROID) | 120 #if defined(OS_LINUX) || defined(OS_ANDROID) |
121 g_mmaps_dump_provider = ProcessMemoryMapsDumpProvider::GetInstance(); | 121 // The memory maps dump provider is currently disabled for security reasons |
122 RegisterDumpProvider(g_mmaps_dump_provider); | 122 // and will be enabled once tracing is more secure (crbug.com/517906). |
123 // It is still enabled for running benchmarks. | |
124 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
125 "enable-memory-benchmarking")) { | |
mdempsky
2015/08/07 22:48:25
Shouldn't this be switches::kEnableMemoryBenchmark
ssid
2015/08/07 22:58:06
actually base does not know about content switches
mdempsky
2015/08/07 23:01:59
Ah, fair point.
| |
126 g_mmaps_dump_provider = ProcessMemoryMapsDumpProvider::GetInstance(); | |
127 RegisterDumpProvider(g_mmaps_dump_provider); | |
128 } | |
129 | |
123 RegisterDumpProvider(MallocDumpProvider::GetInstance()); | 130 RegisterDumpProvider(MallocDumpProvider::GetInstance()); |
124 system_allocator_pool_name_ = MallocDumpProvider::kAllocatedObjects; | 131 system_allocator_pool_name_ = MallocDumpProvider::kAllocatedObjects; |
125 #endif | 132 #endif |
126 | 133 |
127 #if defined(OS_ANDROID) | 134 #if defined(OS_ANDROID) |
128 RegisterDumpProvider(JavaHeapDumpProvider::GetInstance()); | 135 RegisterDumpProvider(JavaHeapDumpProvider::GetInstance()); |
129 #endif | 136 #endif |
130 | 137 |
131 #if defined(OS_WIN) | 138 #if defined(OS_WIN) |
132 RegisterDumpProvider(WinHeapDumpProvider::GetInstance()); | 139 RegisterDumpProvider(WinHeapDumpProvider::GetInstance()); |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 next_dump_provider(next_dump_provider), | 489 next_dump_provider(next_dump_provider), |
483 callback(callback), | 490 callback(callback), |
484 task_runner(MessageLoop::current()->task_runner()) { | 491 task_runner(MessageLoop::current()->task_runner()) { |
485 } | 492 } |
486 | 493 |
487 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { | 494 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { |
488 } | 495 } |
489 | 496 |
490 } // namespace trace_event | 497 } // namespace trace_event |
491 } // namespace base | 498 } // namespace base |
OLD | NEW |