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

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

Issue 397803003: Makes it so a node can only the root of one connection at a time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge again Created 6 years, 5 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
Index: mojo/services/view_manager/view_manager_service_impl.h
diff --git a/mojo/services/view_manager/view_manager_service_impl.h b/mojo/services/view_manager/view_manager_service_impl.h
index bf9585456502ce4e1e2e6779bd863bdec2b9446c..b9b6de27e353fa192ab92be37cd2901708354bc4 100644
--- a/mojo/services/view_manager/view_manager_service_impl.h
+++ b/mojo/services/view_manager/view_manager_service_impl.h
@@ -68,6 +68,9 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerServiceImpl
}
const View* GetView(const ViewId& id) const;
+ // Returns true if this has |id| as a root.
+ bool HasRoot(const NodeId& id) const;
+
// Invoked when a connection is destroyed.
void OnViewManagerServiceImplDestroyed(ConnectionSpecificId id);
@@ -141,13 +144,16 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerServiceImpl
void GetUnknownNodesFrom(const Node* node, std::vector<const Node*>* nodes);
// Removes |node| and all its descendants from |known_nodes_|. This does not
- // recurse through nodes that were created by this connection.
- void RemoveFromKnown(const Node* node);
+ // recurse through nodes that were created by this connection. All nodes owned
+ // by this connection are added to |local_nodes|.
+ void RemoveFromKnown(const Node* node, std::vector<Node*>* local_nodes);
+
+ // Adds |node_id| to the set of roots this connection knows about. The caller
+ // should have verified |node_id| is not among the roots of this connection.
+ void AddRoot(const NodeId& node_id);
- // Adds |transport_node_id| to the set of roots this connection knows about.
- // Returns true if |transport_node_id| was not already a root for this
- // connection.
- bool AddRoot(Id transport_node_id);
+ // Removes |node_id| from the set of roots this connection knows about.
+ void RemoveRoot(const NodeId& node_id);
// Returns true if |node| is a non-null and a descendant of |roots_| (or
// |roots_| is empty).
« no previous file with comments | « mojo/services/view_manager/root_node_manager.cc ('k') | mojo/services/view_manager/view_manager_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698