diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 20:22:10 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 20:22:10 +0000 |
commit | 4f688e96c0ff61be7b359e7045cd1cf0caf2e3d8 (patch) | |
tree | 9f5139d0991593b692d6917c053247e34e43aa67 /base | |
parent | 0db915b4b4deadd886781aaefe3d015e79601086 (diff) | |
download | chromium_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')
-rw-r--r-- | base/command_line.cc | 28 | ||||
-rw-r--r-- | base/command_line.h | 2 |
2 files changed, 10 insertions, 20 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()); } diff --git a/base/command_line.h b/base/command_line.h index ce10d65..9cad0f1 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -162,8 +162,6 @@ class CommandLine { // APIs that work with wstrings are deprecated. // TODO(evanm): remove all of these. - std::wstring GetSwitchValue(const std::string& switch_string) const; - std::wstring GetSwitchValue(const std::wstring& switch_string) const; std::wstring program() const; #if defined(OS_WIN) // Deprecated on non-Windows. |