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

Unified Diff: mojo/services/view_manager/ids.h

Issue 292283002: Finishes up setroots (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 7 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 | mojo/services/view_manager/node.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | mojo/services/view_manager/node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698