summaryrefslogtreecommitdiffstats
path: root/chrome/common/nacl_cmd_line.cc
blob: 82c2634da5ed145330bf6df31a09ccdc5cb07997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// 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 kSwitchNames[] = {
      switches::kNoSandbox,
      switches::kTestNaClSandbox,
      switches::kDisableBreakpad,
      switches::kFullMemoryCrashReport,
      switches::kEnableLogging,
      switches::kDisableLogging,
      switches::kLoggingLevel,
      switches::kEnableDCHECK,
      switches::kSilentDumpOnDCHECK,
      switches::kMemoryProfiling,
    };
    cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
                               arraysize(kSwitchNames));
  }
}