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

Unified Diff: ipc/ipc_channel_common.cc

Issue 2047233002: Support using a Mojo message pipe in a ChannelHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-handle-attachemnt-public-api
Patch Set: comments Created 4 years, 6 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 | « no previous file | 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 b5dcb1ab4bf93380653e5ddde5b00dd3819142f1..d7bbef6656726a5e6d242d190988bdcfd68ba75a 100644
--- a/ipc/ipc_channel_common.cc
+++ b/ipc/ipc_channel_common.cc
@@ -4,6 +4,7 @@
#include "build/build_config.h"
#include "ipc/ipc_channel.h"
+#include "ipc/ipc_channel_mojo.h"
namespace IPC {
@@ -11,6 +12,11 @@ namespace IPC {
std::unique_ptr<Channel> Channel::CreateClient(
const IPC::ChannelHandle& channel_handle,
Listener* listener) {
+ if (channel_handle.mojo_handle.is_valid()) {
+ return ChannelMojo::Create(
+ mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle),
+ Channel::MODE_CLIENT, listener);
+ }
return Channel::Create(channel_handle, Channel::MODE_CLIENT, listener);
}
@@ -42,6 +48,11 @@ std::unique_ptr<Channel> Channel::CreateOpenNamedServer(
std::unique_ptr<Channel> Channel::CreateServer(
const IPC::ChannelHandle& channel_handle,
Listener* listener) {
+ if (channel_handle.mojo_handle.is_valid()) {
+ return ChannelMojo::Create(
+ mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle),
+ Channel::MODE_SERVER, listener);
+ }
return Channel::Create(channel_handle, Channel::MODE_SERVER, listener);
}
« no previous file with comments | « no previous file | ipc/ipc_channel_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698