summaryrefslogtreecommitdiffstats
path: root/base/command_line.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 20:22:10 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 20:22:10 +0000
commit4f688e96c0ff61be7b359e7045cd1cf0caf2e3d8 (patch)
tree9f5139d0991593b692d6917c053247e34e43aa67 /base/command_line.cc
parent0db915b4b4deadd886781aaefe3d015e79601086 (diff)
downloadchromium_src-4f688e96c0ff61be7b359e7045cd1cf0caf2e3d8.zip
chromium_src-4f688e96c0ff61be7b359e7045cd1cf0caf2e3d8.tar.gz
chromium_src-4f688e96c0ff61be7b359e7045cd1cf0caf2e3d8.tar.bz2
CommandLine: remove deprecated wstring API
(o3d still uses an older version of base; if they update past this change they will need to apply the change I reverted in r55433.) BUG=23581 TEST=compiles, existing tests still pass Review URL: http://codereview.chromium.org/3552011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line.cc')
-rw-r--r--base/command_line.cc28
1 files changed, 10 insertions, 18 deletions
diff --git a/base/command_line.cc b/base/command_line.cc
index a68c8f3..4d76ed0 100644
--- a/base/command_line.cc
+++ b/base/command_line.cc
@@ -297,7 +297,16 @@ bool CommandLine::HasSwitch(const std::wstring& switch_string) const {
std::string CommandLine::GetSwitchValueASCII(
const std::string& switch_string) const {
- return WideToASCII(GetSwitchValue(switch_string));
+ CommandLine::StringType value = GetSwitchValueNative(switch_string);
+ if (!IsStringASCII(value)) {
+ LOG(WARNING) << "Value of --" << switch_string << " must be ASCII.";
+ return "";
+ }
+#if defined(OS_WIN)
+ return WideToASCII(value);
+#else
+ return value;
+#endif
}
FilePath CommandLine::GetSwitchValuePath(
@@ -322,23 +331,6 @@ CommandLine::StringType CommandLine::GetSwitchValueNative(
}
}
-std::wstring CommandLine::GetSwitchValue(
- const std::string& switch_string) const {
- // TODO(evanm): deprecate.
- CommandLine::StringType value = GetSwitchValueNative(switch_string);
-#if defined(OS_WIN)
- return value;
-#else
- return base::SysNativeMBToWide(value);
-#endif
-}
-
-std::wstring CommandLine::GetSwitchValue(
- const std::wstring& switch_string) const {
- // TODO(evanm): deprecate.
- return GetSwitchValue(WideToASCII(switch_string));
-}
-
FilePath CommandLine::GetProgram() const {
return FilePath::FromWStringHack(program());
}