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

Unified Diff: mojo/shell/identity.cc

Issue 1351443004: Revert of Make CapabilityFilter be part of Identity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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') | no next file » | 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 be74bfbaa40c3e56fc43465357c51a1eb76f0191..b3d045094ae16f63fa3c8b11a7726b8bad9a60b5 100644
--- a/mojo/shell/identity.cc
+++ b/mojo/shell/identity.cc
@@ -8,51 +8,21 @@
namespace mojo {
namespace shell {
-namespace {
-
-// It's valid to specify mojo: URLs in the filter either as mojo:foo or
-// mojo://foo/ - but we store the filter in the latter form.
-CapabilityFilter CanonicalizeFilter(const CapabilityFilter& filter) {
- CapabilityFilter canonicalized;
- for (CapabilityFilter::const_iterator it = filter.begin();
- it != filter.end();
- ++it) {
- if (it->first == "*")
- canonicalized[it->first] = it->second;
- else
- canonicalized[GURL(it->first).spec()] = it->second;
- }
- return canonicalized;
-}
-
-} // namespace
Identity::Identity() {}
-Identity::Identity(const GURL& url)
- : url_(GetBaseURLAndQuery(url, nullptr)),
- qualifier_(url_.spec()) {}
+Identity::Identity(const GURL& in_url, const std::string& in_qualifier)
+ : url(GetBaseURLAndQuery(in_url, nullptr)),
+ qualifier(in_qualifier.empty() ? url.spec() : in_qualifier) {}
-Identity::Identity(const GURL& url, const std::string& qualifier)
- : url_(GetBaseURLAndQuery(url, nullptr)),
- qualifier_(qualifier.empty() ? url_.spec() : qualifier) {}
-
-Identity::Identity(const GURL& url,
- const std::string& qualifier,
- CapabilityFilter filter)
- : url_(GetBaseURLAndQuery(url, nullptr)),
- qualifier_(qualifier.empty() ? url_.spec() : qualifier),
- filter_(CanonicalizeFilter(filter)) {}
-
-Identity::~Identity() {}
+// explicit
+Identity::Identity(const GURL& in_url)
+ : url(GetBaseURLAndQuery(in_url, nullptr)), qualifier(url.spec()) {}
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.
- if (url_ != other.url_)
- return url_ < other.url_;
- return qualifier_ < other.qualifier_;
+ if (url != other.url)
+ return url < other.url;
+ return qualifier < other.qualifier;
}
} // namespace shell
« no previous file with comments | « mojo/shell/identity.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698