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

Unified Diff: chrome/installer/util/product.cc

Issue 7386002: Rename CommandLine::GetCommandLineString(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge. Created 9 years, 5 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
Index: chrome/installer/util/product.cc
diff --git a/chrome/installer/util/product.cc b/chrome/installer/util/product.cc
index eb5286d2de38c57dde7fd29ed9a369c0296fdcfc..63299f1b9388d73dac9001c93ddeb2ead00721eb 100644
--- a/chrome/installer/util/product.cc
+++ b/chrome/installer/util/product.cc
@@ -79,15 +79,14 @@ bool Product::LaunchChromeAndWait(const FilePath& application_path,
bool success = false;
STARTUPINFOW si = { sizeof(si) };
PROCESS_INFORMATION pi = {0};
- // Cast away constness of the command_line_string() since CreateProcess
- // might modify the string (insert \0 to separate the program from the
- // arguments). Since we're not using the cmd variable beyond this point
- // we don't care.
+ // Create a writable copy of the command line string, since CreateProcess may
+ // modify the string (insert \0 to separate the program from the arguments).
+ std::wstring writable_command_line_string(cmd.GetCommandLineString());
if (!::CreateProcess(cmd.GetProgram().value().c_str(),
- const_cast<wchar_t*>(cmd.command_line_string().c_str()),
+ &writable_command_line_string[0],
NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL,
&si, &pi)) {
- PLOG(ERROR) << "Failed to launch: " << cmd.command_line_string();
+ PLOG(ERROR) << "Failed to launch: " << cmd.GetCommandLineString();
} else {
::CloseHandle(pi.hThread);
« no previous file with comments | « chrome/installer/util/installation_validator_unittest.cc ('k') | chrome/installer/util/product_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698