summaryrefslogtreecommitdiffstats
path: root/mojo/shell/fetcher/url_resolver.cc
diff options
context:
space:
mode:
authorben <ben@chromium.org>2016-02-01 17:59:11 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-02 02:01:52 +0000
commitaab3147b2e1f1d48113cb5c65b4224c497be3e4c (patch)
treefff37171d0de7f85670ff44bd6e7b1a36242b4de /mojo/shell/fetcher/url_resolver.cc
parent58412186f7384edec6eb83f5e6c5f52dee9ab256 (diff)
downloadchromium_src-aab3147b2e1f1d48113cb5c65b4224c497be3e4c.zip
chromium_src-aab3147b2e1f1d48113cb5c65b4224c497be3e4c.tar.gz
chromium_src-aab3147b2e1f1d48113cb5c65b4224c497be3e4c.tar.bz2
Implement a skeleton of Mojo Application manifests.
In this first cut, when a local .mojo or .exe target is loaded, we look for a manifest json file nearby and consume it into a catalog maintained by the PackageManagerImpl. Default manifests are provided for several interesting Mojo apps in Chromium, with pretty names to make the Mash Task Viewer look a little nicer. Future CL improvements: - comprehensive testing. currently mojo_shell_apptests is broken due to the EDK change. - persisting the consumed catalog in a single store (e.g. Preferences) so that we don't need to read a bunch of files every startup. i.e. implement ApplicationCatalogStore. - block creating the ApplicationInstance on having read the manifest, so the base CapabilityFilter is understood. - implement base CapabilityFilter application. R=rockot@chromium.org http://crbug.com/575858 Review URL: https://codereview.chromium.org/1641043002 Cr-Commit-Position: refs/heads/master@{#372853}
Diffstat (limited to 'mojo/shell/fetcher/url_resolver.cc')
-rw-r--r--mojo/shell/fetcher/url_resolver.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/mojo/shell/fetcher/url_resolver.cc b/mojo/shell/fetcher/url_resolver.cc
index 499d9fdb..0b2c182 100644
--- a/mojo/shell/fetcher/url_resolver.cc
+++ b/mojo/shell/fetcher/url_resolver.cc
@@ -47,5 +47,18 @@ GURL URLResolver::ResolveMojoURL(const GURL& mojo_url) const {
}
}
+GURL URLResolver::ResolveMojoManifest(const GURL& mojo_url) const {
+ // TODO(beng): think more about how this should be done for exe targets.
+ if (mojo_url.SchemeIs("mojo")) {
+ std::string host = GetBaseURLAndQuery(mojo_url, nullptr).host();
+ return mojo_base_url_.Resolve(host +
+ "/manifest.json");
+ } else if (mojo_url.SchemeIs("exe")) {
+ return mojo_base_url_.Resolve(GetBaseURLAndQuery(mojo_url, nullptr).host() +
+ "_manifest.json");
+ }
+ return GURL();
+}
+
} // namespace shell
} // namespace mojo