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..876fd938f9ec25601b93ea2e3193db55cfa61a58 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,13 @@ 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( |
|
jar (doing other things)
2013/08/23 00:24:04
nit: <sadly>: When the body for an if() extends ac
rmcilroy
2013/08/23 17:03:30
Dang, thought that might be the case :). Done
|
| + FileDescriptorInfo(kStatsTableSharedMemFd, |
| + stats_table->GetSharedMemoryHandle())); |
| GetContentClient()->browser()-> |
| GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id, |
| @@ -227,8 +235,13 @@ 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())) |
|
jar (doing other things)
2013/08/23 00:24:04
nit: add curlies here too.
rmcilroy
2013/08/23 17:03:30
Done.
|
| + files_to_register.push_back( |
| + FileDescriptorInfo(kStatsTableSharedMemFd, |
| + stats_table->GetSharedMemoryHandle())); |
| #if !defined(OS_MACOSX) |
| GetContentClient()->browser()-> |
| GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id, |