From aab3147b2e1f1d48113cb5c65b4224c497be3e4c Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 1 Feb 2016 17:59:11 -0800 Subject: 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} --- mojo/shell/fetcher/url_resolver.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mojo/shell/fetcher/url_resolver.cc') 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 -- cgit v1.1