summaryrefslogtreecommitdiffstats
path: root/chrome/common/nacl_cmd_line.cc
diff options
context:
space:
mode:
authorgregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 00:10:10 +0000
committergregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-30 00:10:10 +0000
commit08aab35037965c2d7d71263b453fda74fa48b378 (patch)
tree45eabab475f9137125bc74a45062a78d9e7f0cc5 /chrome/common/nacl_cmd_line.cc
parent7946a0ca0347117c1f8870eb441f31ba185fc5ab (diff)
downloadchromium_src-08aab35037965c2d7d71263b453fda74fa48b378.zip
chromium_src-08aab35037965c2d7d71263b453fda74fa48b378.tar.gz
chromium_src-08aab35037965c2d7d71263b453fda74fa48b378.tar.bz2
Implement the broker process that launches NaCl loader processes on 64-bit Windows systems.
BUG=28176 TEST=none Review URL: http://codereview.chromium.org/542030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37578 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/nacl_cmd_line.cc')
-rw-r--r--chrome/common/nacl_cmd_line.cc44
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/common/nacl_cmd_line.cc b/chrome/common/nacl_cmd_line.cc
new file mode 100644
index 0000000..2212c68
--- /dev/null
+++ b/chrome/common/nacl_cmd_line.cc
@@ -0,0 +1,44 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/command_line.h"
+#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/common/logging_chrome.h"
+
+namespace nacl {
+ void CopyNaClCommandLineArguments(CommandLine* cmd_line) {
+ const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
+ if (logging::DialogsAreSuppressed())
+ cmd_line->AppendSwitch(switches::kNoErrorDialogs);
+
+ // Propagate the following switches to the NaCl loader command line (along
+ // with any associated values) if present in the browser command line.
+ // TODO(gregoryd): check which flags of those below can be supported.
+ static const char* const switch_names[] = {
+ switches::kNoSandbox,
+ switches::kTestSandbox,
+ switches::kDisableBreakpad,
+ switches::kFullMemoryCrashReport,
+ switches::kEnableLogging,
+ switches::kDisableLogging,
+ switches::kLoggingLevel,
+ switches::kEnableDCHECK,
+ switches::kSilentDumpOnDCHECK,
+ switches::kMemoryProfiling,
+#if defined(OS_MACOSX)
+ // TODO(dspringer): remove this when NaCl x86-32 security issues are fixed
+ switches::kEnableNaClOnMac,
+#endif
+ };
+
+ for (size_t i = 0; i < arraysize(switch_names); ++i) {
+ if (browser_command_line.HasSwitch(switch_names[i])) {
+ cmd_line->AppendSwitchWithValue(
+ switch_names[i],
+ browser_command_line.GetSwitchValueASCII(switch_names[i]));
+ }
+ }
+ }
+}