Chromium Code Reviews| Index: content/browser/child_process_launcher.cc |
| diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc |
| index b5bb3f491f070688914d8f2f8146969509e341db..ac91f5a0428762647d1a8142bed93fda59d6a02e 100644 |
| --- a/content/browser/child_process_launcher.cc |
| +++ b/content/browser/child_process_launcher.cc |
| @@ -32,12 +32,14 @@ |
| #include "base/android/jni_android.h" |
| #include "content/browser/android/child_process_launcher_android.h" |
| #elif defined(OS_POSIX) |
| +#include "base/memory/shared_memory.h" |
| #include "base/memory/singleton.h" |
| #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
| #endif |
| #if defined(OS_POSIX) |
| +#include "base/metrics/stats_table.h" |
| #include "base/posix/global_descriptors.h" |
| #endif |
| @@ -206,7 +208,15 @@ class ChildProcessLauncher::Context |
| std::vector<FileDescriptorInfo> files_to_register; |
| files_to_register.push_back( |
| FileDescriptorInfo(kPrimaryIPCChannel, |
| - base::FileDescriptor(ipcfd, false))); |
| + base::FileDescriptor(ipcfd, false))); |
| + base::StatsTable* stats_table = base::StatsTable::current(); |
| + if (stats_table && |
| + base::SharedMemory::IsHandleValid( |
| + stats_table->GetSharedMemoryHandle())) { |
| + files_to_register.push_back( |
| + FileDescriptorInfo(kStatsTableSharedMemFd, |
| + stats_table->GetSharedMemoryHandle())); |
| + } |
| GetContentClient()->browser()-> |
| GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id, |
| @@ -227,8 +237,15 @@ class ChildProcessLauncher::Context |
| std::vector<FileDescriptorInfo> files_to_register; |
| files_to_register.push_back( |
| FileDescriptorInfo(kPrimaryIPCChannel, |
| - base::FileDescriptor(ipcfd, false))); |
| - |
| + base::FileDescriptor(ipcfd, false))); |
| + base::StatsTable* stats_table = base::StatsTable::current(); |
|
jam
2013/08/25 16:22:25
we need to have one copy of this code, not two, an
rmcilroy
2013/08/27 14:13:06
Done (combined ifdefs).
|
| + if (stats_table && |
| + base::SharedMemory::IsHandleValid( |
| + stats_table->GetSharedMemoryHandle())) { |
| + files_to_register.push_back( |
| + FileDescriptorInfo(kStatsTableSharedMemFd, |
| + stats_table->GetSharedMemoryHandle())); |
| + } |
| #if !defined(OS_MACOSX) |
| GetContentClient()->browser()-> |
| GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id, |