summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 19:55:16 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 19:55:16 +0000
commitc4e52f0d8fa148f543d3e7b2562164e9bf5605aa (patch)
tree86a455dd54d4542026ff3059ac939dc809a09b26 /chrome/common
parent2fd94bbeefa87a83a96c65ff998add7d7fb0f908 (diff)
downloadchromium_src-c4e52f0d8fa148f543d3e7b2562164e9bf5605aa.zip
chromium_src-c4e52f0d8fa148f543d3e7b2562164e9bf5605aa.tar.gz
chromium_src-c4e52f0d8fa148f543d3e7b2562164e9bf5605aa.tar.bz2
Use GetSwitchValueASCII.
BUG=24672 TEST=None Original patch by Thiago Farina <thiago.farina@gmail.com> at http://codereview.chromium.org/296004 Review URL: http://codereview.chromium.org/373013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/child_thread.cc11
-rw-r--r--chrome/common/chrome_paths.cc9
-rw-r--r--chrome/common/logging_chrome.cc13
3 files changed, 16 insertions, 17 deletions
diff --git a/chrome/common/child_thread.cc b/chrome/common/child_thread.cc
index 43da09a..48358f1 100644
--- a/chrome/common/child_thread.cc
+++ b/chrome/common/child_thread.cc
@@ -17,9 +17,8 @@
ChildThread::ChildThread() {
- channel_name_ = WideToASCII(
- CommandLine::ForCurrentProcess()->GetSwitchValue(
- switches::kProcessChannelID));
+ channel_name_ = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kProcessChannelID);
Init();
}
@@ -32,9 +31,9 @@ void ChildThread::Init() {
check_with_browser_before_shutdown_ = false;
message_loop_ = MessageLoop::current();
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) {
- webkit_glue::SetUserAgent(WideToUTF8(
- CommandLine::ForCurrentProcess()->GetSwitchValue(
- switches::kUserAgent)));
+ webkit_glue::SetUserAgent(
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kUserAgent));
}
channel_.reset(new IPC::SyncChannel(channel_name_,
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index aa9ae8d..4382793 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -23,11 +23,10 @@ namespace chrome {
bool GetGearsPluginPathFromCommandLine(FilePath* path) {
#ifndef NDEBUG
// for debugging, support a cmd line based override
- std::wstring plugin_path = CommandLine::ForCurrentProcess()->GetSwitchValue(
- switches::kGearsPluginPathOverride);
- // TODO(tc): After GetSwitchNativeValue lands, we don't need to use
- // FromWStringHack.
- *path = FilePath::FromWStringHack(plugin_path);
+ FilePath plugin_path =
+ CommandLine::ForCurrentProcess()->GetSwitchValuePath(
+ switches::kGearsPluginPathOverride);
+ *path = plugin_path;
return !plugin_path.empty();
#else
return false;
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc
index 3236468..6af2128 100644
--- a/chrome/common/logging_chrome.cc
+++ b/chrome/common/logging_chrome.cc
@@ -117,7 +117,7 @@ void InitChromeLogging(const CommandLine& command_line,
if (enable_logging) {
// Let --enable-logging=stderr force only stderr, particularly useful for
// non-debug builds where otherwise you can't get logs to stderr at all.
- if (command_line.GetSwitchValue(switches::kEnableLogging) == L"stderr")
+ if (command_line.GetSwitchValueASCII(switches::kEnableLogging) == "stderr")
log_mode = logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG;
else
log_mode = kDefaultLoggingMode;
@@ -141,15 +141,16 @@ void InitChromeLogging(const CommandLine& command_line,
command_line.HasSwitch(switches::kNoErrorDialogs))
SuppressDialogs();
- std::wstring log_filter_prefix =
- command_line.GetSwitchValue(switches::kLogFilterPrefix);
- logging::SetLogFilterPrefix(WideToUTF8(log_filter_prefix).c_str());
+ std::string log_filter_prefix =
+ command_line.GetSwitchValueASCII(switches::kLogFilterPrefix);
+ logging::SetLogFilterPrefix(log_filter_prefix.c_str());
// Use a minimum log level if the command line has one, otherwise set the
// default to LOG_WARNING.
- std::wstring log_level = command_line.GetSwitchValue(switches::kLoggingLevel);
+ std::string log_level = command_line.GetSwitchValueASCII(
+ switches::kLoggingLevel);
int level = 0;
- if (StringToInt(WideToUTF16Hack(log_level), &level)) {
+ if (StringToInt(log_level, &level)) {
if ((level >= 0) && (level < LOG_NUM_SEVERITIES))
logging::SetMinLogLevel(level);
} else {