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 1e0a36a44e7b3f3f7758ac38bacdf2302d55e95a..4be09ce89e4b5f307c981a8332327ee16aff1563 100644 |
--- a/base/trace_event/memory_dump_manager.cc |
+++ b/base/trace_event/memory_dump_manager.cc |
@@ -283,6 +283,7 @@ void MemoryDumpManager::CreateProcessDump(const MemoryDumpRequestArgs& args, |
new ProcessMemoryDumpHolder(args, session_state_, callback)); |
ProcessMemoryDump* pmd = &pmd_holder->process_memory_dump; |
bool did_any_provider_dump = false; |
+ bool did_post_any_async_task = false; |
// Iterate over the active dump providers and invoke OnMemoryDump(pmd). |
// The MDM guarantees linearity (at most one MDP is active within one |
@@ -316,6 +317,7 @@ void MemoryDumpManager::CreateProcessDump(const MemoryDumpRequestArgs& args, |
// The thread underlying the TaskRunner might have gone away. |
if (did_post_async_task) |
++pmd_holder->num_pending_async_requests; |
+ did_post_any_async_task |= did_post_async_task; |
petrcermak
2015/06/15 14:00:26
As Simon suggested, this could be "... = true;" in
|
} else { |
// Invoke the dump provider synchronously. |
did_any_provider_dump |= InvokeDumpProviderLocked(mdp, pmd); |
@@ -326,7 +328,7 @@ void MemoryDumpManager::CreateProcessDump(const MemoryDumpRequestArgs& args, |
// If at least one synchronous provider did dump and there are no pending |
// asynchronous requests, add the dump to the trace and invoke the callback |
// straight away (FinalizeDumpAndAddToTrace() takes care of the callback). |
- if (did_any_provider_dump && pmd_holder->num_pending_async_requests == 0) |
+ if (did_any_provider_dump && !did_post_any_async_task) |
FinalizeDumpAndAddToTrace(pmd_holder); |
} |