summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-20 22:10:02 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-20 22:10:02 +0000
commite5e19c3476afa746b3baec8be9ea12532452afbb (patch)
treeba04ab540e44bd0eccb371c0cf053907c4363fd3 /base
parentf730a913f16507bedeeca30827a66f07903fb42a (diff)
downloadchromium_src-e5e19c3476afa746b3baec8be9ea12532452afbb.zip
chromium_src-e5e19c3476afa746b3baec8be9ea12532452afbb.tar.gz
chromium_src-e5e19c3476afa746b3baec8be9ea12532452afbb.tar.bz2
posix: port PrependCommand to Windows and use for the plugin launcher.
Review URL: http://codereview.chromium.org/88006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/command_line.cc9
-rw-r--r--base/command_line.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/base/command_line.cc b/base/command_line.cc
index e49254f..8fb2dcc 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -306,6 +306,15 @@ void CommandLine::AppendArguments(const CommandLine& other,
switches_[i->first] = i->second;
}
+void CommandLine::PrependWrapper(const std::wstring& wrapper) {
+ // The wrapper may have embedded arguments (like "gdb --args"). In this case,
+ // we don't pretend to do anything fancy, we just split on spaces.
+ std::vector<std::wstring> wrapper_and_args;
+ SplitString(wrapper, ' ', &wrapper_and_args);
+ program_ = wrapper_and_args[0];
+ command_line_string_ = wrapper + L" " + command_line_string_;
+}
+
#elif defined(OS_POSIX)
void CommandLine::AppendSwitch(const std::wstring& switch_string) {
std::string ascii_switch = WideToASCII(switch_string);
diff --git a/base/command_line.h b/base/command_line.h
index c727b8a..8271206 100644
--- a/base/command_line.h
+++ b/base/command_line.h
@@ -121,7 +121,7 @@ class CommandLine {
bool include_program);
// On POSIX systems it's common to run processes via a wrapper (like
- // "valgrind" or "gdb --args"). *Note, only availible on POSIX*
+ // "valgrind" or "gdb --args").
void PrependWrapper(const std::wstring& wrapper);
private: