diff options
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 18 | ||||
-rw-r--r-- | chrome/browser/browser_init.cc | 4 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 5 | ||||
-rw-r--r-- | net/base/net_util.cc | 7 | ||||
-rw-r--r-- | net/base/net_util.h | 2 | ||||
-rw-r--r-- | net/base/net_util_unittest.cc | 4 |
6 files changed, 19 insertions, 21 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index a3c1cbb..e65ac91 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -332,11 +332,9 @@ void SetupCRT(const CommandLine& parsed_command_line) { // Enable the low fragmentation heap for the CRT heap. The heap is not changed // if the process is run under the debugger is enabled or if certain gflags // are set. - bool use_lfh = false; - if (parsed_command_line.HasSwitch(switches::kUseLowFragHeapCrt)) - use_lfh = parsed_command_line.GetSwitchValue(switches::kUseLowFragHeapCrt) - != L"false"; - if (use_lfh) { + if (parsed_command_line.HasSwitch(switches::kUseLowFragHeapCrt) && + (parsed_command_line.GetSwitchValueASCII(switches::kUseLowFragHeapCrt) + != "false")) { void* crt_heap = reinterpret_cast<void*>(_get_heap_handle()); ULONG enable_lfh = 2; HeapSetInformation(crt_heap, HeapCompatibilityInformation, @@ -581,11 +579,11 @@ int ChromeMain(int argc, char** argv) { base::ProcessId browser_pid = base::GetCurrentProcId(); if (SubprocessIsBrowserChild(process_type)) { #if defined(OS_WIN) - std::wstring channel_name = - parsed_command_line.GetSwitchValue(switches::kProcessChannelID); + std::string channel_name = + parsed_command_line.GetSwitchValueASCII(switches::kProcessChannelID); int browser_pid_int; - base::StringToInt(WideToUTF8(channel_name), &browser_pid_int); + base::StringToInt(channel_name, &browser_pid_int); browser_pid = static_cast<base::ProcessId>(browser_pid_int); DCHECK_NE(browser_pid, 0u); #elif defined(OS_MACOSX) @@ -744,8 +742,8 @@ int ChromeMain(int argc, char** argv) { // via the preference prefs::kApplicationLocale. The browser process uses // the --lang flag to passe the value of the PrefService in here. Maybe this // value could be passed in a different way. - ResourceBundle::InitSharedInstance( - parsed_command_line.GetSwitchValue(switches::kLang)); + ResourceBundle::InitSharedInstance(ASCIIToWide( + parsed_command_line.GetSwitchValueASCII(switches::kLang))); #if defined(OS_MACOSX) // Update the process name (need resources to get the strings, so diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 2e499b6..237ff95 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -1031,8 +1031,8 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, } if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { - std::wstring allowed_ports = - command_line.GetSwitchValue(switches::kExplicitlyAllowedPorts); + std::string allowed_ports = + command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); net::SetExplicitlyAllowedPorts(allowed_ports); } diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 51ebf44..1c445461 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -1235,8 +1235,9 @@ int BrowserMain(const MainFunctionParams& parameters) { #if defined(OS_WIN) && !defined(GOOGLE_CHROME_BUILD) if (parsed_command_line.HasSwitch(switches::kDebugPrint)) { - printing::PrintedDocument::set_debug_dump_path( - parsed_command_line.GetSwitchValue(switches::kDebugPrint)); + FilePath path = + parsed_command_line.GetSwitchValuePath(switches::kDebugPrint); + printing::PrintedDocument::set_debug_dump_path(path.value()); } #endif diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 1d903b8..a125664 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -1638,7 +1638,7 @@ GURL SimplifyUrlForRequest(const GURL& url) { // Specifies a comma separated list of port numbers that should be accepted // despite bans. If the string is invalid no allowed ports are stored. -void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports) { +void SetExplicitlyAllowedPorts(const std::string& allowed_ports) { if (allowed_ports.empty()) return; @@ -1646,7 +1646,7 @@ void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports) { size_t last = 0; size_t size = allowed_ports.size(); // The comma delimiter. - const std::wstring::value_type kComma = L','; + const std::string::value_type kComma = ','; // Overflow is still possible for evil user inputs. for (size_t i = 0; i <= size; ++i) { @@ -1658,8 +1658,7 @@ void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports) { size_t length = i - last; if (length > 0) { int port; - base::StringToInt(WideToUTF8(allowed_ports.substr(last, length)), - &port); + base::StringToInt(allowed_ports.substr(last, length), &port); ports.insert(port); } last = i + 1; diff --git a/net/base/net_util.h b/net/base/net_util.h index 44bda41..7815146 100644 --- a/net/base/net_util.h +++ b/net/base/net_util.h @@ -321,7 +321,7 @@ bool CanStripTrailingSlash(const GURL& url); // - reference section GURL SimplifyUrlForRequest(const GURL& url); -void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports); +void SetExplicitlyAllowedPorts(const std::string& allowed_ports); // Perform a simplistic test to see if IPv6 is supported by trying to create an // IPv6 socket. diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc index 98e2b05..67cc03e 100644 --- a/net/base/net_util_unittest.cc +++ b/net/base/net_util_unittest.cc @@ -1846,8 +1846,8 @@ TEST(NetUtilTest, SimplifyUrlForRequest) { } TEST(NetUtilTest, SetExplicitlyAllowedPortsTest) { - std::wstring invalid[] = { L"1,2,a", L"'1','2'", L"1, 2, 3", L"1 0,11,12" }; - std::wstring valid[] = { L"", L"1", L"1,2", L"1,2,3", L"10,11,12,13" }; + std::string invalid[] = { "1,2,a", "'1','2'", "1, 2, 3", "1 0,11,12" }; + std::string valid[] = { "", "1", "1,2", "1,2,3", "10,11,12,13" }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(invalid); ++i) { net::SetExplicitlyAllowedPorts(invalid[i]); |