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 | |
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 const MemoryDumpArgs dump_args(MemoryDumpArgs::LEVEL_OF_DETAIL_HIGH); | |
petrcermak
2015/07/31 13:23:01
No need to build the object outside the if-stateme
ssid
2015/07/31 15:14:33
Done.
| |
314 if (!skip_dump) | 319 if (!skip_dump) |
315 dump_successful = mdp->OnMemoryDump(&pmd_async_state->process_memory_dump); | 320 dump_successful = |
321 mdp->OnMemoryDump(dump_args, &pmd_async_state->process_memory_dump); | |
316 | 322 |
317 { | 323 { |
318 AutoLock lock(lock_); | 324 AutoLock lock(lock_); |
319 if (did_unregister_dump_provider_) { | 325 if (did_unregister_dump_provider_) { |
320 return AbortDumpLocked(pmd_async_state->callback, | 326 return AbortDumpLocked(pmd_async_state->callback, |
321 pmd_async_state->task_runner, | 327 pmd_async_state->task_runner, |
322 pmd_async_state->req_args.dump_guid); | 328 pmd_async_state->req_args.dump_guid); |
323 } | 329 } |
324 auto* mdp_info = &*pmd_async_state->next_dump_provider; | 330 auto* mdp_info = &*pmd_async_state->next_dump_provider; |
325 if (dump_successful) { | 331 if (dump_successful) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
475 next_dump_provider(next_dump_provider), | 481 next_dump_provider(next_dump_provider), |
476 callback(callback), | 482 callback(callback), |
477 task_runner(MessageLoop::current()->task_runner()) { | 483 task_runner(MessageLoop::current()->task_runner()) { |
478 } | 484 } |
479 | 485 |
480 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { | 486 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { |
481 } | 487 } |
482 | 488 |
483 } // namespace trace_event | 489 } // namespace trace_event |
484 } // namespace base | 490 } // namespace base |
OLD | NEW |