| 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/allocator/features.h" | 10 #include "base/allocator/features.h" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 // NACK the dump. | 507 // NACK the dump. |
| 508 pmd_async_state.reset(new ProcessMemoryDumpAsyncState( | 508 pmd_async_state.reset(new ProcessMemoryDumpAsyncState( |
| 509 args, dump_providers_, session_state_, callback, | 509 args, dump_providers_, session_state_, callback, |
| 510 dump_thread_ ? dump_thread_->task_runner() : nullptr)); | 510 dump_thread_ ? dump_thread_->task_runner() : nullptr)); |
| 511 | 511 |
| 512 // Safety check to prevent reaching here without calling RequestGlobalDump, | 512 // Safety check to prevent reaching here without calling RequestGlobalDump, |
| 513 // with disallowed modes. If |session_state_| is null then tracing is | 513 // with disallowed modes. If |session_state_| is null then tracing is |
| 514 // disabled. | 514 // disabled. |
| 515 CHECK(!session_state_ || | 515 CHECK(!session_state_ || |
| 516 session_state_->IsDumpModeAllowed(args.level_of_detail)); | 516 session_state_->IsDumpModeAllowed(args.level_of_detail)); |
| 517 |
| 518 if (dump_scheduler_) |
| 519 dump_scheduler_->NotifyDumpTriggered(); |
| 517 } | 520 } |
| 518 | 521 |
| 519 TRACE_EVENT_WITH_FLOW0(kTraceCategory, "MemoryDumpManager::CreateProcessDump", | 522 TRACE_EVENT_WITH_FLOW0(kTraceCategory, "MemoryDumpManager::CreateProcessDump", |
| 520 TRACE_ID_MANGLE(args.dump_guid), | 523 TRACE_ID_MANGLE(args.dump_guid), |
| 521 TRACE_EVENT_FLAG_FLOW_OUT); | 524 TRACE_EVENT_FLAG_FLOW_OUT); |
| 522 | 525 |
| 523 // Start the process dump. This involves task runner hops as specified by the | 526 // Start the process dump. This involves task runner hops as specified by the |
| 524 // MemoryDumpProvider(s) in RegisterDumpProvider()). | 527 // MemoryDumpProvider(s) in RegisterDumpProvider()). |
| 525 SetupNextMemoryDump(std::move(pmd_async_state)); | 528 SetupNextMemoryDump(std::move(pmd_async_state)); |
| 526 } | 529 } |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 if (iter == process_dumps.end()) { | 968 if (iter == process_dumps.end()) { |
| 966 std::unique_ptr<ProcessMemoryDump> new_pmd( | 969 std::unique_ptr<ProcessMemoryDump> new_pmd( |
| 967 new ProcessMemoryDump(session_state, dump_args)); | 970 new ProcessMemoryDump(session_state, dump_args)); |
| 968 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; | 971 iter = process_dumps.insert(std::make_pair(pid, std::move(new_pmd))).first; |
| 969 } | 972 } |
| 970 return iter->second.get(); | 973 return iter->second.get(); |
| 971 } | 974 } |
| 972 | 975 |
| 973 } // namespace trace_event | 976 } // namespace trace_event |
| 974 } // namespace base | 977 } // namespace base |
| OLD | NEW |