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

Unified Diff: mojo/edk/system/node_channel.cc

Issue 1675603002: [mojo-edk] Simplify multiprocess pipe bootstrap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix some callers to work with sync APIs Created 4 years, 10 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 | « mojo/edk/system/node_channel.h ('k') | mojo/edk/system/node_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/node_channel.cc
diff --git a/mojo/edk/system/node_channel.cc b/mojo/edk/system/node_channel.cc
index 4fb0ac4370875c0346edd19f9c89b5046aa52aac..0277d46c4160ba158682587fcac1d1a4cac41e64 100644
--- a/mojo/edk/system/node_channel.cc
+++ b/mojo/edk/system/node_channel.cc
@@ -29,8 +29,7 @@ enum class MessageType : uint32_t {
BROKER_CLIENT_ADDED,
ACCEPT_BROKER_CLIENT,
PORTS_MESSAGE,
- REQUEST_PORT_CONNECTION,
- CONNECT_TO_PORT,
+ REQUEST_PORT_MERGE,
REQUEST_INTRODUCTION,
INTRODUCE,
#if defined(OS_WIN)
@@ -74,15 +73,10 @@ struct AcceptBrokerClientData {
// This is followed by arbitrary payload data which is interpreted as a token
// string for port location.
-struct RequestPortConnectionData {
+struct RequestPortMergeData {
ports::PortName connector_port_name;
};
-struct ConnectToPortData {
- ports::PortName connector_port_name;
- ports::PortName connectee_port_name;
-};
-
// Used for both REQUEST_INTRODUCTION and INTRODUCE.
//
// For INTRODUCE the message also includes a valid platform handle for a channel
@@ -267,28 +261,17 @@ void NodeChannel::PortsMessage(Channel::MessagePtr message) {
WriteChannelMessage(std::move(message));
}
-void NodeChannel::RequestPortConnection(
- const ports::PortName& connector_port_name,
- const std::string& token) {
- RequestPortConnectionData* data;
+void NodeChannel::RequestPortMerge(const ports::PortName& connector_port_name,
+ const std::string& token) {
+ RequestPortMergeData* data;
Channel::MessagePtr message = CreateMessage(
- MessageType::REQUEST_PORT_CONNECTION,
- sizeof(RequestPortConnectionData) + token.size(), 0, &data);
+ MessageType::REQUEST_PORT_MERGE,
+ sizeof(RequestPortMergeData) + token.size(), 0, &data);
data->connector_port_name = connector_port_name;
memcpy(data + 1, token.data(), token.size());
WriteChannelMessage(std::move(message));
}
-void NodeChannel::ConnectToPort(const ports::PortName& connector_port_name,
- const ports::PortName& connectee_port_name) {
- ConnectToPortData* data;
- Channel::MessagePtr message = CreateMessage(
- MessageType::CONNECT_TO_PORT, sizeof(ConnectToPortData), 0, &data);
- data->connector_port_name = connector_port_name;
- data->connectee_port_name = connectee_port_name;
- WriteChannelMessage(std::move(message));
-}
-
void NodeChannel::RequestIntroduction(const ports::NodeName& name) {
IntroductionData* data;
Channel::MessagePtr message = CreateMessage(
@@ -452,24 +435,16 @@ void NodeChannel::OnChannelMessage(const void* payload,
break;
}
- case MessageType::REQUEST_PORT_CONNECTION: {
- const RequestPortConnectionData* data;
+ case MessageType::REQUEST_PORT_MERGE: {
+ const RequestPortMergeData* data;
GetMessagePayload(payload, &data);
const char* token_data = reinterpret_cast<const char*>(data + 1);
const size_t token_size = payload_size - sizeof(*data) - sizeof(Header);
std::string token(token_data, token_size);
- delegate_->OnRequestPortConnection(remote_node_name_,
- data->connector_port_name, token);
- break;
- }
-
- case MessageType::CONNECT_TO_PORT: {
- const ConnectToPortData* data;
- GetMessagePayload(payload, &data);
- delegate_->OnConnectToPort(remote_node_name_, data->connector_port_name,
- data->connectee_port_name);
+ delegate_->OnRequestPortMerge(remote_node_name_,
+ data->connector_port_name, token);
break;
}
« no previous file with comments | « mojo/edk/system/node_channel.h ('k') | mojo/edk/system/node_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698