Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: content/browser/child_process_launcher.cc

Issue 22911027: Pass StatsTable shared memory via global descriptors on Posix rather than using named shared memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b7f6914361d8b8ed09639dd6b90b5d5a8d832e44 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -38,6 +38,7 @@
#endif
#if defined(OS_POSIX)
+#include "base/metrics/stats_table.h"
#include "base/posix/global_descriptors.h"
#endif
@@ -207,6 +208,12 @@ class ChildProcessLauncher::Context
files_to_register.push_back(
FileDescriptorInfo(kPrimaryIPCChannel,
base::FileDescriptor(ipcfd, false)));
+ base::StatsTable* stats_table;
+ if ((stats_table = base::StatsTable::current()) != NULL) {
jar (doing other things) 2013/08/21 01:09:46 nit: initialize during the definition, rather than
rmcilroy 2013/08/21 10:37:16 Done.
+ files_to_register.push_back(
+ FileDescriptorInfo(kStatsTableSharedMemFd,
+ stats_table->GetSharedMemoryHandle()));
jar (doing other things) 2013/08/21 01:09:46 nit: indent: align under first argument.
rmcilroy 2013/08/21 10:37:16 I was copying line 210 above. I've now changed bo
+ }
GetContentClient()->browser()->
GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id,
@@ -228,7 +235,12 @@ class ChildProcessLauncher::Context
files_to_register.push_back(
FileDescriptorInfo(kPrimaryIPCChannel,
base::FileDescriptor(ipcfd, false)));
-
+ base::StatsTable* stats_table;
+ if ((stats_table = base::StatsTable::current()) != NULL) {
jar (doing other things) 2013/08/21 01:09:46 nit: initialize in definition, rather than during
rmcilroy 2013/08/21 10:37:16 Done.
+ files_to_register.push_back(
+ FileDescriptorInfo(kStatsTableSharedMemFd,
+ stats_table->GetSharedMemoryHandle()));
jar (doing other things) 2013/08/21 01:09:46 nit: indent
rmcilroy 2013/08/21 10:37:16 Done.
+ }
#if !defined(OS_MACOSX)
GetContentClient()->browser()->
GetAdditionalMappedFilesForChildProcess(*cmd_line, child_process_id,

Powered by Google App Engine
This is Rietveld 408576698