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

Unified Diff: mojo/shell/public/cpp/names.h

Issue 1743473002: Change Mojo URLs to structured names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@18collapse
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/public/cpp/lib/shell_connection.cc ('k') | mojo/shell/public/cpp/shell_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/names.h
diff --git a/mojo/shell/public/cpp/names.h b/mojo/shell/public/cpp/names.h
new file mode 100644
index 0000000000000000000000000000000000000000..0bad8ac64cfd1078a0f3638d276afad9d203ed60
--- /dev/null
+++ b/mojo/shell/public/cpp/names.h
@@ -0,0 +1,53 @@
+// Copyright 2016 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_SHELL_PUBLIC_CPP_NAMES_H_
+#define MOJO_SHELL_PUBLIC_CPP_NAMES_H_
+
+#include <string>
+
+namespace mojo {
+
+// Mojo services and applications are identified by structured "names", of the
+// form:
+//
+// type:path.
+//
+// The type field tells the shell how to load the application. Two types are
+// currently recognized:
+//
+// mojo
+// Represents an application packaged as a .mojo, launched from the
+// NativeRunner launch path. .mojo files are assumed to live alongside the
+// shell executable at a path matching <path>/<path>.mojo. .mojo applications
+// have a MojoMain() entrypoint that receives a handle to a ShellClientRequest
+// that must be bound to enable further communication with the shell.
+//
+// exe
+// Represents a native executable on the host platform, expected to live
+// alongside the shell executable. Executables launched via this mechanism are
+// passed a handle to the shell on the command line and are expected to bind
+// a ChildController via which they will receive a ShellClientRequest enabling
+// further communication with the shell. The path component contains the
+// executable name, minus any platform-specific extension.
+//
+// Other types may be supplied but are not recognized by any of the
+// NativeRunners, and as such custom loaders must be specified for such names.
+//
+// Any name type may serve as an alias for any other name type. Aliasing is
+// resolved implicitly by the Shell.
+
+// Returns true if the name is a valid form, i.e. type:path. path cannot start
+// with a "//" sequence. These are _not_ urls.
+bool IsValidName(const std::string& name);
+
+// Get the type component of the specified name.
+std::string GetNameType(const std::string& name);
+
+// Get the path component of the specified name.
+std::string GetNamePath(const std::string& name);
+
+} // namespace mojo
+
+#endif // MOJO_SHELL_PUBLIC_CPP_NAMES_H_
« no previous file with comments | « mojo/shell/public/cpp/lib/shell_connection.cc ('k') | mojo/shell/public/cpp/shell_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698