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 "shell/switches.h" | 5 #include "shell/switches.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 | 8 |
9 namespace switches { | 9 namespace switches { |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 // This controls logging verbosity. It's not strictly a switch for mojo_shell, | 13 // This controls logging verbosity. It's not strictly a switch for mojo_shell, |
14 // and isn't included in the public switches, but is included here so that it | 14 // and isn't included in the public switches, but is included here so that it |
15 // doesn't trigger an error at startup. | 15 // doesn't trigger an error at startup. |
16 const char kV[] = "v"; | 16 const char kV[] = "v"; |
17 | 17 |
18 } // namespace | 18 } // namespace |
19 | 19 |
20 // Specify configuration arguments for a Mojo application URL. For example: | 20 // Specify configuration arguments for a Mojo application URL. For example: |
21 // --args-for='mojo:wget http://www.google.com' | 21 // --args-for='mojo:wget http://www.google.com' |
22 const char kArgsFor[] = "args-for"; | 22 const char kArgsFor[] = "args-for"; |
23 | 23 |
24 // Used only by the child process. Not for user use. | |
25 const char kChildProcess[] = "child-process"; | |
26 | |
27 // Comma separated list like: | 24 // Comma separated list like: |
28 // text/html,mojo:html_viewer,application/bravo,https://abarth.com/bravo | 25 // text/html,mojo:html_viewer,application/bravo,https://abarth.com/bravo |
29 const char kContentHandlers[] = "content-handlers"; | 26 const char kContentHandlers[] = "content-handlers"; |
30 | 27 |
31 // Starts sampling based CPU profiling when the shell starts up. The profile is | 28 // Starts sampling based CPU profiling when the shell starts up. The profile is |
32 // written to disk when the shell exits. | 29 // written to disk when the shell exits. |
33 const char kCPUProfile[] = "cpu-profile"; | 30 const char kCPUProfile[] = "cpu-profile"; |
34 | 31 |
35 // Force dynamically loaded apps / services to be loaded irrespective of cache | 32 // Force dynamically loaded apps / services to be loaded irrespective of cache |
36 // instructions. | 33 // instructions. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 74 |
78 // Specifies a set of mappings to apply when resolving urls. The value is a set | 75 // Specifies a set of mappings to apply when resolving urls. The value is a set |
79 // of ',' separated mappings, where each mapping consists of a pair of urls | 76 // of ',' separated mappings, where each mapping consists of a pair of urls |
80 // giving the to/from url to map. For example, 'a=b,c=d' contains two mappings, | 77 // giving the to/from url to map. For example, 'a=b,c=d' contains two mappings, |
81 // the first maps 'a' to 'b' and the second 'c' to 'd'. | 78 // the first maps 'a' to 'b' and the second 'c' to 'd'. |
82 const char kURLMappings[] = "url-mappings"; | 79 const char kURLMappings[] = "url-mappings"; |
83 | 80 |
84 // Switches valid for the main process (i.e., that the user may pass in). | 81 // Switches valid for the main process (i.e., that the user may pass in). |
85 const char* kSwitchArray[] = {kV, | 82 const char* kSwitchArray[] = {kV, |
86 kArgsFor, | 83 kArgsFor, |
87 // |kChildProcess| not for user use. | |
88 kContentHandlers, | 84 kContentHandlers, |
89 kCPUProfile, | 85 kCPUProfile, |
90 kDisableCache, | 86 kDisableCache, |
91 kDontDeleteOnDownload, | 87 kDontDeleteOnDownload, |
92 kEnableMultiprocess, | 88 kEnableMultiprocess, |
93 kForceInProcess, | 89 kForceInProcess, |
94 kHelp, | 90 kHelp, |
95 kMapOrigin, | 91 kMapOrigin, |
96 kOrigin, | 92 kOrigin, |
97 kPredictableAppFilenames, | 93 kPredictableAppFilenames, |
98 kTraceStartup, | 94 kTraceStartup, |
99 kTraceStartupDuration, | 95 kTraceStartupDuration, |
100 kURLMappings}; | 96 kURLMappings}; |
101 | 97 |
102 const std::set<std::string> GetAllSwitches() { | 98 const std::set<std::string> GetAllSwitches() { |
103 std::set<std::string> switch_set; | 99 std::set<std::string> switch_set; |
104 | 100 |
105 for (size_t i = 0; i < arraysize(kSwitchArray); ++i) | 101 for (size_t i = 0; i < arraysize(kSwitchArray); ++i) |
106 switch_set.insert(kSwitchArray[i]); | 102 switch_set.insert(kSwitchArray[i]); |
107 return switch_set; | 103 return switch_set; |
108 } | 104 } |
109 | 105 |
110 } // namespace switches | 106 } // namespace switches |
OLD | NEW |