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

Unified Diff: base/command_line.cc

Issue 602253006: base::CommandLine: Replace use of wstring with string16. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@commandline-test-hardcode
Patch Set: Created 6 years, 3 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 | « base/command_line.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/command_line.cc
diff --git a/base/command_line.cc b/base/command_line.cc
index ca4af9754cb07a22268992bee0a79f79ad313fc4..9bad539ef196dea151cc9ea013585c421c51eeb3 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -105,15 +105,15 @@ std::string LowerASCIIOnWindows(const std::string& string) {
#if defined(OS_WIN)
// Quote a string as necessary for CommandLineToArgvW compatiblity *on Windows*.
-std::wstring QuoteForCommandLineToArgvW(const std::wstring& arg) {
+base::string16 QuoteForCommandLineToArgvW(const base::string16& arg) {
// We follow the quoting rules of CommandLineToArgvW.
// http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
- if (arg.find_first_of(L" \\\"") == std::wstring::npos) {
+ if (arg.find_first_of(L" \\\"") == base::string16::npos) {
// No quoting necessary.
return arg;
}
- std::wstring out;
+ base::string16 out;
out.push_back(L'"');
for (size_t i = 0; i < arg.size(); ++i) {
if (arg[i] == '\\') {
@@ -224,7 +224,7 @@ bool CommandLine::InitializedForCurrentProcess() {
#if defined(OS_WIN)
// static
-CommandLine CommandLine::FromString(const std::wstring& command_line) {
+CommandLine CommandLine::FromString(const base::string16& command_line) {
CommandLine cmd(NO_PROGRAM);
cmd.ParseFromString(command_line);
return cmd;
@@ -422,8 +422,8 @@ void CommandLine::PrependWrapper(const CommandLine::StringType& wrapper) {
}
#if defined(OS_WIN)
-void CommandLine::ParseFromString(const std::wstring& command_line) {
- std::wstring command_line_string;
+void CommandLine::ParseFromString(const base::string16& command_line) {
+ base::string16 command_line_string;
TrimWhitespace(command_line, TRIM_ALL, &command_line_string);
if (command_line_string.empty())
return;
« no previous file with comments | « base/command_line.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698