From 1050d808db3ffd5d2728cc23f863d2cd7021efd3 Mon Sep 17 00:00:00 2001
From: ssid <ssid@chromium.org>
Date: Tue, 28 Jul 2015 13:28:14 -0700
Subject: [tracing] Fix memory-infra tracing process id translation for single
 process mode

The host discardable memory dump provider creates a global guid using
child's tracing process id and segment id for each segment to match
with the id used for segments in the child side to avoid double
counting of the memory segments. In single process mode, the child dump
manager does not receive a tracing process id, and it uses
kInvalidTracingProcessId. But the host still uses the child process id
created for message filter for creating the tracing id for child.

This CL fixes the method ChildProcessIdToTracingProcessId to return
constant values when called in single process mode. The
ChildProcessIdToTracingProcessId is moved to child_process_host_impl so
that it can be aware of single process mode and since it is tightly
coupled with the GenerateChildProcessUniqueId function

BUG=510776

Review URL: https://codereview.chromium.org/1232703007

Cr-Commit-Position: refs/heads/master@{#340759}
---
 content/browser/tracing/tracing_controller_impl.h | 1 +
 1 file changed, 1 insertion(+)

(limited to 'content/browser/tracing/tracing_controller_impl.h')

diff --git a/content/browser/tracing/tracing_controller_impl.h b/content/browser/tracing/tracing_controller_impl.h
index 3a3a652..4165a0a 100644
--- a/content/browser/tracing/tracing_controller_impl.h
+++ b/content/browser/tracing/tracing_controller_impl.h
@@ -60,6 +60,7 @@ class TracingControllerImpl
       const base::trace_event::MemoryDumpRequestArgs& args,
       const base::trace_event::MemoryDumpCallback& callback) override;
   bool IsCoordinatorProcess() const override;
+  uint64 GetTracingProcessId() const override;
 
   typedef base::Callback<void(TraceMessageFilter*)>
       TraceMessageFilterAddedCallback;
-- 
cgit v1.1