Index: ipc/ipc_channel.cc |
diff --git a/ipc/ipc_channel.cc b/ipc/ipc_channel.cc |
index 4a4e40ddc1fb82bfa2bbeeff49cf0917b252ef7a..5f37a5a4db9290413a45c42abc26955393986427 100644 |
--- a/ipc/ipc_channel.cc |
+++ b/ipc/ipc_channel.cc |
@@ -29,7 +29,14 @@ std::string Channel::GenerateUniqueRandomChannelID() { |
// component. The strong random component prevents other processes from |
// hijacking or squatting on predictable channel names. |
+#if defined(OS_LINUX) || defined(OS_NACL_NONSFI) |
+ // On Linux platform, PID does not play any security role. |
+ // In nacl_helper_nonsfi, the seccomp sandbox disallows the use of getpid(). |
+ // So, for both cases, we provide a dummy PID. |
+ int process_id = -1; |
+#else |
int process_id = base::GetCurrentProcId(); |
+#endif |
return base::StringPrintf("%d.%u.%d", |
process_id, |
g_last_id.GetNext(), |