Chromium Code Reviews| Index: base/trace_event/memory_dump_manager.cc |
| diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc |
| index 35b27d9a03a0a0212b0f807e83068881f3d4395b..286a824a4b0207bca63ed70a4d1ee51dfa7efd53 100644 |
| --- a/base/trace_event/memory_dump_manager.cc |
| +++ b/base/trace_event/memory_dump_manager.cc |
| @@ -407,8 +407,14 @@ void MemoryDumpManager::SetupNextMemoryDump( |
| // (for discounting trace memory overhead) while holding the |lock_|. |
| TraceLog::GetInstance()->InitializeThreadLocalEventBufferIfSupported(); |
| - // If this was the last hop, create a trace event, add it to the trace and |
| - // finalize process dump (invoke callback). |
| + // |dump_thread_| might be destroyed before getting this point. |
| + // It means that tracing was disabled a moment ago. |
|
Primiano Tucci (use gerrit)
2016/04/13 20:19:16
s/a moment ago/right before starting this dump/
|
| + // Anyway either tracing is stopped or this was the last hop, create a trace |
| + // event, add it to the trace and finalize process dump (invoke callback). |
|
Primiano Tucci (use gerrit)
2016/04/13 20:19:16
s/(invoke callback)/, invoking the callback/
|
| + if (!pmd_async_state->dump_thread_task_runner.get()) { |
| + pmd_async_state->dump_successful = false; |
| + pmd_async_state->pending_dump_providers.clear(); |
| + } |
| if (pmd_async_state->pending_dump_providers.empty()) |
| return FinalizeDumpAndAddToTrace(std::move(pmd_async_state)); |
| @@ -418,20 +424,11 @@ void MemoryDumpManager::SetupNextMemoryDump( |
| pmd_async_state->pending_dump_providers.back().get(); |
| // If the dump provider did not specify a task runner affinity, dump on |
| - // |dump_thread_|. Note that |dump_thread_| might have been destroyed |
| - // meanwhile. |
| + // |dump_thread_| which is already checked above for presence. |
| SequencedTaskRunner* task_runner = mdpinfo->task_runner.get(); |
| if (!task_runner) { |
| DCHECK(mdpinfo->options.dumps_on_single_thread_task_runner); |
| task_runner = pmd_async_state->dump_thread_task_runner.get(); |
|
bashi
2016/04/13 23:39:01
DCHECK(task_runner) ?
|
| - if (!task_runner) { |
| - // If tracing was disabled before reaching CreateProcessDump() the |
| - // dump_thread_ would have been already torn down. Nack current dump and |
| - // continue. |
| - pmd_async_state->dump_successful = false; |
| - pmd_async_state->pending_dump_providers.pop_back(); |
| - return SetupNextMemoryDump(std::move(pmd_async_state)); |
| - } |
| } |
| if (mdpinfo->options.dumps_on_single_thread_task_runner && |