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

Side by Side Diff: mojo/edk/system/ports/node.h

Issue 1785843002: [mojo] Implement pipe fusion API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « mojo/edk/system/node_controller.cc ('k') | mojo/edk/system/ports/node.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_EDK_SYSTEM_PORTS_NODE_H_ 5 #ifndef MOJO_EDK_SYSTEM_PORTS_NODE_H_
6 #define MOJO_EDK_SYSTEM_PORTS_NODE_H_ 6 #define MOJO_EDK_SYSTEM_PORTS_NODE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // merged (B or C above) has ever been read from or written to directly, and 130 // merged (B or C above) has ever been read from or written to directly, and
131 // this must ONLY be called on one side of the merge, though it doesn't matter 131 // this must ONLY be called on one side of the merge, though it doesn't matter
132 // which side. 132 // which side.
133 // 133 //
134 // It is safe for the non-merged peers (A and D above) to be transferred, 134 // It is safe for the non-merged peers (A and D above) to be transferred,
135 // closed, and/or written to before, during, or after the merge. 135 // closed, and/or written to before, during, or after the merge.
136 int MergePorts(const PortRef& port_ref, 136 int MergePorts(const PortRef& port_ref,
137 const NodeName& destination_node_name, 137 const NodeName& destination_node_name,
138 const PortName& destination_port_name); 138 const PortName& destination_port_name);
139 139
140 // Like above but merges two ports local to this node. Because both ports are
141 // local this can also verify that neither port has been written to before the
142 // merge. If this fails for any reason, both ports are closed. Otherwise OK
143 // is returned and the ports' receiving peers are connected to each other.
144 int MergeLocalPorts(const PortRef& port0_ref, const PortRef& port1_ref);
145
140 // Called to inform this node that communication with another node is lost 146 // Called to inform this node that communication with another node is lost
141 // indefinitely. This triggers cleanup of ports bound to this node. 147 // indefinitely. This triggers cleanup of ports bound to this node.
142 int LostConnectionToNode(const NodeName& node_name); 148 int LostConnectionToNode(const NodeName& node_name);
143 149
144 private: 150 private:
145 int OnUserMessage(ScopedMessage message); 151 int OnUserMessage(ScopedMessage message);
146 int OnPortAccepted(const PortName& port_name); 152 int OnPortAccepted(const PortName& port_name);
147 int OnObserveProxy(const PortName& port_name, 153 int OnObserveProxy(const PortName& port_name,
148 const ObserveProxyEventData& event); 154 const ObserveProxyEventData& event);
149 int OnObserveProxyAck(const PortName& port_name, uint64_t last_sequence_num); 155 int OnObserveProxyAck(const PortName& port_name, uint64_t last_sequence_num);
150 int OnObserveClosure(const PortName& port_name, uint64_t last_sequence_num); 156 int OnObserveClosure(const PortName& port_name, uint64_t last_sequence_num);
151 int OnMergePort(const PortName& port_name, const MergePortEventData& event); 157 int OnMergePort(const PortName& port_name, const MergePortEventData& event);
152 158
153 int AddPortWithName(const PortName& port_name, 159 int AddPortWithName(const PortName& port_name,
154 const scoped_refptr<Port>& port); 160 const scoped_refptr<Port>& port);
155 void ErasePort(const PortName& port_name); 161 void ErasePort(const PortName& port_name);
156 void ErasePort_Locked(const PortName& port_name); 162 void ErasePort_Locked(const PortName& port_name);
157 scoped_refptr<Port> GetPort(const PortName& port_name); 163 scoped_refptr<Port> GetPort(const PortName& port_name);
158 scoped_refptr<Port> GetPort_Locked(const PortName& port_name); 164 scoped_refptr<Port> GetPort_Locked(const PortName& port_name);
159 165
166 int MergePorts_Locked(const PortRef& port0_ref, const PortRef& port1_ref);
160 void WillSendPort_Locked(Port* port, 167 void WillSendPort_Locked(Port* port,
161 const NodeName& to_node_name, 168 const NodeName& to_node_name,
162 PortName* port_name, 169 PortName* port_name,
163 PortDescriptor* port_descriptor); 170 PortDescriptor* port_descriptor);
164 int AcceptPort(const PortName& port_name, 171 int AcceptPort(const PortName& port_name,
165 const PortDescriptor& port_descriptor); 172 const PortDescriptor& port_descriptor);
166 173
167 int WillSendMessage_Locked(Port* port, 174 int WillSendMessage_Locked(Port* port,
168 const PortName& port_name, 175 const PortName& port_name,
169 Message* message); 176 Message* message);
(...skipping 30 matching lines...) Expand all
200 std::unordered_map<PortName, scoped_refptr<Port>> ports_; 207 std::unordered_map<PortName, scoped_refptr<Port>> ports_;
201 208
202 DISALLOW_COPY_AND_ASSIGN(Node); 209 DISALLOW_COPY_AND_ASSIGN(Node);
203 }; 210 };
204 211
205 } // namespace ports 212 } // namespace ports
206 } // namespace edk 213 } // namespace edk
207 } // namespace mojo 214 } // namespace mojo
208 215
209 #endif // MOJO_EDK_SYSTEM_PORTS_NODE_H_ 216 #endif // MOJO_EDK_SYSTEM_PORTS_NODE_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/node_controller.cc ('k') | mojo/edk/system/ports/node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698