ipc/chromium/src/chrome/common/debug_flags.cc

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
michael@0 2 // Use of this source code is governed by a BSD-style license that can be
michael@0 3 // found in the LICENSE file.
michael@0 4
michael@0 5 #include "chrome/common/debug_flags.h"
michael@0 6
michael@0 7 #include "base/base_switches.h"
michael@0 8 #include "base/command_line.h"
michael@0 9 #include "chrome/common/chrome_switches.h"
michael@0 10
michael@0 11 bool DebugFlags::ProcessDebugFlags(CommandLine* command_line,
michael@0 12 ChildProcessInfo::ProcessType type,
michael@0 13 bool is_in_sandbox) {
michael@0 14 bool should_help_child = false;
michael@0 15 const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess();
michael@0 16 if (current_cmd_line.HasSwitch(switches::kDebugChildren)) {
michael@0 17 // Look to pass-on the kDebugOnStart flag.
michael@0 18 std::wstring value;
michael@0 19 value = current_cmd_line.GetSwitchValue(switches::kDebugChildren);
michael@0 20 if (value.empty() ||
michael@0 21 (type == ChildProcessInfo::RENDER_PROCESS &&
michael@0 22 value == switches::kRendererProcess) ||
michael@0 23 (type == ChildProcessInfo::PLUGIN_PROCESS &&
michael@0 24 value == switches::kPluginProcess)) {
michael@0 25 command_line->AppendSwitch(switches::kDebugOnStart);
michael@0 26 should_help_child = true;
michael@0 27 }
michael@0 28 command_line->AppendSwitchWithValue(switches::kDebugChildren, value);
michael@0 29 } else if (current_cmd_line.HasSwitch(switches::kWaitForDebuggerChildren)) {
michael@0 30 // Look to pass-on the kWaitForDebugger flag.
michael@0 31 std::wstring value;
michael@0 32 value = current_cmd_line.GetSwitchValue(switches::kWaitForDebuggerChildren);
michael@0 33 if (value.empty() ||
michael@0 34 (type == ChildProcessInfo::RENDER_PROCESS &&
michael@0 35 value == switches::kRendererProcess) ||
michael@0 36 (type == ChildProcessInfo::PLUGIN_PROCESS &&
michael@0 37 value == switches::kPluginProcess)) {
michael@0 38 command_line->AppendSwitch(switches::kWaitForDebugger);
michael@0 39 }
michael@0 40 command_line->AppendSwitchWithValue(switches::kWaitForDebuggerChildren,
michael@0 41 value);
michael@0 42 }
michael@0 43 return should_help_child;
michael@0 44 }

mercurial