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

Unified Diff: mojo/edk/system/ports/node.cc

Issue 2512753002: Move const PortName data out of header file (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 | « mojo/edk/system/ports/name.cc ('k') | mojo/edk/system/ports_message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ports/node.cc
diff --git a/mojo/edk/system/ports/node.cc b/mojo/edk/system/ports/node.cc
index 186e8aaad95795f6f608555a0d7c16d17a73db40..8c71a25f983016648c764a3b0f33a46e46c18857 100644
--- a/mojo/edk/system/ports/node.cc
+++ b/mojo/edk/system/ports/node.cc
@@ -408,7 +408,7 @@ int Node::LostConnectionToNode(const NodeName& node_name) {
DVLOG(1) << "Observing lost connection from node " << name_
<< " to node " << node_name;
- DestroyAllPortsWithPeer(node_name, kInvalidPortName);
+ DestroyAllPortsWithPeer(node_name, constants::kInvalidPortName);
return OK;
}
@@ -509,7 +509,7 @@ int Node::OnPortAccepted(const PortName& port_name) {
int Node::OnObserveProxy(const PortName& port_name,
const ObserveProxyEventData& event) {
- if (port_name == kInvalidPortName) {
+ if (port_name == constants::kInvalidPortName) {
// An ObserveProxy with an invalid target port name is a broadcast used to
// inform ports when their peer (which was itself a proxy) has become
// defunct due to unexpected node disconnection.
@@ -517,8 +517,8 @@ int Node::OnObserveProxy(const PortName& port_name,
// Receiving ports affected by this treat it as equivalent to peer closure.
// Proxies affected by this can be removed and will in turn broadcast their
// own death with a similar message.
- CHECK_EQ(event.proxy_to_node_name, kInvalidNodeName);
- CHECK_EQ(event.proxy_to_port_name, kInvalidPortName);
+ CHECK_EQ(event.proxy_to_node_name, constants::kInvalidNodeName);
+ CHECK_EQ(event.proxy_to_port_name, constants::kInvalidPortName);
DestroyAllPortsWithPeer(event.proxy_node_name, event.proxy_port_name);
return OK;
}
@@ -1293,8 +1293,8 @@ void Node::DestroyAllPortsWithPeer(const NodeName& node_name,
base::AutoLock port_lock(port->lock);
if (port->peer_node_name == node_name &&
- (port_name == kInvalidPortName ||
- port->peer_port_name == port_name)) {
+ (port_name == constants::kInvalidPortName ||
+ port->peer_port_name == port_name)) {
if (!port->peer_closed) {
// Treat this as immediate peer closure. It's an exceptional
// condition akin to a broken pipe, so we don't care about losing
@@ -1338,10 +1338,10 @@ void Node::DestroyAllPortsWithPeer(const NodeName& node_name,
ObserveProxyEventData event;
event.proxy_node_name = name_;
event.proxy_port_name = proxy_name;
- event.proxy_to_node_name = kInvalidNodeName;
- event.proxy_to_port_name = kInvalidPortName;
+ event.proxy_to_node_name = constants::kInvalidNodeName;
+ event.proxy_to_port_name = constants::kInvalidPortName;
delegate_->BroadcastMessage(NewInternalMessage(
- kInvalidPortName, EventType::kObserveProxy, event));
+ constants::kInvalidPortName, EventType::kObserveProxy, event));
// Also process death locally since the port that points this closed one
// could be on the current node.
« no previous file with comments | « mojo/edk/system/ports/name.cc ('k') | mojo/edk/system/ports_message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698