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

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

Issue 421693002: Adds an AccessPolicy that is queried to determine what a connection can do (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wrap 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
« no previous file with comments | « mojo/services/view_manager/access_policy.h ('k') | mojo/services/view_manager/default_access_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/access_policy_delegate.h
diff --git a/mojo/services/view_manager/access_policy_delegate.h b/mojo/services/view_manager/access_policy_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..5096a93138b94721b9c89a2bdd1f312f08b5de08
--- /dev/null
+++ b/mojo/services/view_manager/access_policy_delegate.h
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_
+#define MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_
+
+#include <vector>
+
+#include "base/containers/hash_tables.h"
+#include "mojo/services/view_manager/ids.h"
+
+namespace mojo {
+namespace service {
+
+class Node;
+
+// Delegate used by the AccessPolicy implementations to get state.
+class AccessPolicyDelegate {
+ public:
+ // Returns the ids of the roots nodes for this connection. That is, this is
+ // the set of nodes the connection was embedded at.
+ virtual const base::hash_set<Id>& GetRootsForAccessPolicy() const = 0;
+
+ // Returns true if |node| has been exposed to the client.
+ virtual bool IsNodeKnownForAccessPolicy(const Node* node) const = 0;
+
+ // Returns true if Embed(node) has been invoked on |node|.
+ virtual bool IsNodeRootOfAnotherConnectionForAccessPolicy(
+ const Node* node) const = 0;
+
+ protected:
+ virtual ~AccessPolicyDelegate() {}
+};
+
+} // namespace service
+} // namespace mojo
+
+#endif // MOJO_SERVICES_VIEW_MANAGER_ACCESS_POLICY_DELEGATE_H_
« no previous file with comments | « mojo/services/view_manager/access_policy.h ('k') | mojo/services/view_manager/default_access_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698