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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/basictypes.h"
6 #include "base/command_line.h"
7 #include "components/nacl/common/nacl_delegate.h"
8
9 namespace nacl {
10
11 void CopyNaClCommandLineArguments(CommandLine* cmd_line) {
12 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
13
14 // Propagate the following switches to the NaCl loader command line (along
15 // with any associated values) if present in the browser command line.
16 // TODO(gregoryd): check which flags of those below can be supported.
17
18 static const NaClDelegate::NaClSwitch kSwitchIds[] = {
19 NaClDelegate::kNoSandbox,
20 NaClDelegate::kTestNaClSandbox,
21 NaClDelegate::kDisableBreakpad,
22 NaClDelegate::kFullMemoryCrashReport,
23 NaClDelegate::kEnableLogging,
24 NaClDelegate::kDisableLogging,
25 NaClDelegate::kLoggingLevel,
26 NaClDelegate::kEnableDCHECK,
27 NaClDelegate::kSilentDumpOnDCHECK,
28 NaClDelegate::kMemoryProfiling,
29 NaClDelegate::kNoErrorDialogs,
30 #if defined(OS_MACOSX)
31 NaClDelegate::kEnableSandboxLogging,
32 #endif
33 };
34
35 static const char** kSwitchNames = NULL;
36 int listLength = sizeof(kSwitchIds) / sizeof(int);
37 if (kSwitchNames == NULL) {
38 kSwitchNames = new const char* [listLength];
39 for (int i = 0; i < listLength; i++) {
40 kSwitchNames[i] = GetNaClDelegate()->GetSwitch(kSwitchIds[i]);
41 }
42 }
43
44 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, listLength);
45 }
46
47 } // namespace nacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698