OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/common/chrome_constants.h" | 6 #include "chrome/common/chrome_constants.h" |
7 #include "chrome/common/chrome_switches.h" | 7 #include "chrome/common/chrome_switches.h" |
8 #include "chrome/common/logging_chrome.h" | 8 #include "chrome/common/logging_chrome.h" |
9 | 9 |
10 namespace nacl { | 10 namespace nacl { |
11 void CopyNaClCommandLineArguments(CommandLine* cmd_line) { | 11 void CopyNaClCommandLineArguments(CommandLine* cmd_line) { |
12 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 12 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
13 if (logging::DialogsAreSuppressed()) | 13 if (logging::DialogsAreSuppressed()) |
14 cmd_line->AppendSwitch(switches::kNoErrorDialogs); | 14 cmd_line->AppendSwitch(switches::kNoErrorDialogs); |
15 | 15 |
16 // Propagate the following switches to the NaCl loader command line (along | 16 // Propagate the following switches to the NaCl loader command line (along |
17 // with any associated values) if present in the browser command line. | 17 // with any associated values) if present in the browser command line. |
18 // TODO(gregoryd): check which flags of those below can be supported. | 18 // TODO(gregoryd): check which flags of those below can be supported. |
19 static const char* const switch_names[] = { | 19 static const char* const kSwitchNames[] = { |
20 switches::kNoSandbox, | 20 switches::kNoSandbox, |
21 switches::kTestNaClSandbox, | 21 switches::kTestNaClSandbox, |
22 switches::kDisableBreakpad, | 22 switches::kDisableBreakpad, |
23 switches::kFullMemoryCrashReport, | 23 switches::kFullMemoryCrashReport, |
24 switches::kEnableLogging, | 24 switches::kEnableLogging, |
25 switches::kDisableLogging, | 25 switches::kDisableLogging, |
26 switches::kLoggingLevel, | 26 switches::kLoggingLevel, |
27 switches::kEnableDCHECK, | 27 switches::kEnableDCHECK, |
28 switches::kSilentDumpOnDCHECK, | 28 switches::kSilentDumpOnDCHECK, |
29 switches::kMemoryProfiling, | 29 switches::kMemoryProfiling, |
30 }; | 30 }; |
31 | 31 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
32 for (size_t i = 0; i < arraysize(switch_names); ++i) { | 32 arraysize(kSwitchNames)); |
33 if (browser_command_line.HasSwitch(switch_names[i])) { | |
34 cmd_line->AppendSwitchWithValue( | |
35 switch_names[i], | |
36 browser_command_line.GetSwitchValueASCII(switch_names[i])); | |
37 } | |
38 } | |
39 } | 33 } |
40 } | 34 } |
OLD | NEW |