Index: content/browser/child_process_launcher.cc |
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc |
index 721cd5a88ede6cc6eeb7907bdecbfd35b7a5ff6d..3b95c14dc65d2f9aa0d52a074ff2d079e3946664 100644 |
--- a/content/browser/child_process_launcher.cc |
+++ b/content/browser/child_process_launcher.cc |
@@ -32,6 +32,7 @@ |
#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" |
@@ -39,6 +40,7 @@ |
#endif |
#if defined(OS_POSIX) |
+#include "base/metrics/stats_table.h" |
#include "base/posix/global_descriptors.h" |
#endif |
@@ -197,17 +199,27 @@ class ChildProcessLauncher::Context |
#if defined(OS_WIN) |
scoped_ptr<SandboxedProcessLauncherDelegate> delegate_deleter(delegate); |
base::ProcessHandle handle = StartSandboxedProcess(delegate, cmd_line); |
-#elif defined(OS_ANDROID) |
- // Android WebView runs in single process, ensure that we never get here |
- // when running in single process mode. |
- CHECK(!cmd_line->HasSwitch(switches::kSingleProcess)); |
- |
+#elif defined(OS_POSIX) |
std::string process_type = |
cmd_line->GetSwitchValueASCII(switches::kProcessType); |
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())); |
+ } |
+#endif |
+ |
+#if defined(OS_ANDROID) |
+ // Android WebView runs in single process, ensure that we never get here |
+ // when running in single process mode. |
+ CHECK(!cmd_line->HasSwitch(switches::kSingleProcess)); |
GetContentClient()->browser()-> |
GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id, |
@@ -223,13 +235,6 @@ class ChildProcessLauncher::Context |
// child termination. |
file_util::ScopedFD ipcfd_closer(&ipcfd); |
- std::string process_type = |
- cmd_line->GetSwitchValueASCII(switches::kProcessType); |
- std::vector<FileDescriptorInfo> files_to_register; |
- files_to_register.push_back( |
- FileDescriptorInfo(kPrimaryIPCChannel, |
- base::FileDescriptor(ipcfd, false))); |
- |
#if !defined(OS_MACOSX) |
GetContentClient()->browser()-> |
GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id, |