OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/shell/switches.h" | 5 #include "mojo/shell/switches.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 | 8 |
9 namespace switches { | 9 namespace switches { |
10 | 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 |
11 // Used internally by the main process to indicate that a new process should be | 23 // Used internally by the main process to indicate that a new process should be |
12 // a child process. Not for user use. | 24 // a child process. Not for user use. |
13 const char kChildProcess[] = "child-process"; | 25 const char kChildProcess[] = "child-process"; |
14 | 26 |
15 // Comma separated list like: | 27 // Comma separated list like: |
16 // text/html,mojo:html_viewer,application/bravo,https://abarth.com/bravo | 28 // text/html,mojo:html_viewer,application/bravo,https://abarth.com/bravo |
17 const char kContentHandlers[] = "content-handlers"; | 29 const char kContentHandlers[] = "content-handlers"; |
18 | 30 |
19 // Force dynamically loaded apps / services to be loaded irrespective of cache | 31 // Force dynamically loaded apps / services to be loaded irrespective of cache |
20 // instructions. | 32 // instructions. |
(...skipping 27 matching lines...) Expand all Loading... |
48 // remote debugging: when gdb is used through gdbserver, it needs to be able to | 60 // remote debugging: when gdb is used through gdbserver, it needs to be able to |
49 // find locally any loaded library. For this, gdb use the filename of the | 61 // find locally any loaded library. For this, gdb use the filename of the |
50 // library. When using this flag, the application are named with the sha256 of | 62 // library. When using this flag, the application are named with the sha256 of |
51 // their content. | 63 // their content. |
52 const char kPredictableAppFilenames[] = "predictable-app-filenames"; | 64 const char kPredictableAppFilenames[] = "predictable-app-filenames"; |
53 | 65 |
54 // Starts tracing when the shell starts up, saving a trace file on disk after 5 | 66 // Starts tracing when the shell starts up, saving a trace file on disk after 5 |
55 // seconds or when the shell exits. | 67 // seconds or when the shell exits. |
56 const char kTraceStartup[] = "trace-startup"; | 68 const char kTraceStartup[] = "trace-startup"; |
57 | 69 |
| 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"; |
| 75 |
| 76 // Switches valid for the main process (i.e., that the user may pass in). |
| 77 const char* kSwitchArray[] = {kV, |
| 78 kArgsFor, |
| 79 // |kChildProcess| not for user use. |
| 80 kContentHandlers, |
| 81 kDisableCache, |
| 82 kDontDeleteOnDownload, |
| 83 kEnableMultiprocess, |
| 84 kForceInProcess, |
| 85 kHelp, |
| 86 kMapOrigin, |
| 87 kOrigin, |
| 88 kPredictableAppFilenames, |
| 89 kTraceStartup, |
| 90 kURLMappings}; |
| 91 |
| 92 const std::set<std::string> GetAllSwitches() { |
| 93 std::set<std::string> switch_set; |
| 94 |
| 95 for (size_t i = 0; i < arraysize(kSwitchArray); ++i) |
| 96 switch_set.insert(kSwitchArray[i]); |
| 97 return switch_set; |
| 98 } |
| 99 |
58 } // namespace switches | 100 } // namespace switches |
OLD | NEW |