1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "mojo/shell/switches.h"
7 #include "base/basictypes.h"
12 // This controls logging verbosity. It's not strictly a switch for mojo_shell,
13 // and isn't included in the public switches, but is included here so that it
14 // doesn't trigger an error at startup.
15 const char kV
[] = "v";
19 // Specify configuration arguments for a Mojo application URL. For example:
20 // --args-for='mojo:wget http://www.google.com'
21 const char kArgsFor
[] = "args-for";
23 // Used internally by the main process to indicate that a new process should be
24 // a child process. Not for user use.
25 const char kChildProcess
[] = "child-process";
27 // Comma separated list like:
28 // text/html,mojo:html_viewer,application/bravo,https://abarth.com/bravo
29 const char kContentHandlers
[] = "content-handlers";
31 // Force dynamically loaded apps / services to be loaded irrespective of cache
33 const char kDisableCache
[] = "disable-cache";
35 // If set apps downloaded are not deleted.
36 const char kDontDeleteOnDownload
[] = "dont-delete-on-download";
38 // Load apps in separate processes.
39 // TODO(vtl): Work in progress; doesn't work. Flip this to "disable" (or maybe
40 // change it to "single-process") when it works.
41 const char kEnableMultiprocess
[] = "enable-multiprocess";
43 // In multiprocess mode, force these apps to be loaded in the main process.
44 // Comma-separate list of URLs. Example:
45 // --force-in-process=mojo:native_viewport_service,mojo:network_service
46 const char kForceInProcess
[] = "force-in-process";
48 // Print the usage message and exit.
49 const char kHelp
[] = "help";
51 // Specify origin to map to base url. See url_resolver.cc for details.
52 // Can be used multiple times.
53 const char kMapOrigin
[] = "map-origin";
55 // Map mojo: URLs to a shared library of similar name at this origin. See
56 // url_resolver.cc for details.
57 const char kOrigin
[] = "origin";
59 // If set apps downloaded are saved in with a predictable filename, to help
60 // remote debugging: when gdb is used through gdbserver, it needs to be able to
61 // find locally any loaded library. For this, gdb use the filename of the
62 // library. When using this flag, the application are named with the sha256 of
64 const char kPredictableAppFilenames
[] = "predictable-app-filenames";
66 // Starts tracing when the shell starts up, saving a trace file on disk after 5
67 // seconds or when the shell exits.
68 const char kTraceStartup
[] = "trace-startup";
70 // Specifies a set of mappings to apply when resolving urls. The value is a set
71 // of ',' separated mappings, where each mapping consists of a pair of urls
72 // giving the to/from url to map. For example, 'a=b,c=d' contains two mappings,
73 // the first maps 'a' to 'b' and the second 'c' to 'd'.
74 const char kURLMappings
[] = "url-mappings";
76 // Switches valid for the main process (i.e., that the user may pass in).
77 const char* kSwitchArray
[] = {kV
,
79 // |kChildProcess| not for user use.
82 kDontDeleteOnDownload
,
88 kPredictableAppFilenames
,
92 const std::set
<std::string
> GetAllSwitches() {
93 std::set
<std::string
> switch_set
;
95 for (size_t i
= 0; i
< arraysize(kSwitchArray
); ++i
)
96 switch_set
.insert(kSwitchArray
[i
]);
100 } // namespace switches