OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "mojo/shell/switches.h" | |
6 | |
7 #include "base/basictypes.h" | |
8 | |
9 namespace switches { | |
10 | |
11 namespace { | |
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"; | |
16 | |
17 } // namespace | |
18 | |
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"; | |
22 | |
23 // Used to specify the type of child process (switch values from | |
24 // |ChildProcess::Type|). | |
25 const char kChildProcessType[] = "child-process-type"; | |
26 | |
27 // Comma separated list like: | |
28 // text/html,mojo:html_viewer,application/bravo,https://abarth.com/bravo | |
29 const char kContentHandlers[] = "content-handlers"; | |
30 | |
31 // Force dynamically loaded apps / services to be loaded irrespective of cache | |
32 // instructions. | |
33 const char kDisableCache[] = "disable-cache"; | |
34 | |
35 // Allow externally-running applications to discover, connect to, and register | |
36 // themselves with the shell. | |
37 // TODO(cmasone): Work in progress. Once we're sure this works, remove. | |
38 const char kEnableExternalApplications[] = "enable-external-applications"; | |
39 | |
40 // Load apps in separate processes. | |
41 // TODO(vtl): Work in progress; doesn't work. Flip this to "disable" (or maybe | |
42 // change it to "single-process") when it works. | |
43 const char kEnableMultiprocess[] = "enable-multiprocess"; | |
44 | |
45 // Print the usage message and exit. | |
46 const char kHelp[] = "help"; | |
47 | |
48 // Map mojo: URLs to a shared library of similar name at this origin. See | |
49 // mojo_url_resolver.cc for details. | |
50 const char kOrigin[] = "origin"; | |
51 | |
52 // Enables the mojo spy, which acts as a man-in-the-middle inspector for | |
53 // message pipes and other activities. This is work in progress. | |
54 const char kSpy[] = "spy"; | |
55 | |
56 // Specifies a set of mappings to apply when resolving urls. The value is set of | |
57 // ',' separated mappings, where each mapping consists of a pair of urls giving | |
58 // the to/from url to map. For example, 'a=b,c=d' contains two mappings, the | |
59 // first maps 'a' to 'b' and the second 'c' to 'd'. | |
60 const char kURLMappings[] = "url-mappings"; | |
61 | |
62 const char* kSwitchArray[] = { | |
63 kV, | |
64 kArgsFor, | |
65 kChildProcessType, | |
66 kContentHandlers, | |
67 kDisableCache, | |
68 kEnableExternalApplications, | |
69 kEnableMultiprocess, | |
70 kHelp, | |
71 kOrigin, | |
72 kSpy, | |
73 kURLMappings | |
74 }; | |
75 | |
76 const std::set<std::string> GetAllSwitches() { | |
77 std::set<std::string> switch_set; | |
78 | |
79 for (size_t i = 0; i < arraysize(kSwitchArray); ++i) | |
80 switch_set.insert(kSwitchArray[i]); | |
81 return switch_set; | |
82 } | |
83 | |
84 } // namespace switches | |
OLD | NEW |