summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorssid <ssid@chromium.org>2015-07-20 12:49:02 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-20 20:02:53 +0000
commit95c88464f5cd8e1d3b13e1e1e147e38f9ed81aa7 (patch)
treecc623440ce746bd059b22dce27ac1660e44ef654
parent94bc4db5e341fbda8ce8f2210c9fc6b056a82868 (diff)
downloadchromium_src-95c88464f5cd8e1d3b13e1e1e147e38f9ed81aa7.zip
chromium_src-95c88464f5cd8e1d3b13e1e1e147e38f9ed81aa7.tar.gz
chromium_src-95c88464f5cd8e1d3b13e1e1e147e38f9ed81aa7.tar.bz2
[tracing] Fix memory tracing controller in single-process-mode.
The global memory dump guid is set at the start of tracing and reset at the end of tracing session to sync up traces from all the processes and and to identify if there is a dump in progress already if new dump is requested. But, it is not set in single process mode. This CL changes the tracing controller to set the guid even in single process mode. The callback is passed to OnBrowserProcessMemoryDumpDone and will be called once the dump is complete. BUG=510776 Review URL: https://codereview.chromium.org/1239143002 Cr-Commit-Position: refs/heads/master@{#339491}
-rw-r--r--content/browser/tracing/tracing_controller_impl.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc
index 2ea35c1..7b1452f 100644
--- a/content/browser/tracing/tracing_controller_impl.cc
+++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -803,6 +803,8 @@ void TracingControllerImpl::RequestGlobalMemoryDump(
// OnBrowserProcessMemoryDumpDone().
pending_memory_dump_ack_count_ = trace_message_filters_.size() + 1;
pending_memory_dump_filters_.clear();
+ pending_memory_dump_guid_ = args.dump_guid;
+ pending_memory_dump_callback_ = callback;
failed_memory_dump_count_ = 0;
MemoryDumpManagerDelegate::CreateProcessDump(
@@ -810,14 +812,9 @@ void TracingControllerImpl::RequestGlobalMemoryDump(
base::Unretained(this)));
// If there are no child processes we are just done.
- if (pending_memory_dump_ack_count_ == 1) {
- if (!callback.is_null())
- callback.Run(args.dump_guid, true /* success */);
+ if (pending_memory_dump_ack_count_ == 1)
return;
- }
- pending_memory_dump_guid_ = args.dump_guid;
- pending_memory_dump_callback_ = callback;
pending_memory_dump_filters_ = trace_message_filters_;
for (const scoped_refptr<TraceMessageFilter>& tmf : trace_message_filters_)