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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 } | 772 } |
773 | 773 |
774 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { | 774 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { |
775 } | 775 } |
776 | 776 |
777 ProcessMemoryDump* MemoryDumpManager::ProcessMemoryDumpAsyncState:: | 777 ProcessMemoryDump* MemoryDumpManager::ProcessMemoryDumpAsyncState:: |
778 GetOrCreateMemoryDumpContainerForProcess(ProcessId pid) { | 778 GetOrCreateMemoryDumpContainerForProcess(ProcessId pid) { |
779 auto iter = process_dumps.find(pid); | 779 auto iter = process_dumps.find(pid); |
780 if (iter == process_dumps.end()) { | 780 if (iter == process_dumps.end()) { |
781 std::unique_ptr<ProcessMemoryDump> new_pmd( | 781 std::unique_ptr<ProcessMemoryDump> new_pmd( |
782 new ProcessMemoryDump(session_state)); | 782 new ProcessMemoryDump(session_state, req_args.level_of_detail)); |
783 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; | 783 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; |
784 } | 784 } |
785 return iter->second.get(); | 785 return iter->second.get(); |
786 } | 786 } |
787 | 787 |
788 MemoryDumpManager::PeriodicGlobalDumpTimer::PeriodicGlobalDumpTimer() | 788 MemoryDumpManager::PeriodicGlobalDumpTimer::PeriodicGlobalDumpTimer() |
789 : periodic_dumps_count_(0) {} | 789 : periodic_dumps_count_(0) {} |
790 | 790 |
791 MemoryDumpManager::PeriodicGlobalDumpTimer::~PeriodicGlobalDumpTimer() { | 791 MemoryDumpManager::PeriodicGlobalDumpTimer::~PeriodicGlobalDumpTimer() { |
792 Stop(); | 792 Stop(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 if (heavy_dump_rate_ > 0 && periodic_dumps_count_ % heavy_dump_rate_ == 0) | 843 if (heavy_dump_rate_ > 0 && periodic_dumps_count_ % heavy_dump_rate_ == 0) |
844 level_of_detail = MemoryDumpLevelOfDetail::DETAILED; | 844 level_of_detail = MemoryDumpLevelOfDetail::DETAILED; |
845 ++periodic_dumps_count_; | 845 ++periodic_dumps_count_; |
846 | 846 |
847 MemoryDumpManager::GetInstance()->RequestGlobalDump( | 847 MemoryDumpManager::GetInstance()->RequestGlobalDump( |
848 MemoryDumpType::PERIODIC_INTERVAL, level_of_detail); | 848 MemoryDumpType::PERIODIC_INTERVAL, level_of_detail); |
849 } | 849 } |
850 | 850 |
851 } // namespace trace_event | 851 } // namespace trace_event |
852 } // namespace base | 852 } // namespace base |
OLD | NEW |