diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 00:14:16 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 00:14:16 +0000 |
commit | 6fa21d04082f0ec4416be6095d6cc12011cc4050 (patch) | |
tree | 19ddd5097b1dd82d95af005c6b1df58dc398d60b /ipc | |
parent | 79baf79fe19ffd5103e43f1bd8cda7060ac63016 (diff) | |
download | chromium_src-6fa21d04082f0ec4416be6095d6cc12011cc4050.zip chromium_src-6fa21d04082f0ec4416be6095d6cc12011cc4050.tar.gz chromium_src-6fa21d04082f0ec4416be6095d6cc12011cc4050.tar.bz2 |
Android IPC changes.
BUG=
TEST=
Review URL: http://codereview.chromium.org/8437033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/file_descriptor_set_posix.cc | 1 | ||||
-rw-r--r-- | ipc/ipc.gyp | 4 | ||||
-rw-r--r-- | ipc/ipc_channel_posix_unittest.cc | 14 | ||||
-rw-r--r-- | ipc/ipc_fuzzing_tests.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_message_macros.h | 3 | ||||
-rw-r--r-- | ipc/ipc_platform_file.cc | 4 |
6 files changed, 25 insertions, 5 deletions
diff --git a/ipc/file_descriptor_set_posix.cc b/ipc/file_descriptor_set_posix.cc index df2a8e4..b85d0a4 100644 --- a/ipc/file_descriptor_set_posix.cc +++ b/ipc/file_descriptor_set_posix.cc @@ -6,6 +6,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <unistd.h> #include "base/eintr_wrapper.h" #include "base/logging.h" diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp index ab57cd9..9b38f77 100644 --- a/ipc/ipc.gyp +++ b/ipc/ipc.gyp @@ -1,4 +1,4 @@ -# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -63,7 +63,7 @@ '../build/linux/system.gyp:gtk', ], }], - ['os_posix == 1 and OS != "mac"', { + ['os_posix == 1 and OS != "mac" and OS != "android"', { 'conditions': [ ['linux_use_tcmalloc==1', { 'dependencies': [ diff --git a/ipc/ipc_channel_posix_unittest.cc b/ipc/ipc_channel_posix_unittest.cc index 6f37ae6..61c21d3 100644 --- a/ipc/ipc_channel_posix_unittest.cc +++ b/ipc/ipc_channel_posix_unittest.cc @@ -107,8 +107,13 @@ private: scoped_ptr<MessageLoopForIO> message_loop_; }; +#if defined(OS_ANDROID) +const char IPCChannelPosixTest::kConnectionSocketTestName[] = + "/data/local/chrome_IPCChannelPosixTest__ConnectionSocket"; +#else const char IPCChannelPosixTest::kConnectionSocketTestName[] = "/var/tmp/chrome_IPCChannelPosixTest__ConnectionSocket"; +#endif void IPCChannelPosixTest::SetUp() { MultiProcessTest::SetUp(); @@ -177,8 +182,14 @@ void IPCChannelPosixTest::SpinRunLoop(int milliseconds) { } TEST_F(IPCChannelPosixTest, BasicListen) { + +#if defined(OS_ANDROID) + const char* kChannelName = "/data/local/IPCChannelPosixTest_BasicListen"; +#else + const char* kChannelName = "/var/tmp/IPCChannelPosixTest_BasicListen"; +#endif // Test creating a socket that is listening. - IPC::ChannelHandle handle("/var/tmp/IPCChannelPosixTest_BasicListen"); + IPC::ChannelHandle handle(kChannelName); SetUpSocket(&handle, IPC::Channel::MODE_NAMED_SERVER); unlink(handle.name.c_str()); IPC::Channel channel(handle, IPC::Channel::MODE_NAMED_SERVER, NULL); @@ -404,4 +415,3 @@ MULTIPROCESS_TEST_MAIN(IPCChannelPosixFailConnectionProc) { } return 0; } - diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc index d1a3c33..a45d725 100644 --- a/ipc/ipc_fuzzing_tests.cc +++ b/ipc/ipc_fuzzing_tests.cc @@ -355,8 +355,10 @@ class ServerMacroExTest { public: ServerMacroExTest() : unhandled_msgs_(0) { } + virtual ~ServerMacroExTest() { } + virtual bool OnMessageReceived(const IPC::Message& msg) { bool msg_is_ok = false; IPC_BEGIN_MESSAGE_MAP_EX(ServerMacroExTest, msg, msg_is_ok) @@ -378,6 +380,8 @@ class ServerMacroExTest { } int unhandled_msgs_; + + DISALLOW_COPY_AND_ASSIGN(ServerMacroExTest); }; TEST_F(IPCFuzzingTest, MsgMapExMacro) { diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index 38eedcf..9b3f732 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -818,7 +818,8 @@ LogFunctionMap g_log_function_mapping; class LoggerRegisterHelper##msg_class { \ public: \ LoggerRegisterHelper##msg_class() { \ - g_log_function_mapping[msg_class::ID] = msg_class::Log; \ + const uint32 msg_id = static_cast<uint32>(msg_class::ID); \ + g_log_function_mapping[msg_id] = msg_class::Log; \ } \ }; \ LoggerRegisterHelper##msg_class g_LoggerRegisterHelper##msg_class; diff --git a/ipc/ipc_platform_file.cc b/ipc/ipc_platform_file.cc index 2b15ceb..b5ec7be 100644 --- a/ipc/ipc_platform_file.cc +++ b/ipc/ipc_platform_file.cc @@ -4,6 +4,10 @@ #include "ipc/ipc_platform_file.h" +#if defined(OS_ANDROID) +#include <unistd.h> +#endif + namespace IPC { PlatformFileForTransit GetFileHandleForProcess(base::PlatformFile handle, |