From bccbaf25ab40103942e680a95cd7ccc4ffa1adb1 Mon Sep 17 00:00:00 2001 From: "bbudge@chromium.org" Date: Fri, 28 Sep 2012 21:46:01 +0000 Subject: Fix build warnings in NaCl IPC proxy. BUG=116317 TEST=builds Review URL: https://chromiumcodereview.appspot.com/10982031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159344 0039d316-1c4b-4281-b951-d872f2087c98 --- ipc/ipc.gypi | 1 + ipc/ipc_channel.cc | 4 ---- ipc/ipc_channel.h | 2 ++ ipc/ipc_channel_nacl.cc | 11 ----------- 4 files changed, 3 insertions(+), 15 deletions(-) (limited to 'ipc') diff --git a/ipc/ipc.gypi b/ipc/ipc.gypi index e1eb740..1c014f8 100644 --- a/ipc/ipc.gypi +++ b/ipc/ipc.gypi @@ -66,6 +66,7 @@ 'target_conditions': [ ['>(nacl_untrusted_build)==1', { 'sources!': [ + 'ipc_channel.cc', 'ipc_channel_posix.cc', ], }], diff --git a/ipc/ipc_channel.cc b/ipc/ipc_channel.cc index 37d693a..5054fb6 100644 --- a/ipc/ipc_channel.cc +++ b/ipc/ipc_channel.cc @@ -32,15 +32,11 @@ std::string Channel::GenerateUniqueRandomChannelID() { // component. The strong random component prevents other processes from // hijacking or squatting on predictable channel names. -#if !defined(OS_NACL) int process_id = base::GetCurrentProcId(); return base::StringPrintf("%d.%u.%d", process_id, g_last_id.GetNext(), base::RandInt(0, std::numeric_limits::max())); -#else - return std::string(); -#endif } } // namespace IPC diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h index 36e7326..500dcf7 100644 --- a/ipc/ipc_channel.h +++ b/ipc/ipc_channel.h @@ -179,6 +179,7 @@ class IPC_EXPORT Channel : public Sender { // ID. Even if true, the server may have already accepted a connection. static bool IsNamedServerInitialized(const std::string& channel_id); +#if !defined(OS_NACL) // Generates a channel ID that's non-predictable and unique. static std::string GenerateUniqueRandomChannelID(); @@ -187,6 +188,7 @@ class IPC_EXPORT Channel : public Sender { // require additional this is simply calls GenerateUniqueRandomChannelID(). // For portability the prefix should not include the \ character. static std::string GenerateVerifiedChannelID(const std::string& prefix); +#endif #if defined(OS_LINUX) // Sandboxed processes live in a PID namespace, so when sending the IPC hello diff --git a/ipc/ipc_channel_nacl.cc b/ipc/ipc_channel_nacl.cc index e7f11db..3cb5810 100644 --- a/ipc/ipc_channel_nacl.cc +++ b/ipc/ipc_channel_nacl.cc @@ -383,15 +383,4 @@ bool Channel::Send(Message* message) { return channel_impl_->Send(message); } -// static -std::string Channel::GenerateVerifiedChannelID(const std::string& prefix) { - // A random name is sufficient validation on posix systems, so we don't need - // an additional shared secret. - std::string id = prefix; - if (!id.empty()) - id.append("."); - - return id.append(GenerateUniqueRandomChannelID()); -} - } // namespace IPC -- cgit v1.1