Index: mojo/services/view_manager/ids.h |
diff --git a/mojo/services/view_manager/ids.h b/mojo/services/view_manager/ids.h |
index 4cf17d26429bfdc43e399d5b7f3bea29f175e4ad..30c5f51747ca71aadb60a7969b01ecc11a861294 100644 |
--- a/mojo/services/view_manager/ids.h |
+++ b/mojo/services/view_manager/ids.h |
@@ -13,6 +13,9 @@ namespace mojo { |
namespace view_manager { |
namespace service { |
+// Connection id reserved for the root. |
+const TransportConnectionId kRootConnection = 0; |
+ |
// Adds a bit of type safety to node ids. |
struct MOJO_VIEW_MANAGER_EXPORT NodeId { |
NodeId(TransportConnectionId connection_id, |
@@ -72,6 +75,16 @@ inline TransportViewId ViewIdToTransportId(const ViewId& id) { |
return (id.connection_id << 16) | id.view_id; |
} |
+inline NodeId RootNodeId() { |
+ return NodeId(kRootConnection, 1); |
+} |
+ |
+// Returns a NodeId that is reserved to indicate no node. That is, no node will |
+// ever be created with this id. |
+inline NodeId InvalidNodeId() { |
+ return NodeId(kRootConnection, 0); |
+} |
+ |
} // namespace service |
} // namespace view_manager |
} // namespace mojo |