Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: components/nacl/common/nacl_cmd_line.cc

Issue 16881004: Move chrome/nacl to components/nacl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android build fix Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/nacl/common/nacl_cmd_line.cc
diff --git a/components/nacl/common/nacl_cmd_line.cc b/components/nacl/common/nacl_cmd_line.cc
new file mode 100644
index 0000000000000000000000000000000000000000..85f91e65512792279db351e5782d75597438d11a
--- /dev/null
+++ b/components/nacl/common/nacl_cmd_line.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 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/basictypes.h"
+#include "base/command_line.h"
+#include "components/nacl/common/nacl_delegate.h"
+
+namespace nacl {
+
+void CopyNaClCommandLineArguments(CommandLine* cmd_line) {
+ const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
+
+ // 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 NaClDelegate::NaClSwitch kSwitchIds[] = {
+ NaClDelegate::kNoSandbox,
+ NaClDelegate::kTestNaClSandbox,
+ NaClDelegate::kDisableBreakpad,
+ NaClDelegate::kFullMemoryCrashReport,
+ NaClDelegate::kEnableLogging,
+ NaClDelegate::kDisableLogging,
+ NaClDelegate::kLoggingLevel,
+ NaClDelegate::kEnableDCHECK,
+ NaClDelegate::kSilentDumpOnDCHECK,
+ NaClDelegate::kMemoryProfiling,
+ NaClDelegate::kNoErrorDialogs,
+#if defined(OS_MACOSX)
+ NaClDelegate::kEnableSandboxLogging,
+#endif
+ };
+
+ static const char** kSwitchNames = NULL;
+ int listLength = sizeof(kSwitchIds) / sizeof(int);
+ if (kSwitchNames == NULL) {
+ kSwitchNames = new const char* [listLength];
+ for (int i = 0; i < listLength; i++) {
+ kSwitchNames[i] = GetNaClDelegate()->GetSwitch(kSwitchIds[i]);
+ }
+ }
+
+ cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, listLength);
+}
+
+} // namespace nacl

Powered by Google App Engine
This is Rietveld 408576698