diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-28 21:46:01 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-28 21:46:01 +0000 |
commit | bccbaf25ab40103942e680a95cd7ccc4ffa1adb1 (patch) | |
tree | 4b53507e6e29b0056bb58061218b94e0d944f30c /ipc | |
parent | a4b4bd8ac913f09948ba22113e114339bdfd6a97 (diff) | |
download | chromium_src-bccbaf25ab40103942e680a95cd7ccc4ffa1adb1.zip chromium_src-bccbaf25ab40103942e680a95cd7ccc4ffa1adb1.tar.gz chromium_src-bccbaf25ab40103942e680a95cd7ccc4ffa1adb1.tar.bz2 |
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
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc.gypi | 1 | ||||
-rw-r--r-- | ipc/ipc_channel.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_channel.h | 2 | ||||
-rw-r--r-- | ipc/ipc_channel_nacl.cc | 11 |
4 files changed, 3 insertions, 15 deletions
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<int32>::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 |