diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-21 01:00:22 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-21 01:00:22 +0000 |
commit | bb97536b768ac68fcbc4605c35461a798ef6e5ff (patch) | |
tree | 479bde96cd05a9e1f9d2746dd82313e2eb715e8e /net/tools | |
parent | 8731a63268015f4e5d684833c11a1b44bd9ae468 (diff) | |
download | chromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.zip chromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.tar.gz chromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.tar.bz2 |
Make CommandLine into a normal object, with some statics for getting at the current process's command line.
One explicit goal of this change is to *not* deal with the string/wstring issues at the API on POSIX; the functions are the same as before, which means they remain as broken as before. (I did try to fix the internals, though, so migrating the callers is now possible by adding platform-appropriate hooks.)
Review URL: http://codereview.chromium.org/18248
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8347 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r-- | net/tools/crash_cache/crash_cache.cc | 10 | ||||
-rw-r--r-- | net/tools/tld_cleanup/tld_cleanup.cc | 4 |
2 files changed, 3 insertions, 11 deletions
diff --git a/net/tools/crash_cache/crash_cache.cc b/net/tools/crash_cache/crash_cache.cc index df641a2..9d6f3d6 100644 --- a/net/tools/crash_cache/crash_cache.cc +++ b/net/tools/crash_cache/crash_cache.cc @@ -40,14 +40,8 @@ int RunSlave(RankCrashes action) { std::wstring exe; PathService::Get(base::FILE_EXE, &exe); -#if defined(OS_WIN) - CommandLine cmdline(StringPrintf(L"%ls %d", exe.c_str(), action)); -#elif defined(OS_POSIX) - std::vector<std::string> cmd_argv; - cmd_argv.push_back(WideToUTF8(exe)); - cmd_argv.push_back(IntToString(action)); - CommandLine cmdline(cmd_argv); -#endif + CommandLine cmdline(exe); + cmdline.AppendLooseValue(ASCIIToWide(IntToString(action))); base::ProcessHandle handle; if (!base::LaunchApp(cmdline, false, false, &handle)) { diff --git a/net/tools/tld_cleanup/tld_cleanup.cc b/net/tools/tld_cleanup/tld_cleanup.cc index 797a669..792faad 100644 --- a/net/tools/tld_cleanup/tld_cleanup.cc +++ b/net/tools/tld_cleanup/tld_cleanup.cc @@ -208,9 +208,7 @@ int main(int argc, const char* argv[]) { logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG; #endif -#if defined(OS_LINUX) - CommandLine::SetArgcArgv(argc, argv); -#endif + CommandLine::Init(argc, argv); FilePath log_filename; PathService::Get(base::DIR_EXE, &log_filename); |