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

Unified Diff: chrome/common/debug_flags.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 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
« no previous file with comments | « chrome/common/debug_flags.h ('k') | chrome/common/ipc_channel_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/debug_flags.cc
diff --git a/chrome/common/debug_flags.cc b/chrome/common/debug_flags.cc
index 1e10b7844dfb35b9c499d7fed1e02266c953e3ea..9f62cbecb57e4e5c6d375aa620a55b5810699d3e 100644
--- a/chrome/common/debug_flags.cc
+++ b/chrome/common/debug_flags.cc
@@ -8,11 +8,11 @@
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
-bool DebugFlags::ProcessDebugFlags(std::wstring* command_line,
+bool DebugFlags::ProcessDebugFlags(CommandLine* command_line,
ChildProcessType type,
bool is_in_sandbox) {
bool should_help_child = false;
- CommandLine current_cmd_line;
+ const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess();
if (current_cmd_line.HasSwitch(switches::kDebugChildren)) {
// Look to pass-on the kDebugOnStart flag.
std::wstring value;
@@ -20,12 +20,10 @@ bool DebugFlags::ProcessDebugFlags(std::wstring* command_line,
if (value.empty() ||
(type == RENDERER && value == switches::kRendererProcess) ||
(type == PLUGIN && value == switches::kPluginProcess)) {
- CommandLine::AppendSwitch(command_line, switches::kDebugOnStart);
+ command_line->AppendSwitch(switches::kDebugOnStart);
should_help_child = true;
}
- CommandLine::AppendSwitchWithValue(command_line,
- switches::kDebugChildren,
- value);
+ command_line->AppendSwitchWithValue(switches::kDebugChildren, value);
} else if (current_cmd_line.HasSwitch(switches::kWaitForDebuggerChildren)) {
// Look to pass-on the kWaitForDebugger flag.
std::wstring value;
@@ -33,11 +31,10 @@ bool DebugFlags::ProcessDebugFlags(std::wstring* command_line,
if (value.empty() ||
(type == RENDERER && value == switches::kRendererProcess) ||
(type == PLUGIN && value == switches::kPluginProcess)) {
- CommandLine::AppendSwitch(command_line, switches::kWaitForDebugger);
+ command_line->AppendSwitch(switches::kWaitForDebugger);
}
- CommandLine::AppendSwitchWithValue(command_line,
- switches::kWaitForDebuggerChildren,
- value);
+ command_line->AppendSwitchWithValue(switches::kWaitForDebuggerChildren,
+ value);
}
return should_help_child;
}
« no previous file with comments | « chrome/common/debug_flags.h ('k') | chrome/common/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698