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 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"; |
| 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 // If set apps downloaded are not deleted. |
| 36 const char kDontDeleteOnDownload[] = "dont-delete-on-download"; |
| 37 |
| 38 // Allow externally-running applications to discover, connect to, and register |
| 39 // themselves with the shell. |
| 40 // TODO(cmasone): Work in progress. Once we're sure this works, remove. |
| 41 const char kEnableExternalApplications[] = "enable-external-applications"; |
| 42 |
| 43 // Load apps in separate processes. |
| 44 // TODO(vtl): Work in progress; doesn't work. Flip this to "disable" (or maybe |
| 45 // change it to "single-process") when it works. |
| 46 const char kEnableMultiprocess[] = "enable-multiprocess"; |
| 47 |
| 48 // In multiprocess mode, force these apps to be loaded in the main process. |
| 49 // Comma-separate list of URLs. Example: |
| 50 // --force-in-process=mojo:native_viewport_service,mojo:network_service |
| 51 const char kForceInProcess[] = "force-in-process"; |
| 52 |
| 53 // Print the usage message and exit. |
| 54 const char kHelp[] = "help"; |
| 55 |
| 56 // Specify origin to map to base url. See url_resolver.cc for details. |
| 57 // Can be used multiple times. |
| 58 const char kMapOrigin[] = "map-origin"; |
| 59 |
| 60 // Map mojo: URLs to a shared library of similar name at this origin. See |
| 61 // url_resolver.cc for details. |
| 62 const char kOrigin[] = "origin"; |
| 63 |
| 64 // If set apps downloaded are saved in with a predictable filename, to help |
| 65 // remote debugging: when gdb is used through gdbserver, it needs to be able to |
| 66 // find locally any loaded library. For this, gdb use the filename of the |
| 67 // library. When using this flag, the application are named with the sha256 of |
| 68 // their content. |
| 69 const char kPredictableAppFilenames[] = "predictable-app-filenames"; |
| 70 |
| 71 // Starts tracing when the shell starts up, saving a trace file on disk after 5 |
| 72 // seconds or when the shell exits. |
| 73 const char kTraceStartup[] = "trace-startup"; |
| 74 |
| 75 // Specifies a set of mappings to apply when resolving urls. The value is a set |
| 76 // of ',' separated mappings, where each mapping consists of a pair of urls |
| 77 // giving the to/from url to map. For example, 'a=b,c=d' contains two mappings, |
| 78 // the first maps 'a' to 'b' and the second 'c' to 'd'. |
| 79 const char kURLMappings[] = "url-mappings"; |
| 80 |
| 81 // Switches valid for the main process (i.e., that the user may pass in). |
| 82 const char* kSwitchArray[] = {kV, |
| 83 kArgsFor, |
| 84 // |kChildProcess| not for user use. |
| 85 kContentHandlers, |
| 86 kDisableCache, |
| 87 kDontDeleteOnDownload, |
| 88 kEnableExternalApplications, |
| 89 kEnableMultiprocess, |
| 90 kForceInProcess, |
| 91 kHelp, |
| 92 kMapOrigin, |
| 93 kOrigin, |
| 94 kPredictableAppFilenames, |
| 95 kTraceStartup, |
| 96 kURLMappings}; |
| 97 |
| 98 const std::set<std::string> GetAllSwitches() { |
| 99 std::set<std::string> switch_set; |
| 100 |
| 101 for (size_t i = 0; i < arraysize(kSwitchArray); ++i) |
| 102 switch_set.insert(kSwitchArray[i]); |
| 103 return switch_set; |
| 104 } |
| 105 |
| 106 } // namespace switches |
OLD | NEW |