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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 196343019: IPC: Make ipc_perftests run on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 9 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
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_multiprocess_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix.cc
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 2bd0989ddabdc20a113f3750613853018f26b21f..11b20ff39e3a2996de3f61a77049f039ce8aedfd 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -135,6 +135,9 @@ class PipeMap {
ChannelToFDMap map_;
friend struct DefaultSingletonTraits<PipeMap>;
+#if defined(OS_ANDROID)
+ friend void ::IPC::Channel::NotifyProcessForkedForTesting();
+#endif
};
//------------------------------------------------------------------------------
@@ -159,6 +162,15 @@ bool SocketWriteErrorIsRecoverable() {
}
} // namespace
+
+#if defined(OS_ANDROID)
+// When we fork for simple tests on Android, we can't 'exec', so we need to
+// reset these entries manually to get the expected testing behavior.
+void Channel::NotifyProcessForkedForTesting() {
+ PipeMap::GetInstance()->map_.clear();
+}
+#endif
+
//------------------------------------------------------------------------------
#if defined(OS_LINUX)
@@ -227,7 +239,7 @@ bool Channel::ChannelImpl::CreatePipe(
// 1) It's a channel wrapping a pipe that is given to us.
// 2) It's for a named channel, so we create it.
// 3) It's for a client that we implement ourself. This is used
- // in unittesting.
+ // in single-process unittesting.
// 4) It's the initial IPC channel:
// 4a) Client side: Pull the pipe out of the GlobalDescriptors set.
// 4b) Server side: create the pipe.
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_multiprocess_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698