| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 // The thread is gone. At this point the best thing we can do is to | 304 // The thread is gone. At this point the best thing we can do is to |
| 305 // disable the dump provider and abort this dump. | 305 // disable the dump provider and abort this dump. |
| 306 mdp_info->disabled = true; | 306 mdp_info->disabled = true; |
| 307 return AbortDumpLocked(callback, callback_task_runner, dump_guid); | 307 return AbortDumpLocked(callback, callback_task_runner, dump_guid); |
| 308 } | 308 } |
| 309 } // AutoLock(lock_) | 309 } // AutoLock(lock_) |
| 310 | 310 |
| 311 // Invoke the dump provider without holding the |lock_|. | 311 // Invoke the dump provider without holding the |lock_|. |
| 312 bool finalize = false; | 312 bool finalize = false; |
| 313 bool dump_successful = false; | 313 bool dump_successful = false; |
| 314 if (!skip_dump) | 314 |
| 315 dump_successful = mdp->OnMemoryDump(&pmd_async_state->process_memory_dump); | 315 // TODO(ssid): Change RequestGlobalDump to use MemoryDumpArgs along with |
| 316 // MemoryDumpType to get request for light / heavy dump, and remove this |
| 317 // constant. |
| 318 if (!skip_dump) { |
| 319 MemoryDumpArgs dump_args = {MemoryDumpArgs::LEVEL_OF_DETAIL_HIGH}; |
| 320 dump_successful = |
| 321 mdp->OnMemoryDump(dump_args, &pmd_async_state->process_memory_dump); |
| 322 } |
| 316 | 323 |
| 317 { | 324 { |
| 318 AutoLock lock(lock_); | 325 AutoLock lock(lock_); |
| 319 if (did_unregister_dump_provider_) { | 326 if (did_unregister_dump_provider_) { |
| 320 return AbortDumpLocked(pmd_async_state->callback, | 327 return AbortDumpLocked(pmd_async_state->callback, |
| 321 pmd_async_state->task_runner, | 328 pmd_async_state->task_runner, |
| 322 pmd_async_state->req_args.dump_guid); | 329 pmd_async_state->req_args.dump_guid); |
| 323 } | 330 } |
| 324 auto* mdp_info = &*pmd_async_state->next_dump_provider; | 331 auto* mdp_info = &*pmd_async_state->next_dump_provider; |
| 325 if (dump_successful) { | 332 if (dump_successful) { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 next_dump_provider(next_dump_provider), | 482 next_dump_provider(next_dump_provider), |
| 476 callback(callback), | 483 callback(callback), |
| 477 task_runner(MessageLoop::current()->task_runner()) { | 484 task_runner(MessageLoop::current()->task_runner()) { |
| 478 } | 485 } |
| 479 | 486 |
| 480 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { | 487 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { |
| 481 } | 488 } |
| 482 | 489 |
| 483 } // namespace trace_event | 490 } // namespace trace_event |
| 484 } // namespace base | 491 } // namespace base |
| OLD | NEW |