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" | |
9 | 8 |
10 namespace nacl { | 9 namespace nacl { |
11 | 10 |
12 void CopyNaClCommandLineArguments(CommandLine* cmd_line) { | 11 void CopyNaClCommandLineArguments(CommandLine* cmd_line) { |
13 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 12 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
14 if (logging::DialogsAreSuppressed()) | |
15 cmd_line->AppendSwitch(switches::kNoErrorDialogs); | |
16 | 13 |
17 // Propagate the following switches to the NaCl loader command line (along | 14 // Propagate the following switches to the NaCl loader command line (along |
18 // with any associated values) if present in the browser command line. | 15 // with any associated values) if present in the browser command line. |
19 // TODO(gregoryd): check which flags of those below can be supported. | 16 // TODO(gregoryd): check which flags of those below can be supported. |
20 static const char* const kSwitchNames[] = { | 17 static const char* const kSwitchNames[] = { |
21 switches::kNoSandbox, | 18 switches::kNoSandbox, |
22 switches::kTestNaClSandbox, | 19 switches::kTestNaClSandbox, |
23 switches::kDisableBreakpad, | 20 switches::kDisableBreakpad, |
24 switches::kFullMemoryCrashReport, | 21 switches::kFullMemoryCrashReport, |
25 switches::kEnableLogging, | 22 switches::kEnableLogging, |
26 switches::kDisableLogging, | 23 switches::kDisableLogging, |
27 switches::kLoggingLevel, | 24 switches::kLoggingLevel, |
28 switches::kEnableDCHECK, | 25 switches::kEnableDCHECK, |
29 switches::kSilentDumpOnDCHECK, | 26 switches::kSilentDumpOnDCHECK, |
30 switches::kMemoryProfiling, | 27 switches::kMemoryProfiling, |
31 switches::kEnableNaClDebug, | 28 switches::kEnableNaClDebug, |
32 switches::kNaClDebugPorts, | 29 switches::kNaClDebugPorts, |
33 switches::kNaClDebugIP, | 30 switches::kNaClDebugIP, |
| 31 switches::kNoErrorDialogs, |
34 }; | 32 }; |
35 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 33 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
36 arraysize(kSwitchNames)); | 34 arraysize(kSwitchNames)); |
37 } | 35 } |
38 | 36 |
39 } | 37 } |
OLD | NEW |