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

Unified Diff: mojo/shell/identity.cc

Issue 1734643003: Remove CapabilityFilter from Connect() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@13connector2
Patch Set: . Created 4 years, 10 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/shell/identity.h ('k') | mojo/shell/public/cpp/connector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/identity.cc
diff --git a/mojo/shell/identity.cc b/mojo/shell/identity.cc
index 0a4169aa0dcbef923fd7247611a557b8e0bb3c5e..c1c10e283717304153ae0e362f32f365b823a141 100644
--- a/mojo/shell/identity.cc
+++ b/mojo/shell/identity.cc
@@ -34,14 +34,9 @@ Identity::Identity(const GURL& url)
Identity::Identity(const GURL& url, const std::string& qualifier,
uint32_t user_id)
- : Identity(url, qualifier, user_id, CapabilityFilter()) {}
-
-Identity::Identity(const GURL& url, const std::string& qualifier,
- uint32_t user_id, CapabilityFilter filter)
: url_(url),
qualifier_(qualifier.empty() ? url_.spec() : qualifier),
- user_id_(user_id),
- filter_(CanonicalizeFilter(filter)) {}
+ user_id_(user_id) {}
Identity::~Identity() {}
@@ -57,13 +52,22 @@ bool Identity::operator<(const Identity& other) const {
}
bool Identity::operator==(const Identity& other) const {
+ // We specifically don't include filter in the equivalence check because we
+ // don't quite know how this should work yet.
+ // TODO(beng): figure out how it should work.
return other.url_ == url_ && other.qualifier_ == qualifier_ &&
- other.filter_ == filter_ && other.user_id_ == user_id_;
+ other.user_id_ == user_id_;
+}
+
+void Identity::SetFilter(const CapabilityFilter& filter) {
+ filter_ = CanonicalizeFilter(filter);
}
Identity CreateShellIdentity() {
- return Identity(GURL("mojo://shell/"), std::string(),
- mojom::Connector::kUserRoot, GetPermissiveCapabilityFilter());
+ Identity id =
+ Identity(GURL("mojo://shell/"), "", mojom::Connector::kUserRoot);
+ id.SetFilter(GetPermissiveCapabilityFilter());
+ return id;
}
} // namespace shell
« no previous file with comments | « mojo/shell/identity.h ('k') | mojo/shell/public/cpp/connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698