Chromium Code Reviews| Index: mojo/shell/switches.cc |
| diff --git a/mojo/shell/switches.cc b/mojo/shell/switches.cc |
| index bb159b5b8bd306b212d4e9edf2f3335318dfaef7..9b377e3d64c960ff5fb48a4953b410aa9e8dd976 100644 |
| --- a/mojo/shell/switches.cc |
| +++ b/mojo/shell/switches.cc |
| @@ -4,6 +4,8 @@ |
| #include "mojo/shell/switches.h" |
| +#include "base/basictypes.h" |
| + |
| namespace switches { |
| // Specify configuration arguments for a Mojo application URL. For example: |
| @@ -49,4 +51,27 @@ const char kSpy[] = "spy"; |
| // first maps 'a' to 'b' and the second 'c' to 'd'. |
| const char kURLMappings[] = "url-mappings"; |
| +const char* switch_array[] = { |
| + kArgsFor, |
|
Aaron Boodman
2014/11/17 15:46:06
This duplicates information. People are going to u
DaveMoore
2014/11/17 16:36:47
Name changed. I didn't think you used kFoo for arr
Aaron Boodman
2014/11/17 16:44:45
Sorry, I disagree. I think it is likely that peopl
|
| + kChildProcessType, |
| + kDisableCache, |
| + kEnableExternalApplications, |
| + kEnableMultiprocess, |
| + kHelp, |
| + kOrigin, |
| + kSpy, |
| + kURLMappings |
| +}; |
| + |
| +const std::set<std::string>& GetAllSwitches() { |
| + static std::set<std::string> switch_set; |
|
hansmuller
2014/11/17 15:33:19
The switch_array and the cached set values aren't
Aaron Boodman
2014/11/17 15:46:07
It's against Chromium style to have static non-POD
DaveMoore
2014/11/17 16:36:47
I see now that you're right that even function sta
|
| + static bool initialized = false; |
| + if (!initialized) { |
| + for (size_t i = 0; i < arraysize(switch_array); ++i) |
| + switch_set.insert(switch_array[i]); |
| + initialized = true; |
| + } |
| + return switch_set; |
| +} |
| + |
| } // namespace switches |