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

Unified Diff: ipc/ipc_channel_common.cc

Issue 2473993003: Delete IPC::ChannelPosix, IPC::ChannelWin and IPC::AttachmentBroker. (Closed)
Patch Set: Created 4 years, 1 month 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_channel_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_common.cc
diff --git a/ipc/ipc_channel_common.cc b/ipc/ipc_channel_common.cc
index 10b88b6de7eee7f3546689a3e956dc07de419399..6225a869ae6f4f18036294e8a4585640d2921242 100644
--- a/ipc/ipc_channel_common.cc
+++ b/ipc/ipc_channel_common.cc
@@ -9,31 +9,37 @@
namespace IPC {
+#if defined(OS_LINUX)
+
+namespace {
+int g_global_pid = 0;
+}
+
// static
-std::unique_ptr<Channel> Channel::CreateClient(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener,
- const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
- if (channel_handle.mojo_handle.is_valid()) {
- return ChannelMojo::Create(
- mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle),
- Channel::MODE_CLIENT, listener, ipc_task_runner);
- }
- return Channel::Create(channel_handle, Channel::MODE_CLIENT, listener);
+void Channel::SetGlobalPid(int pid) {
+ g_global_pid = pid;
}
// static
-std::unique_ptr<Channel> Channel::CreateNamedServer(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener) {
- return Channel::Create(channel_handle, Channel::MODE_NAMED_SERVER, listener);
+int Channel::GetGlobalPid() {
+ return g_global_pid;
}
+#endif // defined(OS_LINUX)
+
// static
-std::unique_ptr<Channel> Channel::CreateNamedClient(
+std::unique_ptr<Channel> Channel::CreateClient(
const IPC::ChannelHandle& channel_handle,
- Listener* listener) {
- return Channel::Create(channel_handle, Channel::MODE_NAMED_CLIENT, listener);
+ Listener* listener,
+ const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
+#if defined(OS_NACL_SFI)
+ return Channel::Create(channel_handle, Channel::MODE_CLIENT, listener);
+#else
+ DCHECK(channel_handle.is_mojo_channel_handle());
+ return ChannelMojo::Create(
+ mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle),
+ Channel::MODE_CLIENT, listener, ipc_task_runner);
+#endif
}
// static
@@ -41,12 +47,14 @@ std::unique_ptr<Channel> Channel::CreateServer(
const IPC::ChannelHandle& channel_handle,
Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
- if (channel_handle.mojo_handle.is_valid()) {
- return ChannelMojo::Create(
- mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle),
- Channel::MODE_SERVER, listener, ipc_task_runner);
- }
+#if defined(OS_NACL_SFI)
return Channel::Create(channel_handle, Channel::MODE_SERVER, listener);
+#else
+ DCHECK(channel_handle.is_mojo_channel_handle());
+ return ChannelMojo::Create(
+ mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle),
+ Channel::MODE_SERVER, listener, ipc_task_runner);
+#endif
}
// static
@@ -82,4 +90,3 @@ void Channel::WillConnect() {
}
} // namespace IPC
-
« no previous file with comments | « ipc/ipc_channel.h ('k') | ipc/ipc_channel_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698