| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 if (skip_core_dumpers_auto_registration_for_testing_) | 110 if (skip_core_dumpers_auto_registration_for_testing_) |
| 111 return; | 111 return; |
| 112 | 112 |
| 113 // Enable the core dump providers. | 113 // Enable the core dump providers. |
| 114 #if !defined(OS_NACL) | 114 #if !defined(OS_NACL) |
| 115 RegisterDumpProvider(ProcessMemoryTotalsDumpProvider::GetInstance()); | 115 RegisterDumpProvider(ProcessMemoryTotalsDumpProvider::GetInstance()); |
| 116 #endif | 116 #endif |
| 117 | 117 |
| 118 #if defined(OS_LINUX) || defined(OS_ANDROID) | 118 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| 119 // The memory maps dump provider is currently disabled for security reasons | 119 RegisterDumpProvider(ProcessMemoryMapsDumpProvider::GetInstance()); |
| 120 // and will be enabled once tracing is more secure (crbug.com/517906). | |
| 121 // It is still enabled for running benchmarks. | |
| 122 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 123 "enable-memory-benchmarking")) { | |
| 124 RegisterDumpProvider(ProcessMemoryMapsDumpProvider::GetInstance()); | |
| 125 } | |
| 126 | |
| 127 RegisterDumpProvider(MallocDumpProvider::GetInstance()); | 120 RegisterDumpProvider(MallocDumpProvider::GetInstance()); |
| 128 system_allocator_pool_name_ = MallocDumpProvider::kAllocatedObjects; | 121 system_allocator_pool_name_ = MallocDumpProvider::kAllocatedObjects; |
| 129 #endif | 122 #endif |
| 130 | 123 |
| 131 #if defined(OS_ANDROID) | 124 #if defined(OS_ANDROID) |
| 132 RegisterDumpProvider(JavaHeapDumpProvider::GetInstance()); | 125 RegisterDumpProvider(JavaHeapDumpProvider::GetInstance()); |
| 133 #endif | 126 #endif |
| 134 | 127 |
| 135 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
| 136 RegisterDumpProvider(WinHeapDumpProvider::GetInstance()); | 129 RegisterDumpProvider(WinHeapDumpProvider::GetInstance()); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 next_dump_provider(next_dump_provider), | 466 next_dump_provider(next_dump_provider), |
| 474 callback(callback), | 467 callback(callback), |
| 475 task_runner(MessageLoop::current()->task_runner()) { | 468 task_runner(MessageLoop::current()->task_runner()) { |
| 476 } | 469 } |
| 477 | 470 |
| 478 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { | 471 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { |
| 479 } | 472 } |
| 480 | 473 |
| 481 } // namespace trace_event | 474 } // namespace trace_event |
| 482 } // namespace base | 475 } // namespace base |
| OLD | NEW |