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

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

Issue 287183003: Restricts node/view deletion to creator (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
Index: mojo/services/view_manager/view_manager_connection.h
diff --git a/mojo/services/view_manager/view_manager_connection.h b/mojo/services/view_manager/view_manager_connection.h
index 884498c5f1075ff951fa33112fa34b4232528cb4..17a2655581248c74898f86e8ef4d9d3794226f10 100644
--- a/mojo/services/view_manager/view_manager_connection.h
+++ b/mojo/services/view_manager/view_manager_connection.h
@@ -45,7 +45,11 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection
TransportConnectionId id() const { return id_; }
// Returns the Node with the specified id.
- Node* GetNode(const NodeId& id);
+ Node* GetNode(const NodeId& id) {
+ return const_cast<Node*>(
+ const_cast<const ViewManagerConnection*>(this)->GetNode(id));
+ }
+ const Node* GetNode(const NodeId& id) const;
// Returns the View with the specified id.
View* GetView(const ViewId& id);
@@ -72,6 +76,12 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerConnection
typedef std::map<TransportConnectionSpecificViewId, View*> ViewMap;
typedef base::hash_set<TransportNodeId> NodeIdSet;
+ // Returns true if this connection is allowed to delete the specified node.
+ bool CanDeleteNode(const NodeId& node_id) const;
+
+ // Returns true if this connection is allowed to delete the specified view.
+ bool CanDeleteView(const ViewId& view_id) const;
+
// Deletes a node owned by this connection. Returns true on success. |source|
// is the connection that originated the change.
bool DeleteNodeImpl(ViewManagerConnection* source, const NodeId& node_id);
« no previous file with comments | « mojo/services/public/interfaces/view_manager/view_manager.mojom ('k') | mojo/services/view_manager/view_manager_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698