diff options
69 files changed, 679 insertions, 652 deletions
diff --git a/app/app_switches.cc b/app/app_switches.cc index f07fa32e6..f869d68 100644 --- a/app/app_switches.cc +++ b/app/app_switches.cc @@ -8,6 +8,6 @@ namespace switches { // The language file that we want to try to open. Of the form // language[-country] where language is the 2 letter code from ISO-639. -const wchar_t kLang[] = L"lang"; +const char kLang[] = "lang"; } // namespace switches diff --git a/app/app_switches.h b/app/app_switches.h index 1169b7f..b589153 100644 --- a/app/app_switches.h +++ b/app/app_switches.h @@ -9,7 +9,7 @@ namespace switches { -extern const wchar_t kLang[]; +extern const char kLang[]; } // namespace switches diff --git a/base/base_switches.cc b/base/base_switches.cc index b13517a..2613623 100644 --- a/base/base_switches.cc +++ b/base/base_switches.cc @@ -9,29 +9,29 @@ namespace switches { // If the program includes chrome/common/debug_on_start.h, the process will // start the JIT system-registered debugger on itself and will wait for 60 // seconds for the debugger to attach to itself. Then a break point will be hit. -const wchar_t kDebugOnStart[] = L"debug-on-start"; +const char kDebugOnStart[] = "debug-on-start"; // Will wait for 60 seconds for a debugger to come to attach to the process. -const wchar_t kWaitForDebugger[] = L"wait-for-debugger"; +const char kWaitForDebugger[] = "wait-for-debugger"; // Suppresses all error dialogs when present. -const wchar_t kNoErrorDialogs[] = L"noerrdialogs"; +const char kNoErrorDialogs[] = "noerrdialogs"; // Disables the crash reporting. -const wchar_t kDisableBreakpad[] = L"disable-breakpad"; +const char kDisableBreakpad[] = "disable-breakpad"; // Generates full memory crash dump. -const wchar_t kFullMemoryCrashReport[] = L"full-memory-crash-report"; +const char kFullMemoryCrashReport[] = "full-memory-crash-report"; // The value of this switch determines whether the process is started as a // renderer or plugin host. If it's empty, it's the browser. -const wchar_t kProcessType[] = L"type"; +const char kProcessType[] = "type"; // Enable DCHECKs in release mode. -const wchar_t kEnableDCHECK[] = L"enable-dcheck"; +const char kEnableDCHECK[] = "enable-dcheck"; // Disable win_util::MessageBox. This is useful when running as part of // scripts that do not have a user interface. -const wchar_t kNoMessageBox[] = L"no-message-box"; +const char kNoMessageBox[] = "no-message-box"; } // namespace switches diff --git a/base/base_switches.h b/base/base_switches.h index e708ee4..4074043 100644 --- a/base/base_switches.h +++ b/base/base_switches.h @@ -9,14 +9,14 @@ namespace switches { -extern const wchar_t kDebugOnStart[]; -extern const wchar_t kWaitForDebugger[]; -extern const wchar_t kDisableBreakpad[]; -extern const wchar_t kFullMemoryCrashReport[]; -extern const wchar_t kNoErrorDialogs[]; -extern const wchar_t kProcessType[]; -extern const wchar_t kEnableDCHECK[]; -extern const wchar_t kNoMessageBox[]; +extern const char kDebugOnStart[]; +extern const char kWaitForDebugger[]; +extern const char kDisableBreakpad[]; +extern const char kFullMemoryCrashReport[]; +extern const char kNoErrorDialogs[]; +extern const char kProcessType[]; +extern const char kEnableDCHECK[]; +extern const char kNoMessageBox[]; } // namespace switches diff --git a/base/command_line.cc b/base/command_line.cc index a1c2c1e..1e52004 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -45,7 +45,7 @@ const char kSwitchValueSeparator[] = "="; // Lowercase a string. This is used to lowercase switch names. // Is this what we really want? It seems crazy to me. I've left it in // for backwards compatibility on Windows. -static void Lowercase(std::wstring* parameter) { +static void Lowercase(std::string* parameter) { transform(parameter->begin(), parameter->end(), parameter->begin(), tolower); } @@ -175,8 +175,8 @@ bool CommandLine::IsSwitch(const StringType& parameter_string, *switch_value = parameter_string.substr(equals_position + 1); } #if defined(OS_WIN) - Lowercase(&switch_native); *switch_string = WideToASCII(switch_native); + Lowercase(switch_string); #else *switch_string = switch_native; #endif @@ -225,23 +225,23 @@ void CommandLine::Reset() { current_process_commandline_ = NULL; } -bool CommandLine::HasSwitch(const std::wstring& switch_string) const { - std::wstring lowercased_switch(switch_string); +bool CommandLine::HasSwitch(const std::string& switch_string) const { + std::string lowercased_switch(switch_string); #if defined(OS_WIN) Lowercase(&lowercased_switch); #endif - return switches_.find(WideToASCII(lowercased_switch)) != switches_.end(); + return switches_.find(lowercased_switch) != switches_.end(); } std::wstring CommandLine::GetSwitchValue( - const std::wstring& switch_string) const { - std::wstring lowercased_switch(switch_string); + const std::string& switch_string) const { + std::string lowercased_switch(switch_string); #if defined(OS_WIN) Lowercase(&lowercased_switch); #endif std::map<std::string, StringType>::const_iterator result = - switches_.find(WideToASCII(lowercased_switch)); + switches_.find(lowercased_switch); if (result == switches_.end()) { return L""; @@ -277,39 +277,39 @@ std::wstring CommandLine::program() const { // static std::wstring CommandLine::PrefixedSwitchString( - const std::wstring& switch_string) { + const std::string& switch_string) { #if defined(OS_WIN) - return kSwitchPrefixes[0] + switch_string; + return kSwitchPrefixes[0] + ASCIIToWide(switch_string); #else - return ASCIIToWide(kSwitchPrefixes[0]) + switch_string; + return ASCIIToWide(kSwitchPrefixes[0] + switch_string); #endif } // static std::wstring CommandLine::PrefixedSwitchStringWithValue( - const std::wstring& switch_string, const std::wstring& value_string) { + const std::string& switch_string, const std::wstring& value_string) { if (value_string.empty()) { return PrefixedSwitchString(switch_string); } return PrefixedSwitchString(switch_string + #if defined(OS_WIN) - kSwitchValueSeparator + + WideToASCII(kSwitchValueSeparator) #else - ASCIIToWide(kSwitchValueSeparator) + + kSwitchValueSeparator #endif - value_string); + ) + value_string; } #if defined(OS_WIN) -void CommandLine::AppendSwitch(const std::wstring& switch_string) { +void CommandLine::AppendSwitch(const std::string& switch_string) { std::wstring prefixed_switch_string = PrefixedSwitchString(switch_string); command_line_string_.append(L" "); command_line_string_.append(prefixed_switch_string); - switches_[WideToASCII(switch_string)] = L""; + switches_[switch_string] = L""; } -void CommandLine::AppendSwitchWithValue(const std::wstring& switch_string, +void CommandLine::AppendSwitchWithValue(const std::string& switch_string, const std::wstring& value_string) { std::wstring value_string_edit; @@ -326,12 +326,12 @@ void CommandLine::AppendSwitchWithValue(const std::wstring& switch_string, } std::wstring combined_switch_string = - PrefixedSwitchStringWithValue(switch_string, value_string_edit); + PrefixedSwitchStringWithValue(switch_string, value_string_edit); command_line_string_.append(L" "); command_line_string_.append(combined_switch_string); - switches_[WideToASCII(switch_string)] = value_string; + switches_[switch_string] = value_string; } void CommandLine::AppendLooseValue(const std::wstring& value) { @@ -361,20 +361,18 @@ void CommandLine::PrependWrapper(const std::wstring& wrapper) { } #elif defined(OS_POSIX) -void CommandLine::AppendSwitch(const std::wstring& switch_string) { - std::string ascii_switch = WideToASCII(switch_string); - argv_.push_back(kSwitchPrefixes[0] + ascii_switch); - switches_[ascii_switch] = ""; +void CommandLine::AppendSwitch(const std::string& switch_string) { + argv_.push_back(kSwitchPrefixes[0] + switch_string); + switches_[switch_string] = ""; } -void CommandLine::AppendSwitchWithValue(const std::wstring& switch_string, +void CommandLine::AppendSwitchWithValue(const std::string& switch_string, const std::wstring& value_string) { - std::string ascii_switch = WideToASCII(switch_string); std::string mb_value = base::SysWideToNativeMB(value_string); - argv_.push_back(kSwitchPrefixes[0] + ascii_switch + + argv_.push_back(kSwitchPrefixes[0] + switch_string + kSwitchValueSeparator + mb_value); - switches_[ascii_switch] = mb_value; + switches_[switch_string] = mb_value; } void CommandLine::AppendLooseValue(const std::wstring& value) { diff --git a/base/command_line.h b/base/command_line.h index 4fd8e4a..78adb46 100644 --- a/base/command_line.h +++ b/base/command_line.h @@ -26,6 +26,7 @@ #include "base/basictypes.h" #include "base/file_path.h" #include "base/logging.h" +#include "base/string_util.h" class InProcessBrowserTest; @@ -88,12 +89,25 @@ class CommandLine { // Returns true if this command line contains the given switch. // (Switch names are case-insensitive.) - bool HasSwitch(const std::wstring& switch_string) const; + bool HasSwitch(const std::string& switch_string) const; + + // Deprecated version of the above. + bool HasSwitch(const std::wstring& switch_string) const { + return HasSwitch(WideToASCII(switch_string)); + } // Returns the value associated with the given switch. If the // switch has no value or isn't present, this method returns // the empty string. - std::wstring GetSwitchValue(const std::wstring& switch_string) const; + std::wstring GetSwitchValue(const std::string& switch_string) const; + std::string GetSwitchValueASCII(const std::string& switch_string) const { + return WideToASCII(GetSwitchValue(switch_string)); + } + + // Deprecated version of the above. + std::wstring GetSwitchValue(const std::wstring& switch_string) const { + return GetSwitchValue(WideToASCII(switch_string)); + } // Get the number of switches in this process. size_t GetSwitchCount() const { return switches_.size(); } @@ -125,22 +139,26 @@ class CommandLine { // Return a copy of the string prefixed with a switch prefix. // Used internally. - static std::wstring PrefixedSwitchString(const std::wstring& switch_string); + static std::wstring PrefixedSwitchString(const std::string& switch_string); // Return a copy of the string prefixed with a switch prefix, // and appended with the given value. Used internally. static std::wstring PrefixedSwitchStringWithValue( - const std::wstring& switch_string, + const std::string& switch_string, const std::wstring& value_string); // Appends the given switch string (preceded by a space and a switch // prefix) to the given string. - void AppendSwitch(const std::wstring& switch_string); + void AppendSwitch(const std::string& switch_string); // Appends the given switch string (preceded by a space and a switch // prefix) to the given string, with the given value attached. - void AppendSwitchWithValue(const std::wstring& switch_string, + void AppendSwitchWithValue(const std::string& switch_string, const std::wstring& value_string); + void AppendSwitchWithValue(const std::string& switch_string, + const std::string& value_string) { + AppendSwitchWithValue(switch_string, ASCIIToWide(value_string)); + } // Append a loose value to the command line. void AppendLooseValue(const std::wstring& value); diff --git a/base/command_line_unittest.cc b/base/command_line_unittest.cc index 0d89d10..bfd0a56 100644 --- a/base/command_line_unittest.cc +++ b/base/command_line_unittest.cc @@ -30,33 +30,33 @@ TEST(CommandLineTest, CommandLineConstructor) { "in the time of submarines..."}; CommandLine cl(arraysize(argv), argv); #endif - EXPECT_FALSE(cl.HasSwitch(L"cruller")); - EXPECT_FALSE(cl.HasSwitch(L"flim")); - EXPECT_FALSE(cl.HasSwitch(L"program")); - EXPECT_FALSE(cl.HasSwitch(L"dog")); - EXPECT_FALSE(cl.HasSwitch(L"cat")); - EXPECT_FALSE(cl.HasSwitch(L"output-rotation")); - EXPECT_FALSE(cl.HasSwitch(L"not-a-switch")); - EXPECT_FALSE(cl.HasSwitch(L"--")); + EXPECT_FALSE(cl.HasSwitch("cruller")); + EXPECT_FALSE(cl.HasSwitch("flim")); + EXPECT_FALSE(cl.HasSwitch("program")); + EXPECT_FALSE(cl.HasSwitch("dog")); + EXPECT_FALSE(cl.HasSwitch("cat")); + EXPECT_FALSE(cl.HasSwitch("output-rotation")); + EXPECT_FALSE(cl.HasSwitch("not-a-switch")); + EXPECT_FALSE(cl.HasSwitch("--")); EXPECT_EQ(L"program", cl.program()); - EXPECT_TRUE(cl.HasSwitch(L"foo")); - EXPECT_TRUE(cl.HasSwitch(L"bar")); - EXPECT_TRUE(cl.HasSwitch(L"baz")); - EXPECT_TRUE(cl.HasSwitch(L"spaetzle")); + EXPECT_TRUE(cl.HasSwitch("foo")); + EXPECT_TRUE(cl.HasSwitch("bar")); + EXPECT_TRUE(cl.HasSwitch("baz")); + EXPECT_TRUE(cl.HasSwitch("spaetzle")); #if defined(OS_WIN) - EXPECT_TRUE(cl.HasSwitch(L"SPAETZLE")); + EXPECT_TRUE(cl.HasSwitch("SPAETZLE")); #endif - EXPECT_TRUE(cl.HasSwitch(L"other-switches")); - EXPECT_TRUE(cl.HasSwitch(L"input-translation")); + EXPECT_TRUE(cl.HasSwitch("other-switches")); + EXPECT_TRUE(cl.HasSwitch("input-translation")); - EXPECT_EQ(L"Crepe", cl.GetSwitchValue(L"spaetzle")); - EXPECT_EQ(L"", cl.GetSwitchValue(L"Foo")); - EXPECT_EQ(L"", cl.GetSwitchValue(L"bar")); - EXPECT_EQ(L"", cl.GetSwitchValue(L"cruller")); - EXPECT_EQ(L"--dog=canine --cat=feline", cl.GetSwitchValue(L"other-switches")); - EXPECT_EQ(L"45--output-rotation", cl.GetSwitchValue(L"input-translation")); + EXPECT_EQ(L"Crepe", cl.GetSwitchValue("spaetzle")); + EXPECT_EQ(L"", cl.GetSwitchValue("Foo")); + EXPECT_EQ(L"", cl.GetSwitchValue("bar")); + EXPECT_EQ(L"", cl.GetSwitchValue("cruller")); + EXPECT_EQ(L"--dog=canine --cat=feline", cl.GetSwitchValue("other-switches")); + EXPECT_EQ(L"45--output-rotation", cl.GetSwitchValue("input-translation")); std::vector<std::wstring> loose_values = cl.GetLooseValues(); ASSERT_EQ(5U, loose_values.size()); @@ -97,12 +97,12 @@ TEST(CommandLineTest, EmptyString) { // Test methods for appending switches to a command line. TEST(CommandLineTest, AppendSwitches) { - std::wstring switch1 = L"switch1"; - std::wstring switch2 = L"switch2"; + std::string switch1 = "switch1"; + std::string switch2 = "switch2"; std::wstring value = L"value"; - std::wstring switch3 = L"switch3"; + std::string switch3 = "switch3"; std::wstring value3 = L"a value with spaces"; - std::wstring switch4 = L"switch4"; + std::string switch4 = "switch4"; std::wstring value4 = L"\"a value with quotes\""; #if defined(OS_WIN) diff --git a/base/debug_on_start.cc b/base/debug_on_start.cc index c7d4149..9011ca2 100644 --- a/base/debug_on_start.cc +++ b/base/debug_on_start.cc @@ -16,8 +16,12 @@ // The code is not that bright and will find things like ---argument or // /-/argument. // Note: command_line is non-destructively modified. -bool DebugOnStart::FindArgument(wchar_t* command_line, const wchar_t* argument) +bool DebugOnStart::FindArgument(wchar_t* command_line, const char* argument_c) { + wchar_t argument[50]; + for (int i = 0; argument_c[i]; ++i) + argument[i] = argument_c[i]; + int argument_len = lstrlen(argument); int command_line_len = lstrlen(command_line); while (command_line_len > argument_len) { diff --git a/base/debug_on_start.h b/base/debug_on_start.h index ab823cf..e31e7eb 100644 --- a/base/debug_on_start.h +++ b/base/debug_on_start.h @@ -31,7 +31,7 @@ class DebugOnStart { // Returns true if the 'argument' is present in the 'command_line'. It does // not use the CRT, only Kernel32 functions. - static bool FindArgument(wchar_t* command_line, const wchar_t* argument); + static bool FindArgument(wchar_t* command_line, const char* argument); }; // Set the function pointer to our function to look for a crash on start. The diff --git a/base/multiprocess_test.h b/base/multiprocess_test.h index 99c2c79..0662689 100644 --- a/base/multiprocess_test.h +++ b/base/multiprocess_test.h @@ -20,7 +20,7 @@ // Command line switch to invoke a child process rather than // to run the normal test suite. -static const wchar_t kRunClientProcess[] = L"client"; +static const char kRunClientProcess[] = "client"; // A MultiProcessTest is a test class which makes it easier to // write a test which requires code running out of process. diff --git a/base/test/perf_test_suite.h b/base/test/perf_test_suite.h index 7393544..eed3cfc 100644 --- a/base/test/perf_test_suite.h +++ b/base/test/perf_test_suite.h @@ -24,7 +24,7 @@ class PerfTestSuite : public TestSuite { // Initialize the perf timer log FilePath log_path; std::wstring log_file = - CommandLine::ForCurrentProcess()->GetSwitchValue(L"log-file"); + CommandLine::ForCurrentProcess()->GetSwitchValue("log-file"); if (log_file.empty()) { FilePath exe; PathService::Get(base::FILE_EXE, &exe); diff --git a/base/test/test_suite.h b/base/test/test_suite.h index 863721a..5fd1acc 100644 --- a/base/test/test_suite.h +++ b/base/test/test_suite.h @@ -210,7 +210,7 @@ class TestSuite { // In some cases, we do not want to see standard error dialogs. if (!IsDebuggerPresent() && - !CommandLine::ForCurrentProcess()->HasSwitch(L"show-error-dialogs")) { + !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { SuppressErrorDialogs(); #if !defined(PURIFY) // When the code in this file moved around, bug 6436 resurfaced. diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index ff9464a..4df3961 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -346,8 +346,8 @@ int ChromeMain(int argc, char** argv) { #endif const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - std::wstring process_type = - parsed_command_line.GetSwitchValue(switches::kProcessType); + std::string process_type = + parsed_command_line.GetSwitchValueASCII(switches::kProcessType); #if defined(OS_MACOSX) mac_util::SetOverrideAppBundlePath(chrome::GetFrameworkBundlePath()); @@ -361,8 +361,8 @@ int ChromeMain(int argc, char** argv) { #if defined(OS_LINUX) // Show the man page on --help or -h. - if (parsed_command_line.HasSwitch(L"help") || - parsed_command_line.HasSwitch(L"h")) { + if (parsed_command_line.HasSwitch("help") || + parsed_command_line.HasSwitch("h")) { FilePath binary(parsed_command_line.argv()[0]); int ret = execlp("man", "man", binary.BaseName().value().c_str(), NULL); LOG(FATAL) << "execlp failed: " << strerror(ret); diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc index 379df70..464ad0d 100644 --- a/chrome/browser/first_run_win.cc +++ b/chrome/browser/first_run_win.cc @@ -110,7 +110,7 @@ bool InvokeGoogleUpdateForRename() { return false; } -bool LaunchSetupWithParam(const std::wstring& param, const std::wstring& value, +bool LaunchSetupWithParam(const std::string& param, const std::wstring& value, int* ret_code) { FilePath exe_path; if (!PathService::Get(base::DIR_MODULE, &exe_path)) @@ -208,7 +208,7 @@ bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir, FilePath inner_html; if (WriteEULAtoTempFile(&inner_html)) { int retcode = 0; - const std::wstring& eula = installer_util::switches::kShowEula; + const std::string eula = WideToASCII(installer_util::switches::kShowEula); if (!LaunchSetupWithParam(eula, inner_html.ToWStringHack(), &retcode) || (retcode == installer_util::EULA_REJECTED)) { LOG(WARNING) << "EULA rejected. Fast exit."; diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc index 5f5bc5c..76ded96 100644 --- a/chrome/browser/gtk/browser_titlebar.cc +++ b/chrome/browser/gtk/browser_titlebar.cc @@ -305,7 +305,7 @@ void BrowserTitlebar::Init() { gtk_box_pack_start(GTK_BOX(titlebar_buttons_box_), buttons_hbox, FALSE, FALSE, 0); - if (CommandLine::ForCurrentProcess()->HasSwitch(L"glen")) { + if (CommandLine::ForCurrentProcess()->HasSwitch("glen")) { close_button_.reset(BuildTitlebarButton(IDR_GLEN, IDR_GLEN, IDR_GLEN, buttons_hbox, IDS_GLEN)); } else { diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index d44b336..bfea202 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -34,7 +34,7 @@ const char kTestChannelID[] = "T1"; bool LaunchNSSDecrypterChildProcess(const std::wstring& nss_path, const IPC::Channel& channel, base::ProcessHandle* handle) { CommandLine cl(*CommandLine::ForCurrentProcess()); - cl.AppendSwitchWithValue(L"client", L"NSSDecrypterChildProcess"); + cl.AppendSwitchWithValue("client", "NSSDecrypterChildProcess"); FilePath ff_dylib_dir = FilePath::FromWStringHack(nss_path); // Set env variable needed for FF encryption libs to load. diff --git a/chrome/browser/locale_tests_uitest.cc b/chrome/browser/locale_tests_uitest.cc index 808ecae..c403b6e 100644 --- a/chrome/browser/locale_tests_uitest.cc +++ b/chrome/browser/locale_tests_uitest.cc @@ -29,7 +29,7 @@ class LocaleTestsBase : public UITest { class LocaleTestsDa : public LocaleTestsBase { public: LocaleTestsDa() : LocaleTestsBase() { - launch_arguments_.AppendSwitchWithValue(L"lang", L"da"); + launch_arguments_.AppendSwitchWithValue("lang", "da"); // Linux doesn't use --lang, it only uses environment variables to set the // language. @@ -43,7 +43,7 @@ class LocaleTestsDa : public LocaleTestsBase { class LocaleTestsHe : public LocaleTestsBase { public: LocaleTestsHe() : LocaleTestsBase() { - launch_arguments_.AppendSwitchWithValue(L"lang", L"he"); + launch_arguments_.AppendSwitchWithValue("lang", "he"); #if defined(OS_LINUX) old_lc_all_ = getenv("LC_ALL"); setenv("LC_ALL", "he_IL.UTF-8", 1); @@ -54,7 +54,7 @@ class LocaleTestsHe : public LocaleTestsBase { class LocaleTestsZhTw : public LocaleTestsBase { public: LocaleTestsZhTw() : LocaleTestsBase() { - launch_arguments_.AppendSwitchWithValue(L"lang", L"zh-TW"); + launch_arguments_.AppendSwitchWithValue("lang", "zh-TW"); #if defined(OS_LINUX) old_lc_all_ = getenv("LC_ALL"); setenv("LC_ALL", "zh_TW.UTF-8", 1); diff --git a/chrome/browser/nacl_process_host.cc b/chrome/browser/nacl_process_host.cc index bb13ab7..22fb446 100644 --- a/chrome/browser/nacl_process_host.cc +++ b/chrome/browser/nacl_process_host.cc @@ -107,7 +107,7 @@ bool NaClProcessHost::LaunchSelLdr(ResourceMessageFilter* renderer_msg_filter, // propagate the following switches to the plugin command line (along with // any associated values) if present in the browser command line // TODO(gregoryd): check which flags of those below can be supported. - static const wchar_t* const switch_names[] = { + static const char* const switch_names[] = { switches::kNoSandbox, switches::kTestSandbox, switches::kDisableBreakpad, diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 2918b1f..6d6632c 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -30,7 +30,7 @@ net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line) { // Scan for all "enable" type proxy switches. - static const wchar_t* proxy_switches[] = { + static const char* proxy_switches[] = { switches::kProxyServer, switches::kProxyPacUrl, switches::kProxyAutoDetect, diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index a24885b..525e640 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -375,7 +375,7 @@ bool PluginProcessHost::Init(const WebPluginInfo& info, // Propagate the following switches to the plugin command line (along with // any associated values) if present in the browser command line - static const wchar_t* const switch_names[] = { + static const char* const switch_names[] = { switches::kPluginStartupDialog, switches::kNoSandbox, switches::kSafePlugins, diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc index 2eaba30..80093fe 100644 --- a/chrome/browser/printing/printing_layout_uitest.cc +++ b/chrome/browser/printing/printing_layout_uitest.cc @@ -21,7 +21,7 @@ namespace { using printing::Image; -const wchar_t* const kGenerateSwitch = L"print-layout-generate"; +const char kGenerateSwitch[] = "print-layout-generate"; const wchar_t kDocRoot[] = L"chrome/test/data"; class PrintingLayoutTest : public PrintingTest<UITest> { @@ -29,7 +29,7 @@ class PrintingLayoutTest : public PrintingTest<UITest> { PrintingLayoutTest() { emf_path_ = browser_directory_; emf_path_ = emf_path_.AppendASCII("metafile_dumps"); - launch_arguments_.AppendSwitchWithValue(L"debug-print", + launch_arguments_.AppendSwitchWithValue("debug-print", L'"' + emf_path_.value() + L'"'); show_window_ = true; } diff --git a/chrome/browser/process_singleton_linux_uitest.cc b/chrome/browser/process_singleton_linux_uitest.cc index 2e775f4..795a023 100644 --- a/chrome/browser/process_singleton_linux_uitest.cc +++ b/chrome/browser/process_singleton_linux_uitest.cc @@ -25,7 +25,6 @@ #include "chrome/test/ui/ui_test.h" #include "testing/gtest/include/gtest/gtest.h" - namespace { typedef UITest ProcessSingletonLinuxTest; diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 87c9713..c799d1a 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -93,10 +93,10 @@ void GetCacheParameters(ContextType type, FilePath* cache_path, *cache_path = FilePath::FromWStringHack(user_path); } - const wchar_t* arg = kNormalContext == type ? switches::kDiskCacheSize : - switches::kMediaCacheSize; + const char* arg = kNormalContext == type ? switches::kDiskCacheSize : + switches::kMediaCacheSize; std::string value = - WideToASCII(CommandLine::ForCurrentProcess()->GetSwitchValue(arg)); + CommandLine::ForCurrentProcess()->GetSwitchValueASCII(arg); // By default we let the cache determine the right size. *max_size = 0; diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index bd92c8f..b43b878 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -483,7 +483,7 @@ void BrowserRenderProcessHost::PropogateBrowserCommandLineToRenderer( CommandLine* renderer_cmd) const { // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. - static const wchar_t* const switch_names[] = { + static const char* const switch_names[] = { switches::kRendererAssertTest, switches::kRendererCrashTest, switches::kRendererStartupDialog, diff --git a/chrome/browser/sandbox_policy.cc b/chrome/browser/sandbox_policy.cc index ed61980..5c21a67 100644 --- a/chrome/browser/sandbox_policy.cc +++ b/chrome/browser/sandbox_policy.cc @@ -337,7 +337,7 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line, base::ProcessHandle process = 0; const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); ChildProcessInfo::ProcessType type; - std::wstring type_str = cmd_line->GetSwitchValue(switches::kProcessType); + std::string type_str = cmd_line->GetSwitchValueASCII(switches::kProcessType); if (type_str == switches::kRendererProcess) { type = ChildProcessInfo::RENDER_PROCESS; } else if (type_str == switches::kPluginProcess) { diff --git a/chrome/common/chrome_plugin_util.cc b/chrome/common/chrome_plugin_util.cc index 9258d98..809e4e6 100644 --- a/chrome/common/chrome_plugin_util.cc +++ b/chrome/common/chrome_plugin_util.cc @@ -132,7 +132,8 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url, // Make sure user_data_dir is an absolute path. if (file_util::AbsolutePath(&user_data_dir) && file_util::PathExists(user_data_dir)) { - arguments_w += std::wstring(L"--") + switches::kUserDataDir + + // TODO(evanm): use CommandLine APIs instead of this. + arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kUserDataDir) + L"=\"" + user_data_dir + L"\" "; } } @@ -146,7 +147,9 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url, ReplaceSubstringsAfterOffset(&url_string, 0, ";", ""); ReplaceSubstringsAfterOffset(&url_string, 0, "$", ""); std::wstring url_w = UTF8ToWide(url_string); - arguments_w += std::wstring(L"--") + switches::kApp + L"=\"" + url_w + L"\""; + // TODO(evanm): use CommandLine APIs instead of this. + arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kApp) + + L"=\"" + url_w + L"\""; *arguments = WideToUTF8(arguments_w); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 26ce6a4..6d3fb14 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -12,454 +12,454 @@ namespace switches { // base/base_switches.cc instead. // Suppresses hang monitor dialogs in renderer processes. -const wchar_t kDisableHangMonitor[] = L"disable-hang-monitor"; +const char kDisableHangMonitor[] = "disable-hang-monitor"; // Completely disables UMA metrics system. -const wchar_t kDisableMetrics[] = L"disable-metrics"; +const char kDisableMetrics[] = "disable-metrics"; // Enables the recording of metrics reports but disables reporting. // In contrast to kDisableMetrics, this executes all the code that a normal // client would use for reporting, except the report is dropped rather than sent // to the server. This is useful for finding issues in the metrics code during // UI and performance tests. -const wchar_t kMetricsRecordingOnly[] = L"metrics-recording-only"; +const char kMetricsRecordingOnly[] = "metrics-recording-only"; // Causes the browser process to throw an assertion on startup. -const wchar_t kBrowserAssertTest[] = L"assert-test"; +const char kBrowserAssertTest[] = "assert-test"; // Causes the renderer process to throw an assertion on launch. -const wchar_t kRendererAssertTest[] = L"renderer-assert-test"; +const char kRendererAssertTest[] = "renderer-assert-test"; // Causes the browser process to crash on startup. -const wchar_t kBrowserCrashTest[] = L"crash-test"; +const char kBrowserCrashTest[] = "crash-test"; // Causes the renderer process to crash on launch. -const wchar_t kRendererCrashTest[] = L"renderer-crash-test"; +const char kRendererCrashTest[] = "renderer-crash-test"; // Causes the renderer process to display a dialog on launch. -const wchar_t kRendererStartupDialog[] = L"renderer-startup-dialog"; +const char kRendererStartupDialog[] = "renderer-startup-dialog"; // Causes the plugin process to display a dialog on launch. -const wchar_t kPluginStartupDialog[] = L"plugin-startup-dialog"; +const char kPluginStartupDialog[] = "plugin-startup-dialog"; // Specifies a command that should be used to launch the plugin process. Useful // for running the plugin process through purify or quantify. Ex: // --plugin-launcher="path\to\purify /Run=yes" -const wchar_t kPluginLauncher[] = L"plugin-launcher"; +const char kPluginLauncher[] = "plugin-launcher"; // The value of this switch tells the app to listen for and broadcast // testing-related messages on IPC channel with the given ID. -const wchar_t kTestingChannelID[] = L"testing-channel"; +const char kTestingChannelID[] = "testing-channel"; // The value of this switch specifies which page will be displayed // in newly-opened tabs. We need this for testing purposes so // that the UI tests don't depend on what comes up for http://google.com. -const wchar_t kHomePage[] = L"homepage"; +const char kHomePage[] = "homepage"; // Causes the process to run as renderer instead of as browser. -const wchar_t kRendererProcess[] = L"renderer"; +const char kRendererProcess[] = "renderer"; // Causes the process to run as a renderer zygote. -const wchar_t kZygoteProcess[] = L"zygote"; +const char kZygoteProcess[] = "zygote"; // Path to the exe to run for the renderer and plugin subprocesses. -const wchar_t kBrowserSubprocessPath[] = L"browser-subprocess-path"; +const char kBrowserSubprocessPath[] = "browser-subprocess-path"; // Causes the process to run as a plugin subprocess. -const wchar_t kPluginProcess[] = L"plugin"; +const char kPluginProcess[] = "plugin"; // Causes the process to run as a worker subprocess. -const wchar_t kWorkerProcess[] = L"worker"; +const char kWorkerProcess[] = "worker"; // Causes the process to run as a NativeClient's sel_ldr subprocess. -const wchar_t kNaClProcess[] = L"nacl"; +const char kNaClProcess[] = "nacl"; // Causes the process to run as a utility subprocess. -const wchar_t kUtilityProcess[] = L"utility"; +const char kUtilityProcess[] = "utility"; // Causes the process to run as a profile import subprocess. -const wchar_t kProfileImportProcess[] = L"profile-import"; +const char kProfileImportProcess[] = "profile-import"; // Runs the renderer and plugins in the same process as the browser -const wchar_t kSingleProcess[] = L"single-process"; +const char kSingleProcess[] = "single-process"; // Runs each set of script-connected tabs (i.e., a BrowsingInstance) in its own // renderer process. We default to using a renderer process for each // site instance (i.e., group of pages from the same registered domain with // script connections to each other). -const wchar_t kProcessPerTab[] = L"process-per-tab"; +const char kProcessPerTab[] = "process-per-tab"; // Runs a single process for each site (i.e., group of pages from the same // registered domain) the user visits. We default to using a renderer process // for each site instance (i.e., group of pages from the same registered // domain with script connections to each other). -const wchar_t kProcessPerSite[] = L"process-per-site"; +const char kProcessPerSite[] = "process-per-site"; // Runs plugins inside the renderer process -const wchar_t kInProcessPlugins[] = L"in-process-plugins"; +const char kInProcessPlugins[] = "in-process-plugins"; // Runs the renderer outside the sandbox. -const wchar_t kNoSandbox[] = L"no-sandbox"; +const char kNoSandbox[] = "no-sandbox"; // Disables the alternate window station for the renderer. -const wchar_t kDisableAltWinstation[] = L"disable-winsta"; +const char kDisableAltWinstation[] = "disable-winsta"; // Runs the plugin processes inside the sandbox. -const wchar_t kSafePlugins[] = L"safe-plugins"; +const char kSafePlugins[] = "safe-plugins"; // Excludes these plugins from the plugin sandbox. // This is a comma-separated list of plugin library names. -const wchar_t kTrustedPlugins[] = L"trusted-plugins"; +const char kTrustedPlugins[] = "trusted-plugins"; // Runs the security test for the sandbox. -const wchar_t kTestSandbox[] = L"test-sandbox"; +const char kTestSandbox[] = "test-sandbox"; // Specifies the user data directory, which is where the browser will look // for all of its state. -const wchar_t kUserDataDir[] = L"user-data-dir"; +const char kUserDataDir[] = "user-data-dir"; // Specifies the plugin data directory, which is where plugins (Gears // specifically) will store its state. -const wchar_t kPluginDataDir[] = L"plugin-data-dir"; +const char kPluginDataDir[] = "plugin-data-dir"; // Use a specific disk cache location, rather than one derived from the // UserDatadir. -const wchar_t kDiskCacheDir[] = L"disk-cache-dir"; +const char kDiskCacheDir[] = "disk-cache-dir"; // Forces the maximum disk space to be used by the disk cache, in bytes. -const wchar_t kDiskCacheSize[] = L"disk-cache-size"; +const char kDiskCacheSize[] = "disk-cache-size"; // Forces the maximum disk space to be used by the media cache, in bytes. -const wchar_t kMediaCacheSize[] = L"media-cache-size"; +const char kMediaCacheSize[] = "media-cache-size"; // Whether the multiple profiles feature based on the user-data-dir flag is // enabled or not. -const wchar_t kEnableUserDataDirProfiles[] = L"enable-udd-profiles"; +const char kEnableUserDataDirProfiles[] = "enable-udd-profiles"; // Specifies the path to the user data folder for the parent profile. -const wchar_t kParentProfile[] = L"parent-profile"; +const char kParentProfile[] = "parent-profile"; // Specifies that the associated value should be launched in "application" mode. -const wchar_t kApp[] = L"app"; +const char kApp[] = "app"; // Specifies if the dom_automation_controller_ needs to be bound in the // renderer. This binding happens on per-frame basis and hence can potentially // be a performance bottleneck. One should only enable it when automating // dom based tests. -const wchar_t kDomAutomationController[] = L"dom-automation"; +const char kDomAutomationController[] = "dom-automation"; // Tells the plugin process the path of the plugin to load -const wchar_t kPluginPath[] = L"plugin-path"; +const char kPluginPath[] = "plugin-path"; // A string used to override the default user agent with a custom one. -const wchar_t kUserAgent[] = L"user-agent"; +const char kUserAgent[] = "user-agent"; // Specifies the flags passed to JS engine -const wchar_t kJavaScriptFlags[] = L"js-flags"; +const char kJavaScriptFlags[] = "js-flags"; // The Country we should use. This is normally obtained from the operating // system during first run and cached in the preferences afterwards. This is a // string value, the 2 letter code from ISO 3166-1. -const wchar_t kCountry[] = L"country"; +const char kCountry[] = "country"; // Will add kWaitForDebugger to every child processes. If a value is passed, it // will be used as a filter to determine if the child process should have the // kWaitForDebugger flag passed on or not. -const wchar_t kWaitForDebuggerChildren[] = L"wait-for-debugger-children"; +const char kWaitForDebuggerChildren[] = "wait-for-debugger-children"; // Will filter log messages to show only the messages that are prefixed // with the specified value -const wchar_t kLogFilterPrefix[] = L"log-filter-prefix"; +const char kLogFilterPrefix[] = "log-filter-prefix"; // Force logging to be enabled. Logging is disabled by default in release // builds. -const wchar_t kEnableLogging[] = L"enable-logging"; +const char kEnableLogging[] = "enable-logging"; // Force logging to be disabled. Logging is enabled by default in debug // builds. -const wchar_t kDisableLogging[] = L"disable-logging"; +const char kDisableLogging[] = "disable-logging"; // Sets the minimum log level. Valid values are from 0 to 3: // INFO = 0, WARNING = 1, LOG_ERROR = 2, LOG_FATAL = 3. -const wchar_t kLoggingLevel[] = L"log-level"; +const char kLoggingLevel[] = "log-level"; // Make plugin processes log their sent and received messages to LOG(INFO). -const wchar_t kLogPluginMessages[] = L"log-plugin-messages"; +const char kLogPluginMessages[] = "log-plugin-messages"; // Dump any accumualted histograms to the log when browser terminates (requires // logging to be enabled to really do anything). Used by developers and test // scripts. -const wchar_t kDumpHistogramsOnExit[] = L"dump-histograms-on-exit"; +const char kDumpHistogramsOnExit[] = "dump-histograms-on-exit"; // enable remote debug / automation shell on the specified port -const wchar_t kRemoteShellPort[] = L"remote-shell-port"; +const char kRemoteShellPort[] = "remote-shell-port"; // Runs un-installation steps that were done by chrome first-run. -const wchar_t kUninstall[] = L"uninstall"; +const char kUninstall[] = "uninstall"; // Number of entries to show in the omnibox popup. -const wchar_t kOmniBoxPopupCount[] = L"omnibox-popup-count"; +const char kOmniBoxPopupCount[] = "omnibox-popup-count"; // The value of this switch tells the app to listen for and broadcast // automation-related messages on IPC channel with the given ID. -const wchar_t kAutomationClientChannelID[] = L"automation-channel"; +const char kAutomationClientChannelID[] = "automation-channel"; // Indicates the last session should be restored on startup. This overrides // the preferences value and is primarily intended for testing. The value of // this switch is the number of tabs to wait until loaded before // 'load completed' is sent to the ui_test. -const wchar_t kRestoreLastSession[] = L"restore-last-session"; +const char kRestoreLastSession[] = "restore-last-session"; // Chrome supports a playback and record mode. Record mode saves *everything* // to the cache. Playback mode reads data exclusively from the cache. This // allows us to record a session into the cache and then replay it at will. -const wchar_t kRecordMode[] = L"record-mode"; -const wchar_t kPlaybackMode[] = L"playback-mode"; +const char kRecordMode[] = "record-mode"; +const char kPlaybackMode[] = "playback-mode"; // Don't record/playback events when using record & playback. -const wchar_t kNoEvents[] = L"no-events"; +const char kNoEvents[] = "no-events"; // Support a separate switch that enables the v8 playback extension. // The extension causes javascript calls to Date.now() and Math.random() // to return consistent values, such that subsequent loads of the same // page will result in consistent js-generated data and XHR requests. // Pages may still be able to generate inconsistent data from plugins. -const wchar_t kNoJsRandomness[] = L"no-js-randomness"; +const char kNoJsRandomness[] = "no-js-randomness"; // Make Windows happy by allowing it to show "Enable access to this program" // checkbox in Add/Remove Programs->Set Program Access and Defaults. This // only shows an error box because the only way to hide Chrome is by // uninstalling it. -const wchar_t kHideIcons[] = L"hide-icons"; +const char kHideIcons[] = "hide-icons"; -const wchar_t kShowIcons[] = L"show-icons"; +const char kShowIcons[] = "show-icons"; // Make Chrome default browser -const wchar_t kMakeDefaultBrowser[] = L"make-default-browser"; +const char kMakeDefaultBrowser[] = "make-default-browser"; // Use a specified proxy server, overrides system settings. This switch only // affects HTTP and HTTPS requests. -const wchar_t kProxyServer[] = L"proxy-server"; +const char kProxyServer[] = "proxy-server"; // Don't use a proxy server, always make direct connections. Overrides any // other proxy server flags that are passed. -const wchar_t kNoProxyServer[] = L"no-proxy-server"; +const char kNoProxyServer[] = "no-proxy-server"; // Specify a list of hosts for whom we bypass proxy settings and use direct // connections. Ignored if --proxy-auto-detect or --no-proxy-server are // also specified. // TODO(robertshield): Specify host format. -const wchar_t kProxyBypassList[] = L"proxy-bypass-list"; +const char kProxyBypassList[] = "proxy-bypass-list"; // Force proxy auto-detection. -const wchar_t kProxyAutoDetect[] = L"proxy-auto-detect"; +const char kProxyAutoDetect[] = "proxy-auto-detect"; // Use the pac script at the given URL -const wchar_t kProxyPacUrl[] = L"proxy-pac-url"; +const char kProxyPacUrl[] = "proxy-pac-url"; // Use WinHTTP to fetch and evaluate PAC scripts. Otherwise the default is // to use Chromium's network stack to fetch, and V8 to evaluate. -const wchar_t kWinHttpProxyResolver[] = L"winhttp-proxy-resolver"; +const char kWinHttpProxyResolver[] = "winhttp-proxy-resolver"; // Chrome will support prefetching of DNS information. Until this becomes // the default, we'll provide a command line switch. -extern const wchar_t kDnsLogDetails[] = L"dns-log-details"; -extern const wchar_t kDnsPrefetchDisable[] = L"dns-prefetch-disable"; +extern const char kDnsLogDetails[] = "dns-log-details"; +extern const char kDnsPrefetchDisable[] = "dns-prefetch-disable"; // Enables support to debug printing subsystem. -const wchar_t kDebugPrint[] = L"debug-print"; +const char kDebugPrint[] = "debug-print"; // Prints the pages on the screen. -const wchar_t kPrint[] = L"print"; +const char kPrint[] = "print"; // Browser flag to disable the web inspector for all renderers. -const wchar_t kDisableDevTools[] = L"disable-dev-tools"; +const char kDisableDevTools[] = "disable-dev-tools"; // Enable web inspector for all windows, even if they're part of the browser. // Allows us to use our dev tools to debug browser windows itself. -const wchar_t kAlwaysEnableDevTools[] = L"always-enable-dev-tools"; +const char kAlwaysEnableDevTools[] = "always-enable-dev-tools"; // Enable experimental timeline API. -const wchar_t kEnableExtensionTimelineApi[] = - L"enable-extension-timeline-api"; +const char kEnableExtensionTimelineApi[] = + "enable-extension-timeline-api"; // Used to set the value of SessionRestore::num_tabs_to_load_. See // session_restore.h for details. -const wchar_t kTabCountToLoadOnSessionRestore[]= - L"tab-count-to-load-on-session-restore"; +const char kTabCountToLoadOnSessionRestore[]= + "tab-count-to-load-on-session-restore"; // Enable dynamic loading of the Memory Profiler DLL, which will trace // all memory allocations during the run. -const wchar_t kMemoryProfiling[] = L"memory-profile"; +const char kMemoryProfiling[] = "memory-profile"; // Adds a "Purge memory" button to the Task Manager, which tries to dump as much // memory as possible. This is mostly useful for testing how well the // MemoryPurger functionality (which is normally triggered on Suspend) works. // // NOTE: This is only implemented for Views. -const wchar_t kPurgeMemoryButton[] = L"purge-memory-button"; +const char kPurgeMemoryButton[] = "purge-memory-button"; // By default, cookies are not allowed on file://. They are needed in for // testing, for example page cycler and layout tests. See bug 1157243. -const wchar_t kEnableFileCookies[] = L"enable-file-cookies"; +const char kEnableFileCookies[] = "enable-file-cookies"; // Start the browser maximized, regardless of any previous settings. -const wchar_t kStartMaximized[] = L"start-maximized"; +const char kStartMaximized[] = "start-maximized"; // Spawn threads to watch for excessive delays in specified message loops. // User should set breakpoints on Alarm() to examine problematic thread. // Usage: -enable-watchdog=[ui][io] // Order of the listed sub-arguments does not matter. -const wchar_t kEnableWatchdog[] = L"enable-watchdog"; +const char kEnableWatchdog[] = "enable-watchdog"; // Display the First Run experience when the browser is started, regardless of // whether or not it's actually the first run. -const wchar_t kFirstRun[] = L"first-run"; +const char kFirstRun[] = "first-run"; // Bypass the First Run experience when the browser is started, regardless of // whether or not it's actually the first run. Overrides kFirstRun in case // you're for some reason tempted to pass them both. -const wchar_t kNoFirstRun[] = L"no-first-run"; +const char kNoFirstRun[] = "no-first-run"; #if defined(OS_POSIX) // Bypass the error dialog when the profile lock couldn't be attained. // This switch is used during automated testing. -const wchar_t kNoProcessSingletonDialog[] = L"no-process-singleton-dialog"; +const char kNoProcessSingletonDialog[] = "no-process-singleton-dialog"; #endif // Enable histograming of tasks served by MessageLoop. See about:histograms/Loop // for results, which show frequency of messages on each thread, including APC // count, object signalling count, etc. -const wchar_t kMessageLoopHistogrammer[] = L"message-loop-histogrammer"; +const char kMessageLoopHistogrammer[] = "message-loop-histogrammer"; // Perform importing from another browser. The value associated with this // setting encodes the target browser and what items to import. -const wchar_t kImport[] = L"import"; +const char kImport[] = "import"; // Change the DCHECKS to dump memory and continue instead of displaying error // dialog. This is valid only in Release mode when --enable-dcheck is // specified. -const wchar_t kSilentDumpOnDCHECK[] = L"silent-dump-on-dcheck"; +const char kSilentDumpOnDCHECK[] = "silent-dump-on-dcheck"; // Normally when the user attempts to navigate to a page that was the result of // a post we prompt to make sure they want to. This switch may be used to // disable that check. This switch is used during automated testing. -const wchar_t kDisablePromptOnRepost[] = L"disable-prompt-on-repost"; +const char kDisablePromptOnRepost[] = "disable-prompt-on-repost"; // Disable pop-up blocking. -const wchar_t kDisablePopupBlocking[] = L"disable-popup-blocking"; +const char kDisablePopupBlocking[] = "disable-popup-blocking"; // Don't execute JavaScript (browser JS like the new tab page still runs). -const wchar_t kDisableJavaScript[] = L"disable-javascript"; +const char kDisableJavaScript[] = "disable-javascript"; // Don't enforce the same-origin policy. (Used by people testing their sites.) -const wchar_t kDisableWebSecurity[] = L"disable-web-security"; +const char kDisableWebSecurity[] = "disable-web-security"; // Prevent Java from running. -const wchar_t kDisableJava[] = L"disable-java"; +const char kDisableJava[] = "disable-java"; // Prevent plugins from running. -const wchar_t kDisablePlugins[] = L"disable-plugins"; +const char kDisablePlugins[] = "disable-plugins"; // Prevent images from loading. -const wchar_t kDisableImages[] = L"disable-images"; +const char kDisableImages[] = "disable-images"; // Enable remote web font support. SVG font should always work whether // this option is specified or not. -const wchar_t kEnableRemoteFonts[] = L"enable-remote-fonts"; +const char kEnableRemoteFonts[] = "enable-remote-fonts"; // Use the low fragmentation heap for the CRT. -const wchar_t kUseLowFragHeapCrt[] = L"use-lf-heap"; +const char kUseLowFragHeapCrt[] = "use-lf-heap"; // Runs the Native Client inside the renderer process. -const wchar_t kInternalNaCl[] = L"internal-nacl"; +const char kInternalNaCl[] = "internal-nacl"; #ifndef NDEBUG // Debug only switch to specify which gears plugin dll to load. -const wchar_t kGearsPluginPathOverride[] = L"gears-plugin-path"; +const char kGearsPluginPathOverride[] = "gears-plugin-path"; #endif // Enable the fastback page cache. -const wchar_t kEnableFastback[] = L"enable-fastback"; +const char kEnableFastback[] = "enable-fastback"; // Disable syncing bookmarks to a Google Account. -const wchar_t kDisableSync[] = L"disable-sync"; +const char kDisableSync[] = "disable-sync"; // Use the SyncerThread implementation that matches up with the old pthread // impl semantics, but using Chrome synchronization primitives. The only // difference between this and the default is that we now have no timeout on // Stop(). Should only use if you experience problems with the default. -const wchar_t kSyncerThreadTimedStop[] = L"syncer-thread-timed-stop"; +const char kSyncerThreadTimedStop[] = "syncer-thread-timed-stop"; // Enable support for SDCH filtering (dictionary based expansion of content). // Optional argument is *the* only domain name that will have SDCH suppport. // Default is "-enable-sdch" to advertise SDCH on all domains. // Sample usage with argument: "-enable-sdch=.google.com" // SDCH is currently only supported server-side for searches on google.com. -const wchar_t kSdchFilter[] = L"enable-sdch"; +const char kSdchFilter[] = "enable-sdch"; // Enable user script support. -const wchar_t kEnableUserScripts[] = L"enable-user-scripts"; +const char kEnableUserScripts[] = "enable-user-scripts"; // Disable extensions. -const wchar_t kDisableExtensions[] = L"disable-extensions"; +const char kDisableExtensions[] = "disable-extensions"; // Frequency in seconds for Extensions auto-update. -const wchar_t kExtensionsUpdateFrequency[] = L"extensions-update-frequency"; +const char kExtensionsUpdateFrequency[] = "extensions-update-frequency"; // Load an extension from the specified directory. -const wchar_t kLoadExtension[] = L"load-extension"; +const char kLoadExtension[] = "load-extension"; // Package an extension to a .crx installable file from a given directory. -const wchar_t kPackExtension[] = L"pack-extension"; +const char kPackExtension[] = "pack-extension"; // Optional PEM private key is to use in signing packaged .crx. -const wchar_t kPackExtensionKey[] = L"pack-extension-key"; +const char kPackExtensionKey[] = "pack-extension-key"; // Show extensions on top with toolbar. -const wchar_t kShowExtensionsOnTop[] = L"show-extensions-on-top"; +const char kShowExtensionsOnTop[] = "show-extensions-on-top"; // Load an NPAPI plugin from the specified path. -const wchar_t kLoadPlugin[] = L"load-plugin"; +const char kLoadPlugin[] = "load-plugin"; // directory to locate user scripts in as an over-ride of the default -const wchar_t kUserScriptsDir[] = L"user-scripts-dir"; +const char kUserScriptsDir[] = "user-scripts-dir"; // Causes the browser to launch directly in incognito mode. -const wchar_t kIncognito[] = L"incognito"; +const char kIncognito[] = "incognito"; // Turns on the accessibility in the renderer. Off by default until // http://b/issue?id=1432077 is fixed. -const wchar_t kEnableRendererAccessibility[] = - L"enable-renderer-accessibility"; +const char kEnableRendererAccessibility[] = + "enable-renderer-accessibility"; // Pass the name of the current running automated test to Chrome. -const wchar_t kTestName[] = L"test-name"; +const char kTestName[] = "test-name"; // On POSIX only: the contents of this flag are prepended to the renderer // command line. Useful values might be "valgrind" or "xterm -e gdb --args". -const wchar_t kRendererCmdPrefix[] = L"renderer-cmd-prefix"; +const char kRendererCmdPrefix[] = "renderer-cmd-prefix"; // On POSIX only: the contents of this flag are prepended to the utility // process command line. Useful values might be "valgrind" or "xterm -e gdb // --args". -const wchar_t kUtilityCmdPrefix[] = L"utility-cmd-prefix"; +const char kUtilityCmdPrefix[] = "utility-cmd-prefix"; // On Windows only: use the old WinInet-based ftp implemetation. -const wchar_t kWininetFtp[] = L"wininet-ftp"; +const char kWininetFtp[] = "wininet-ftp"; // Enable Native Web Worker support -const wchar_t kEnableNativeWebWorkers[] = L"enable-native-web-workers"; +const char kEnableNativeWebWorkers[] = "enable-native-web-workers"; // Causes the worker process allocation to use as many processes as cores. -const wchar_t kWebWorkerProcessPerCore[] = L"web-worker-process-per-core"; +const char kWebWorkerProcessPerCore[] = "web-worker-process-per-core"; // Causes workers to run together in one process, depending on their domains. // Note this is duplicated in webworkerclient_impl.cc -const wchar_t kWebWorkerShareProcesses[] = L"web-worker-share-processes"; +const char kWebWorkerShareProcesses[] = "web-worker-share-processes"; // Enables the bookmark menu. -const wchar_t kBookmarkMenu[] = L"bookmark-menu"; +const char kBookmarkMenu[] = "bookmark-menu"; // Enables experimental features for Spellchecker. Right now, the first // experimental feature is auto spell correct, which corrects words which are @@ -468,11 +468,11 @@ const wchar_t kBookmarkMenu[] = L"bookmark-menu"; // 1 - Allow multiple spellcheckers to work simultaneously. // 2 - Allow automatic detection of spell check language. // TODO(sidchat): Implement the above fetaures to work under this flag. -const wchar_t kExperimentalSpellcheckerFeatures[] = - L"experimental-spellchecker-features"; +const char kExperimentalSpellcheckerFeatures[] = + "experimental-spellchecker-features"; // Enables StatsTable, logging statistics to a global named shared memory table. -const wchar_t kEnableStatsTable[] = L"enable-stats-table"; +const char kEnableStatsTable[] = "enable-stats-table"; // Replaces the audio IPC layer for <audio> and <video> with a mock audio // device, useful when using remote desktop or machines without sound cards. @@ -480,14 +480,14 @@ const wchar_t kEnableStatsTable[] = L"enable-stats-table"; // // TODO(scherkus): remove --disable-audio when we have a proper fallback // mechanism. -const wchar_t kDisableAudio[] = L"disable-audio"; +const char kDisableAudio[] = "disable-audio"; // Replaces the buffered data source for <audio> and <video> with a simplified // resource loader that downloads the entire resource into memory. // // TODO(scherkus): remove --simple-data-source when our media resource loading // is cleaned up and playback testing completed. -const wchar_t kSimpleDataSource[] = L"simple-data-source"; +const char kSimpleDataSource[] = "simple-data-source"; // Some field tests may rendomized in the browser, and the randomly selected // outcome needs to be propogated to the renderer. For instance, this is used @@ -499,138 +499,137 @@ const wchar_t kSimpleDataSource[] = L"simple-data-source"; // persistent representation generated by field_trial.cc and later decoded, is a // list of name and value pairs, separated by slashes. See field trial.cc for // current details. -const wchar_t kForceFieldTestNameAndValue[] = L"force-fieldtest"; +const char kForceFieldTestNameAndValue[] = "force-fieldtest"; // Allows the new tab page resource to be loaded from a local HTML file. This // should be a path to the HTML file that you want to use for the new tab page. // It is used for manually testing new versions of the new tab page only, // performance will be poor. -const wchar_t kNewTabPage[] = L"new-tab-page"; +const char kNewTabPage[] = "new-tab-page"; // Enables the backend service for web resources, used in the new tab page for // loading tips and recommendations from a JSON feed. -const wchar_t kDisableWebResources[] = L"disable-web-resources"; +const char kDisableWebResources[] = "disable-web-resources"; // Whether we should prevent the new tab page from showing the first run // notification. -const wchar_t kDisableNewTabFirstRun[] = L"disable-new-tab-first-run"; +const char kDisableNewTabFirstRun[] = "disable-new-tab-first-run"; // Disables the default browser check. Useful for UI/browser tests where we want // to avoid having the default browser info-bar displayed. -const wchar_t kNoDefaultBrowserCheck[] = L"no-default-browser-check"; +const char kNoDefaultBrowserCheck[] = "no-default-browser-check"; // Enables the Privacy Blacklist with the specified data file. // The file contains data from all imported blacklists. -const wchar_t kPrivacyBlacklist[] = L"privacy-blacklist"; +const char kPrivacyBlacklist[] = "privacy-blacklist"; // Enables the benchmarking extensions. -const wchar_t kEnableBenchmarking[] = L"enable-benchmarking"; +const char kEnableBenchmarking[] = "enable-benchmarking"; // The prefix used when starting the zygote process. (i.e. 'gdb --args') -const wchar_t kZygoteCmdPrefix[] = L"zygote-cmd-prefix"; +const char kZygoteCmdPrefix[] = "zygote-cmd-prefix"; // Enables using ThumbnailStore instead of ThumbnailDatabase for setting and // getting thumbnails for the new tab page. -const wchar_t kThumbnailStore[] = L"thumbnail-store"; +const char kThumbnailStore[] = "thumbnail-store"; // Experimental. Shows a dialog asking the user to try chrome. This flag // is to be used only by the upgrade process. -const wchar_t kTryChromeAgain[] = L"try-chrome-again"; +const char kTryChromeAgain[] = "try-chrome-again"; // The file descriptor limit is set to the value of this switch, subject to the // OS hard limits. Useful for testing that file descriptor exhaustion is handled // gracefully. -const wchar_t kFileDescriptorLimit[] = L"file-descriptor-limit"; +const char kFileDescriptorLimit[] = "file-descriptor-limit"; // On Windows, converts the page to the currently-installed monitor profile. // This does NOT enable color management for images. The source is still assumed // to be sRGB. -const wchar_t kEnableMonitorProfile[] = L"enable-monitor-profile"; +const char kEnableMonitorProfile[] = "enable-monitor-profile"; // Disable WebKit's XSSAuditor. The XSSAuditor mitigates reflective XSS. -const wchar_t kDisableXSSAuditor[] = L"disable-xss-auditor"; +const char kDisableXSSAuditor[] = "disable-xss-auditor"; #if defined(OS_POSIX) // A flag, generated internally by Chrome for renderer and other helper process // command lines on Linux and Mac. It tells the helper process to enable crash // dumping and reporting, because helpers cannot access the profile or other // files needed to make this decision. -const wchar_t kEnableCrashReporter[] = L"enable-crash-reporter"; +const char kEnableCrashReporter[] = "enable-crash-reporter"; #endif // Enables the new Tabstrip on Windows. -const wchar_t kEnableTabtastic2[] = L"enable-tabtastic2"; +const char kEnableTabtastic2[] = "enable-tabtastic2"; // Number of tabs to pin on startup. This is not use if session restore is // enabled. -const wchar_t kPinnedTabCount[] = L"pinned-tab-count"; +const char kPinnedTabCount[] = "pinned-tab-count"; // Enables the showing of an info-bar instructing user they can search directly // from the omnibox. -const wchar_t kSearchInOmniboxHint[] = L"search-in-omnibox-hint"; +const char kSearchInOmniboxHint[] = "search-in-omnibox-hint"; // Enable local storage. Still buggy. -const wchar_t kEnableLocalStorage[] = L"enable-local-storage"; +const char kEnableLocalStorage[] = "enable-local-storage"; // Enable session storage. Still buggy. -const wchar_t kEnableSessionStorage[] = L"enable-session-storage"; +const char kEnableSessionStorage[] = "enable-session-storage"; // Allows debugging of sandboxed processes (see zygote_main_linux.cc). -const wchar_t kAllowSandboxDebugging[] = L"allow-sandbox-debugging"; +const char kAllowSandboxDebugging[] = "allow-sandbox-debugging"; #if defined(OS_MACOSX) // Cause the OS X sandbox write to syslog every time an access to a resource // is denied by the sandbox. -const wchar_t kEnableSandboxLogging[] = L"enable-sandbox-logging"; +const char kEnableSandboxLogging[] = "enable-sandbox-logging"; #endif // Enable the seccomp sandbox (Linux only) -const wchar_t kEnableSeccompSandbox[] = L"enable-seccomp-sandbox"; +const char kEnableSeccompSandbox[] = "enable-seccomp-sandbox"; // Triggers a pletora of diagnostic modes. -const wchar_t kDiagnostics[] = L"diagnostics"; +const char kDiagnostics[] = "diagnostics"; // Disables the custom JumpList on Windows 7. -const wchar_t kDisableCustomJumpList[] = L"disable-custom-jumplist"; +const char kDisableCustomJumpList[] = "disable-custom-jumplist"; // Enables HTML5 DB support. -const wchar_t kEnableDatabases[] = L"enable-databases"; +const char kEnableDatabases[] = "enable-databases"; // Enable ApplicationCache. Still mostly not there. -const wchar_t kEnableApplicationCache[] = L"enable-application-cache"; +const char kEnableApplicationCache[] = "enable-application-cache"; // Override the default server used for profile sync. -const wchar_t kSyncServiceURL[] = L"sync-url"; +const char kSyncServiceURL[] = "sync-url"; #if defined(OS_CHROMEOS) // The name of the pipe over which the Chrome OS login manager will send // single-sign-on cookies. -const wchar_t kCookiePipe[] = L"cookie-pipe"; +const char kCookiePipe[] = "cookie-pipe"; // Enable the redirection of viewable document requests to the Google // Document Viewer. -const wchar_t kEnableGView[] = L"enable-gview"; +const char kEnableGView[] = "enable-gview"; #endif // Enable experimental support for cached byte-ranges. -const wchar_t kEnableByteRangeSupport[] = L"enable-byte-range-support"; +const char kEnableByteRangeSupport[] = "enable-byte-range-support"; // Explicitly allow additional ports using a comma separated list of port // numbers. -const wchar_t kExplicitlyAllowedPorts[] = L"explicitly-allowed-ports"; +const char kExplicitlyAllowedPorts[] = "explicitly-allowed-ports"; // Activate (make foreground) myself on launch. Helpful when Chrome // is launched on the command line (e.g. by Selenium). Only needed on Mac. -const wchar_t kActivateOnLaunch[] = L"activate-on-launch"; +const char kActivateOnLaunch[] = "activate-on-launch"; // Enable experimental WebGL support. -const wchar_t kEnableExperimentalWebGL[] = L"enable-webgl"; +const char kEnableExperimentalWebGL[] = "enable-webgl"; // Enabled desktop notifications. -const wchar_t kEnableDesktopNotifications[] = - L"enable-desktop-notifications"; +const char kEnableDesktopNotifications[] = "enable-desktop-notifications"; // Enable Web Sockets support. -const wchar_t kEnableWebSockets[] = L"enable-web-sockets"; +const char kEnableWebSockets[] = "enable-web-sockets"; } // namespace switches diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 85fa7be..8c9ed0b 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -12,248 +12,248 @@ namespace switches { -extern const wchar_t kDisableHangMonitor[]; -extern const wchar_t kDisableMetrics[]; -extern const wchar_t kMetricsRecordingOnly[]; -extern const wchar_t kBrowserAssertTest[]; -extern const wchar_t kRendererAssertTest[]; -extern const wchar_t kBrowserCrashTest[]; -extern const wchar_t kRendererCrashTest[]; -extern const wchar_t kRendererStartupDialog[]; -extern const wchar_t kPluginStartupDialog[]; -extern const wchar_t kPluginLauncher[]; - -extern const wchar_t kTestingChannelID[]; -extern const wchar_t kHomePage[]; -extern const wchar_t kRendererProcess[]; -extern const wchar_t kZygoteProcess[]; -extern const wchar_t kBrowserSubprocessPath[]; -extern const wchar_t kPluginProcess[]; -extern const wchar_t kWorkerProcess[]; -extern const wchar_t kNaClProcess[]; -extern const wchar_t kUtilityProcess[]; -extern const wchar_t kProfileImportProcess[]; -extern const wchar_t kSingleProcess[]; -extern const wchar_t kProcessPerTab[]; -extern const wchar_t kProcessPerSite[]; -extern const wchar_t kInProcessPlugins[]; -extern const wchar_t kNoSandbox[]; -extern const wchar_t kDisableAltWinstation[]; -extern const wchar_t kSafePlugins[]; -extern const wchar_t kTrustedPlugins[]; -extern const wchar_t kTestSandbox[]; -extern const wchar_t kUserDataDir[]; -extern const wchar_t kPluginDataDir[]; -extern const wchar_t kDiskCacheDir[]; -extern const wchar_t kDiskCacheSize[]; -extern const wchar_t kMediaCacheSize[]; -extern const wchar_t kEnableUserDataDirProfiles[]; -extern const wchar_t kParentProfile[]; -extern const wchar_t kApp[]; -extern const wchar_t kDomAutomationController[]; -extern const wchar_t kPluginPath[]; -extern const wchar_t kUserAgent[]; -extern const wchar_t kJavaScriptFlags[]; -extern const wchar_t kCountry[]; -extern const wchar_t kWaitForDebuggerChildren[]; - -extern const wchar_t kLogFilterPrefix[]; -extern const wchar_t kEnableLogging[]; -extern const wchar_t kLoggingLevel[]; -extern const wchar_t kLogPluginMessages[]; - -extern const wchar_t kDumpHistogramsOnExit[]; -extern const wchar_t kDisableLogging[]; -extern const wchar_t kRemoteShellPort[]; -extern const wchar_t kUninstall[]; -extern const wchar_t kOmniBoxPopupCount[]; - -extern const wchar_t kAutomationClientChannelID[]; - -extern const wchar_t kRestoreLastSession[]; - -extern const wchar_t kRecordMode[]; -extern const wchar_t kPlaybackMode[]; -extern const wchar_t kNoEvents[]; -extern const wchar_t kNoJsRandomness[]; - -extern const wchar_t kHideIcons[]; -extern const wchar_t kShowIcons[]; -extern const wchar_t kMakeDefaultBrowser[]; - -extern const wchar_t kProxyServer[]; -extern const wchar_t kNoProxyServer[]; -extern const wchar_t kProxyBypassList[]; -extern const wchar_t kProxyAutoDetect[]; -extern const wchar_t kProxyPacUrl[]; -extern const wchar_t kWinHttpProxyResolver[]; -extern const wchar_t kDebugPrint[]; -extern const wchar_t kPrint[]; - -extern const wchar_t kDnsLogDetails[]; -extern const wchar_t kDnsPrefetchDisable[]; - -extern const wchar_t kDisableDevTools[]; -extern const wchar_t kAlwaysEnableDevTools[]; -extern const wchar_t kEnableExtensionTimelineApi[]; - -extern const wchar_t kTabCountToLoadOnSessionRestore[]; - -extern const wchar_t kMemoryProfiling[]; -extern const wchar_t kPurgeMemoryButton[]; - -extern const wchar_t kEnableFileCookies[]; - -extern const wchar_t kStartMaximized[]; - -extern const wchar_t kEnableWatchdog[]; - -extern const wchar_t kFirstRun[]; - -extern const wchar_t kNoFirstRun[]; +extern const char kDisableHangMonitor[]; +extern const char kDisableMetrics[]; +extern const char kMetricsRecordingOnly[]; +extern const char kBrowserAssertTest[]; +extern const char kRendererAssertTest[]; +extern const char kBrowserCrashTest[]; +extern const char kRendererCrashTest[]; +extern const char kRendererStartupDialog[]; +extern const char kPluginStartupDialog[]; +extern const char kPluginLauncher[]; + +extern const char kTestingChannelID[]; +extern const char kHomePage[]; +extern const char kRendererProcess[]; +extern const char kZygoteProcess[]; +extern const char kBrowserSubprocessPath[]; +extern const char kPluginProcess[]; +extern const char kWorkerProcess[]; +extern const char kNaClProcess[]; +extern const char kUtilityProcess[]; +extern const char kProfileImportProcess[]; +extern const char kSingleProcess[]; +extern const char kProcessPerTab[]; +extern const char kProcessPerSite[]; +extern const char kInProcessPlugins[]; +extern const char kNoSandbox[]; +extern const char kDisableAltWinstation[]; +extern const char kSafePlugins[]; +extern const char kTrustedPlugins[]; +extern const char kTestSandbox[]; +extern const char kUserDataDir[]; +extern const char kPluginDataDir[]; +extern const char kDiskCacheDir[]; +extern const char kDiskCacheSize[]; +extern const char kMediaCacheSize[]; +extern const char kEnableUserDataDirProfiles[]; +extern const char kParentProfile[]; +extern const char kApp[]; +extern const char kDomAutomationController[]; +extern const char kPluginPath[]; +extern const char kUserAgent[]; +extern const char kJavaScriptFlags[]; +extern const char kCountry[]; +extern const char kWaitForDebuggerChildren[]; + +extern const char kLogFilterPrefix[]; +extern const char kEnableLogging[]; +extern const char kLoggingLevel[]; +extern const char kLogPluginMessages[]; + +extern const char kDumpHistogramsOnExit[]; +extern const char kDisableLogging[]; +extern const char kRemoteShellPort[]; +extern const char kUninstall[]; +extern const char kOmniBoxPopupCount[]; + +extern const char kAutomationClientChannelID[]; + +extern const char kRestoreLastSession[]; + +extern const char kRecordMode[]; +extern const char kPlaybackMode[]; +extern const char kNoEvents[]; +extern const char kNoJsRandomness[]; + +extern const char kHideIcons[]; +extern const char kShowIcons[]; +extern const char kMakeDefaultBrowser[]; + +extern const char kProxyServer[]; +extern const char kNoProxyServer[]; +extern const char kProxyBypassList[]; +extern const char kProxyAutoDetect[]; +extern const char kProxyPacUrl[]; +extern const char kWinHttpProxyResolver[]; +extern const char kDebugPrint[]; +extern const char kPrint[]; + +extern const char kDnsLogDetails[]; +extern const char kDnsPrefetchDisable[]; + +extern const char kDisableDevTools[]; +extern const char kAlwaysEnableDevTools[]; +extern const char kEnableExtensionTimelineApi[]; + +extern const char kTabCountToLoadOnSessionRestore[]; + +extern const char kMemoryProfiling[]; +extern const char kPurgeMemoryButton[]; + +extern const char kEnableFileCookies[]; + +extern const char kStartMaximized[]; + +extern const char kEnableWatchdog[]; + +extern const char kFirstRun[]; + +extern const char kNoFirstRun[]; #if defined(OS_POSIX) -extern const wchar_t kNoProcessSingletonDialog[]; +extern const char kNoProcessSingletonDialog[]; #endif -extern const wchar_t kMessageLoopHistogrammer[]; +extern const char kMessageLoopHistogrammer[]; -extern const wchar_t kImport[]; +extern const char kImport[]; -extern const wchar_t kSilentDumpOnDCHECK[]; +extern const char kSilentDumpOnDCHECK[]; -extern const wchar_t kDisablePromptOnRepost[]; +extern const char kDisablePromptOnRepost[]; -extern const wchar_t kDisablePopupBlocking[]; -extern const wchar_t kDisableJavaScript[]; -extern const wchar_t kDisableJava[]; -extern const wchar_t kDisablePlugins[]; -extern const wchar_t kDisableImages[]; -extern const wchar_t kDisableWebSecurity[]; -extern const wchar_t kEnableRemoteFonts[]; +extern const char kDisablePopupBlocking[]; +extern const char kDisableJavaScript[]; +extern const char kDisableJava[]; +extern const char kDisablePlugins[]; +extern const char kDisableImages[]; +extern const char kDisableWebSecurity[]; +extern const char kEnableRemoteFonts[]; -extern const wchar_t kUseLowFragHeapCrt[]; +extern const char kUseLowFragHeapCrt[]; -extern const wchar_t kInternalNaCl[]; +extern const char kInternalNaCl[]; #ifndef NDEBUG -extern const wchar_t kGearsPluginPathOverride[]; +extern const char kGearsPluginPathOverride[]; #endif -extern const wchar_t kEnableFastback[]; +extern const char kEnableFastback[]; -extern const wchar_t kDisableSync[]; -extern const wchar_t kSyncerThreadTimedStop[]; +extern const char kDisableSync[]; +extern const char kSyncerThreadTimedStop[]; -extern const wchar_t kSdchFilter[]; +extern const char kSdchFilter[]; -extern const wchar_t kEnableUserScripts[]; -extern const wchar_t kDisableExtensions[]; -extern const wchar_t kExtensionsUpdateFrequency[]; -extern const wchar_t kLoadExtension[]; -extern const wchar_t kPackExtension[]; -extern const wchar_t kPackExtensionKey[]; -extern const wchar_t kShowExtensionsOnTop[]; -extern const wchar_t kLoadPlugin[]; -extern const wchar_t kUserScriptsDir[]; +extern const char kEnableUserScripts[]; +extern const char kDisableExtensions[]; +extern const char kExtensionsUpdateFrequency[]; +extern const char kLoadExtension[]; +extern const char kPackExtension[]; +extern const char kPackExtensionKey[]; +extern const char kShowExtensionsOnTop[]; +extern const char kLoadPlugin[]; +extern const char kUserScriptsDir[]; -extern const wchar_t kIncognito[]; +extern const char kIncognito[]; -extern const wchar_t kEnableRendererAccessibility[]; +extern const char kEnableRendererAccessibility[]; -extern const wchar_t kTestName[]; +extern const char kTestName[]; -extern const wchar_t kRendererCmdPrefix[]; +extern const char kRendererCmdPrefix[]; -extern const wchar_t kUtilityCmdPrefix[]; +extern const char kUtilityCmdPrefix[]; -extern const wchar_t kWininetFtp[]; +extern const char kWininetFtp[]; -extern const wchar_t kEnableNativeWebWorkers[]; -extern const wchar_t kWebWorkerProcessPerCore[]; -extern const wchar_t kWebWorkerShareProcesses[]; +extern const char kEnableNativeWebWorkers[]; +extern const char kWebWorkerProcessPerCore[]; +extern const char kWebWorkerShareProcesses[]; -extern const wchar_t kBookmarkMenu[]; +extern const char kBookmarkMenu[]; -extern const wchar_t kEnableStatsTable[]; +extern const char kEnableStatsTable[]; -extern const wchar_t kExperimentalSpellcheckerFeatures[]; +extern const char kExperimentalSpellcheckerFeatures[]; -extern const wchar_t kDisableAudio[]; -extern const wchar_t kSimpleDataSource[]; +extern const char kDisableAudio[]; +extern const char kSimpleDataSource[]; -extern const wchar_t kForceFieldTestNameAndValue[]; +extern const char kForceFieldTestNameAndValue[]; -extern const wchar_t kNewTabPage[]; -extern const wchar_t kDisableNewTabFirstRun[]; +extern const char kNewTabPage[]; +extern const char kDisableNewTabFirstRun[]; -extern const wchar_t kDisableWebResources[]; +extern const char kDisableWebResources[]; -extern const wchar_t kEnableBenchmarking[]; +extern const char kEnableBenchmarking[]; -extern const wchar_t kNoDefaultBrowserCheck[]; +extern const char kNoDefaultBrowserCheck[]; -extern const wchar_t kPrivacyBlacklist[]; +extern const char kPrivacyBlacklist[]; -extern const wchar_t kZygoteCmdPrefix[]; +extern const char kZygoteCmdPrefix[]; -extern const wchar_t kThumbnailStore[]; +extern const char kThumbnailStore[]; -extern const wchar_t kTryChromeAgain[]; +extern const char kTryChromeAgain[]; -extern const wchar_t kFileDescriptorLimit[]; +extern const char kFileDescriptorLimit[]; -extern const wchar_t kEnableMonitorProfile[]; +extern const char kEnableMonitorProfile[]; -extern const wchar_t kDisableXSSAuditor[]; +extern const char kDisableXSSAuditor[]; #if defined(OS_POSIX) -extern const wchar_t kEnableCrashReporter[]; +extern const char kEnableCrashReporter[]; #endif -extern const wchar_t kEnableTabtastic2[]; +extern const char kEnableTabtastic2[]; -extern const wchar_t kPinnedTabCount[]; +extern const char kPinnedTabCount[]; -extern const wchar_t kSearchInOmniboxHint[]; +extern const char kSearchInOmniboxHint[]; -extern const wchar_t kEnableLocalStorage[]; +extern const char kEnableLocalStorage[]; -extern const wchar_t kEnableSessionStorage[]; +extern const char kEnableSessionStorage[]; -extern const wchar_t kAllowSandboxDebugging[]; +extern const char kAllowSandboxDebugging[]; #if defined(OS_MACOSX) -extern const wchar_t kEnableSandboxLogging[]; +extern const char kEnableSandboxLogging[]; #endif -extern const wchar_t kEnableSeccompSandbox[]; +extern const char kEnableSeccompSandbox[]; -extern const wchar_t kDiagnostics[]; +extern const char kDiagnostics[]; -extern const wchar_t kDisableCustomJumpList[]; +extern const char kDisableCustomJumpList[]; -extern const wchar_t kEnableDatabases[]; +extern const char kEnableDatabases[]; -extern const wchar_t kEnableApplicationCache[]; +extern const char kEnableApplicationCache[]; -extern const wchar_t kSyncServiceURL[]; +extern const char kSyncServiceURL[]; #if defined(OS_CHROMEOS) -extern const wchar_t kCookiePipe[]; -extern const wchar_t kEnableGView[]; +extern const char kCookiePipe[]; +extern const char kEnableGView[]; #endif -extern const wchar_t kEnableByteRangeSupport[]; +extern const char kEnableByteRangeSupport[]; -extern const wchar_t kExplicitlyAllowedPorts[]; +extern const char kExplicitlyAllowedPorts[]; -extern const wchar_t kActivateOnLaunch[]; -extern const wchar_t kEnableWebSockets[]; +extern const char kActivateOnLaunch[]; +extern const char kEnableWebSockets[]; -extern const wchar_t kEnableExperimentalWebGL[]; +extern const char kEnableExperimentalWebGL[]; -extern const wchar_t kEnableDesktopNotifications[]; +extern const char kEnableDesktopNotifications[]; } // namespace switches diff --git a/chrome/common/debug_flags.cc b/chrome/common/debug_flags.cc index 5e0b43e..4924f19 100644 --- a/chrome/common/debug_flags.cc +++ b/chrome/common/debug_flags.cc @@ -6,6 +6,7 @@ #include "base/base_switches.h" #include "base/command_line.h" +#include "base/utf_string_conversions.h" #include "chrome/common/chrome_switches.h" #include "ipc/ipc_switches.h" @@ -16,8 +17,8 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line, const CommandLine& current_cmd_line = *CommandLine::ForCurrentProcess(); if (current_cmd_line.HasSwitch(switches::kDebugChildren)) { // Look to pass-on the kDebugOnStart flag. - std::wstring value; - value = current_cmd_line.GetSwitchValue(switches::kDebugChildren); + std::string value = current_cmd_line.GetSwitchValueASCII( + switches::kDebugChildren); if (value.empty() || (type == ChildProcessInfo::RENDER_PROCESS && value == switches::kRendererProcess) || @@ -29,8 +30,8 @@ bool DebugFlags::ProcessDebugFlags(CommandLine* command_line, command_line->AppendSwitchWithValue(switches::kDebugChildren, value); } else if (current_cmd_line.HasSwitch(switches::kWaitForDebuggerChildren)) { // Look to pass-on the kWaitForDebugger flag. - std::wstring value; - value = current_cmd_line.GetSwitchValue(switches::kWaitForDebuggerChildren); + std::string value = current_cmd_line.GetSwitchValueASCII( + switches::kWaitForDebuggerChildren); if (value.empty() || (type == ChildProcessInfo::RENDER_PROCESS && value == switches::kRendererProcess) || diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index ae0b48e..3236468 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -100,12 +100,12 @@ void InitChromeLogging(const CommandLine& command_line, // only use OutputDebugString in debug mode #ifdef NDEBUG bool enable_logging = false; - const wchar_t *kInvertLoggingSwitch = switches::kEnableLogging; + const char *kInvertLoggingSwitch = switches::kEnableLogging; const logging::LoggingDestination kDefaultLoggingMode = logging::LOG_ONLY_TO_FILE; #else bool enable_logging = true; - const wchar_t *kInvertLoggingSwitch = switches::kDisableLogging; + const char *kInvertLoggingSwitch = switches::kDisableLogging; const logging::LoggingDestination kDefaultLoggingMode = logging::LOG_TO_BOTH_FILE_AND_SYSTEM_DEBUG_LOG; #endif diff --git a/chrome/common/sandbox_init_wrapper.cc b/chrome/common/sandbox_init_wrapper.cc index 14006ed..31488f7 100644 --- a/chrome/common/sandbox_init_wrapper.cc +++ b/chrome/common/sandbox_init_wrapper.cc @@ -19,7 +19,7 @@ void SandboxInitWrapper::SetServices(sandbox::SandboxInterfaceInfo* info) { #endif void SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line, - const std::wstring& process_type) { + const std::string& process_type) { #if defined(OS_WIN) if (!target_services_) return; diff --git a/chrome/common/sandbox_init_wrapper.h b/chrome/common/sandbox_init_wrapper.h index c8893a3..a1c2de9 100644 --- a/chrome/common/sandbox_init_wrapper.h +++ b/chrome/common/sandbox_init_wrapper.h @@ -34,7 +34,7 @@ class SandboxInitWrapper { // Initialize the sandbox for renderer and plug-in processes, depending on // the command line flags. The browser process is not sandboxed. void InitializeSandbox(const CommandLine& parsed_command_line, - const std::wstring& process_type); + const std::string& process_type); private: sandbox::BrokerServices* broker_services_; sandbox::TargetServices* target_services_; @@ -51,14 +51,14 @@ class SandboxInitWrapper { // Initialize the sandbox for renderer and plug-in processes, depending on // the command line flags. The browser process is not sandboxed. void InitializeSandbox(const CommandLine& parsed_command_line, - const std::wstring& process_type); + const std::string& process_type); #if defined(OS_MACOSX) // We keep the process type so we can configure the sandbox as needed. public: - std::wstring ProcessType() const { return process_type_; } + std::string ProcessType() const { return process_type_; } private: - std::wstring process_type_; + std::string process_type_; #endif private: diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index bed5b83..3dd8699 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc @@ -106,7 +106,8 @@ int GetDirectoryWriteAgeInHours(const wchar_t* path) { // Does not wait for the process to terminate. bool RelaunchSetup(const std::wstring& flag, int value) { CommandLine cmd_line(CommandLine::ForCurrentProcess()->program()); - cmd_line.AppendSwitchWithValue(flag, IntToWString(value)); + // TODO: make switches into ASCII. + cmd_line.AppendSwitchWithValue(WideToASCII(flag), IntToWString(value)); return base::LaunchApp(cmd_line, false, false, NULL); } diff --git a/chrome/installer/util/logging_installer.cc b/chrome/installer/util/logging_installer.cc index 25dceb2..02c0d9d 100644 --- a/chrome/installer/util/logging_installer.cc +++ b/chrome/installer/util/logging_installer.cc @@ -22,7 +22,8 @@ void InitInstallerLogging(const CommandLine& command_line) { if (installer_logging_) return; - if (command_line.HasSwitch(installer_util::switches::kDisableLogging)) { + if (command_line.HasSwitch( + WideToASCII(installer_util::switches::kDisableLogging))) { installer_logging_ = true; return; } @@ -32,7 +33,8 @@ void InitInstallerLogging(const CommandLine& command_line) { logging::LOCK_LOG_FILE, logging::DELETE_OLD_LOG_FILE); - if (command_line.HasSwitch(installer_util::switches::kVerboseLogging)) { + if (command_line.HasSwitch( + WideToASCII(installer_util::switches::kVerboseLogging))) { logging::SetMinLogLevel(logging::LOG_INFO); } else { logging::SetMinLogLevel(logging::LOG_ERROR); @@ -48,8 +50,10 @@ void EndInstallerLogging() { } std::wstring GetLogFilePath(const CommandLine& command_line) { - if (command_line.HasSwitch(installer_util::switches::kLogFile)) { - return command_line.GetSwitchValue(installer_util::switches::kLogFile); + if (command_line.HasSwitch( + WideToASCII(installer_util::switches::kLogFile))) { + return command_line.GetSwitchValue( + WideToASCII(installer_util::switches::kLogFile)); } const std::wstring log_filename(L"chrome_installer.log"); diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index c4705a8..86e588b 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -81,12 +81,13 @@ class RegistryEntry { start_menu_entry + ShellUtil::kRegDefaultIcon, icon_path)); std::wstring install_info(start_menu_entry + L"\\InstallInfo"); + // TODO: use CommandLine API instead of constructing command lines. entries->push_front(new RegistryEntry(install_info, L"ReinstallCommand", - quoted_exe_path + L" --" + switches::kMakeDefaultBrowser)); + quoted_exe_path + L" --" + ASCIIToWide(switches::kMakeDefaultBrowser))); entries->push_front(new RegistryEntry(install_info, L"HideIconsCommand", - quoted_exe_path + L" --" + switches::kHideIcons)); + quoted_exe_path + L" --" + ASCIIToWide(switches::kHideIcons))); entries->push_front(new RegistryEntry(install_info, L"ShowIconsCommand", - quoted_exe_path + L" --" + switches::kShowIcons)); + quoted_exe_path + L" --" + ASCIIToWide(switches::kShowIcons))); entries->push_front(new RegistryEntry(install_info, L"IconsVisible", 1)); std::wstring capabilities(start_menu_entry + L"\\Capabilities"); @@ -286,7 +287,7 @@ bool IsChromeRegistered(const std::wstring& chrome_exe, return registered; } -// This method registers Chrome on Vista by launching eleavated setup.exe. +// This method registers Chrome on Vista by launching eleavated setup.exe. // That will show user standard Vista elevation prompt. If user accepts it // the new process will make the necessary changes and return SUCCESS that // we capture and return. diff --git a/chrome/test/automated_ui_tests/automated_ui_tests.cc b/chrome/test/automated_ui_tests/automated_ui_tests.cc index 5c5ce9b..b4c8c29 100644 --- a/chrome/test/automated_ui_tests/automated_ui_tests.cc +++ b/chrome/test/automated_ui_tests/automated_ui_tests.cc @@ -36,17 +36,17 @@ namespace { -const wchar_t* const kReproSwitch = L"key"; +const char kReproSwitch[] = "key"; -const wchar_t* const kReproRepeatSwitch = L"num-reproductions"; +const char kReproRepeatSwitch[] = "num-reproductions"; -const wchar_t* const kInputFilePathSwitch = L"input"; +const char kInputFilePathSwitch[] = "input"; -const wchar_t* const kOutputFilePathSwitch = L"output"; +const char kOutputFilePathSwitch[] = "output"; -const wchar_t* const kDebugModeSwitch = L"debug"; +const char kDebugModeSwitch[] = "debug"; -const wchar_t* const kWaitSwitch = L"wait-after-action"; +const char kWaitSwitch[] = "wait-after-action"; const FilePath::CharType* const kDefaultInputFilePath = #if defined(OS_WIN) diff --git a/chrome/test/mini_installer_test/run_all_unittests.cc b/chrome/test/mini_installer_test/run_all_unittests.cc index 7b982c6..767ead2 100644 --- a/chrome/test/mini_installer_test/run_all_unittests.cc +++ b/chrome/test/mini_installer_test/run_all_unittests.cc @@ -42,10 +42,10 @@ int main(int argc, char** argv) { // with cleaning the system or make a backup before continuing. CommandLine::Init(argc, argv); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - if (command_line.HasSwitch(L"clean")) { + if (command_line.HasSwitch("clean")) { printf("Current version of Chrome will be uninstalled " "from all levels before proceeding with tests.\n"); - } else if (command_line.HasSwitch(L"backup")) { + } else if (command_line.HasSwitch("backup")) { BackUpProfile(); } else { printf("This test needs command line Arguments.\n"); diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index 35ff013..250b51e 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -66,20 +66,20 @@ namespace { // See comments at the beginning of the file for the definition of switches. -const wchar_t kSiteSwitch[] = L"site"; -const wchar_t kStartPageSwitch[] = L"startpage"; -const wchar_t kEndPageSwitch[] = L"endpage"; -const wchar_t kListSwitch[] = L"list"; -const wchar_t kStartIndexSwitch[] = L"startline"; -const wchar_t kEndIndexSwitch[] = L"endline"; -const wchar_t kIterationSwitch[] = L"iterations"; -const wchar_t kContinuousLoadSwitch[] = L"continuousload"; -const wchar_t kMemoryUsageSwitch[] = L"memoryusage"; -const wchar_t kEndURLSwitch[] = L"endurl"; -const wchar_t kLogFileSwitch[] = L"logfile"; -const wchar_t kTimeoutSwitch[] = L"timeout"; -const wchar_t kNoPageDownSwitch[] = L"nopagedown"; -const wchar_t kSaveDebugLogSwitch[] = L"savedebuglog"; +const char kSiteSwitch[] = "site"; +const char kStartPageSwitch[] = "startpage"; +const char kEndPageSwitch[] = "endpage"; +const char kListSwitch[] = "list"; +const char kStartIndexSwitch[] = "startline"; +const char kEndIndexSwitch[] = "endline"; +const char kIterationSwitch[] = "iterations"; +const char kContinuousLoadSwitch[] = "continuousload"; +const char kMemoryUsageSwitch[] = "memoryusage"; +const char kEndURLSwitch[] = "endurl"; +const char kLogFileSwitch[] = "logfile"; +const char kTimeoutSwitch[] = "timeout"; +const char kNoPageDownSwitch[] = "nopagedown"; +const char kSaveDebugLogSwitch[] = "savedebuglog"; const char kDefaultServerUrl[] = "http://urllist.com"; std::string g_server_url; @@ -88,7 +88,7 @@ const char kTestPage2[] = "page2.html"; const char crash_url[] = "about:crash"; // These are copied from v8 definitions as we cannot include them. -const wchar_t kV8LogFileSwitch[] = L"logfile"; +const char kV8LogFileSwitch[] = "logfile"; const char kV8LogFileDefaultName[] = "v8.log"; // String name of local chrome dll for looking up file information. diff --git a/chrome/test/test_launcher/out_of_proc_test_runner.cc b/chrome/test/test_launcher/out_of_proc_test_runner.cc index 3d02bcb..dd1f5af 100644 --- a/chrome/test/test_launcher/out_of_proc_test_runner.cc +++ b/chrome/test/test_launcher/out_of_proc_test_runner.cc @@ -15,8 +15,8 @@ namespace { -const wchar_t* const kGTestListTestsFlag = L"gtest_list_tests"; -const wchar_t* const kChildProcessFlag = L"child"; +const char kGTestListTestsFlag[] = "gtest_list_tests"; +const char kChildProcessFlag[] = "child"; class OutOfProcTestRunner : public tests::TestRunner { public: @@ -36,8 +36,8 @@ class OutOfProcTestRunner : public tests::TestRunner { CommandLine new_cmd_line(cmd_line->argv()); // Always enable disabled tests. This method is not called with disabled // tests unless this flag was specified to the browser test executable. - new_cmd_line.AppendSwitch(L"gtest_also_run_disabled_tests"); - new_cmd_line.AppendSwitchWithValue(L"gtest_filter", ASCIIToWide(test_name)); + new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); + new_cmd_line.AppendSwitchWithValue("gtest_filter", test_name); new_cmd_line.AppendSwitch(kChildProcessFlag); base::ProcessHandle process_handle; diff --git a/chrome/test/test_launcher/test_runner.cc b/chrome/test/test_launcher/test_runner.cc index 4fb34cd..fa4cc6e 100644 --- a/chrome/test/test_launcher/test_runner.cc +++ b/chrome/test/test_launcher/test_runner.cc @@ -14,9 +14,8 @@ namespace { -const wchar_t* const kGTestListTestsFlag = L"gtest_list_tests"; -const wchar_t* const kGTestRunDisabledTestsFlag = - L"gtest_also_run_disabled_tests"; +const char kGTestListTestsFlag[] = "gtest_list_tests"; +const char kGTestRunDisabledTestsFlag[] = "gtest_also_run_disabled_tests"; // Retrieves the list of tests to run by running gtest with the // --gtest_list_tests flag in a forked process and parsing its output. diff --git a/chrome/test/ui/dom_checker_uitest.cc b/chrome/test/ui/dom_checker_uitest.cc index 37a50f7..e9a4996 100644 --- a/chrome/test/ui/dom_checker_uitest.cc +++ b/chrome/test/ui/dom_checker_uitest.cc @@ -27,7 +27,7 @@ static const FilePath::CharType kTestDirectory[] = static const FilePath::CharType kStartFile[] = FILE_PATH_LITERAL("dom_checker.html"); -const wchar_t kRunDomCheckerTest[] = L"run-dom-checker-test"; +const char kRunDomCheckerTest[] = "run-dom-checker-test"; class DomCheckerTest : public UITest { public: diff --git a/chrome/test/ui/omnibox_uitest.cc b/chrome/test/ui/omnibox_uitest.cc index af94102..ebf5d7b 100644 --- a/chrome/test/ui/omnibox_uitest.cc +++ b/chrome/test/ui/omnibox_uitest.cc @@ -19,7 +19,7 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" -const wchar_t kRunOmniboxTest[] = L"run_omnibox_test"; +const char kRunOmniboxTest[] = "run_omnibox_test"; class OmniboxTest : public UITest { public: diff --git a/chrome/test/ui/sunspider_uitest.cc b/chrome/test/ui/sunspider_uitest.cc index 3f6c8f5..a3c20db 100644 --- a/chrome/test/ui/sunspider_uitest.cc +++ b/chrome/test/ui/sunspider_uitest.cc @@ -21,7 +21,7 @@ namespace { static const FilePath::CharType kStartFile[] = FILE_PATH_LITERAL("sunspider-driver.html"); -const wchar_t kRunSunSpider[] = L"run-sunspider"; +const char kRunSunSpider[] = "run-sunspider"; class SunSpiderTest : public UITest { public: diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index cf49227..c4a37e2 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -77,17 +77,17 @@ std::wstring UITest::log_level_ = L""; // Specify the time (in milliseconds) that the ui_tests should wait before // timing out. This is used to specify longer timeouts when running under Purify // which requires much more time. -const wchar_t kUiTestTimeout[] = L"ui-test-timeout"; -const wchar_t kUiTestActionTimeout[] = L"ui-test-action-timeout"; -const wchar_t kUiTestActionMaxTimeout[] = L"ui-test-action-max-timeout"; -const wchar_t kUiTestSleepTimeout[] = L"ui-test-sleep-timeout"; -const wchar_t kUiTestTerminateTimeout[] = L"ui-test-terminate-timeout"; +const char kUiTestTimeout[] = "ui-test-timeout"; +const char kUiTestActionTimeout[] = "ui-test-action-timeout"; +const char kUiTestActionMaxTimeout[] = "ui-test-action-max-timeout"; +const char kUiTestSleepTimeout[] = "ui-test-sleep-timeout"; +const char kUiTestTerminateTimeout[] = "ui-test-terminate-timeout"; -const wchar_t kExtraChromeFlagsSwitch[] = L"extra-chrome-flags"; +const char kExtraChromeFlagsSwitch[] = "extra-chrome-flags"; // By default error dialogs are hidden, which makes debugging failures in the // slave process frustrating. By passing this in error dialogs are enabled. -const wchar_t kEnableErrorDialogs[] = L"enable-errdialogs"; +const char kEnableErrorDialogs[] = "enable-errdialogs"; // Uncomment this line to have the spawned process wait for the debugger to // attach. This only works on Windows. On posix systems, you can set the @@ -308,16 +308,16 @@ static void RunCommand(const CommandLine& cmd_line) { void UITest::StartHttpServer(const FilePath& root_directory) { scoped_ptr<CommandLine> cmd_line(CreateHttpServerCommandLine()); ASSERT_TRUE(cmd_line.get()); - cmd_line->AppendSwitchWithValue(L"server", L"start"); - cmd_line->AppendSwitch(L"register_cygwin"); - cmd_line->AppendSwitchWithValue(L"root", root_directory.ToWStringHack()); + cmd_line->AppendSwitchWithValue("server", "start"); + cmd_line->AppendSwitch("register_cygwin"); + cmd_line->AppendSwitchWithValue("root", root_directory.ToWStringHack()); // For Windows 7, if we start the lighttpd server on the foreground mode, // it will mess up with the command window and cause conhost.exe to crash. To // work around this, we start the http server on the background mode. #if defined(OS_WIN) if (win_util::GetWinVersion() >= win_util::WINVERSION_WIN7) - cmd_line->AppendSwitch(L"run_background"); + cmd_line->AppendSwitch("run_background"); #endif RunCommand(*cmd_line.get()); @@ -326,7 +326,7 @@ void UITest::StartHttpServer(const FilePath& root_directory) { void UITest::StopHttpServer() { scoped_ptr<CommandLine> cmd_line(CreateHttpServerCommandLine()); ASSERT_TRUE(cmd_line.get()); - cmd_line->AppendSwitchWithValue(L"server", L"stop"); + cmd_line->AppendSwitchWithValue("server", "stop"); RunCommand(*cmd_line.get()); } diff --git a/chrome/test/ui/ui_test_suite.cc b/chrome/test/ui/ui_test_suite.cc index 691a75f..a26000f 100644 --- a/chrome/test/ui/ui_test_suite.cc +++ b/chrome/test/ui/ui_test_suite.cc @@ -10,14 +10,14 @@ #include "chrome/common/env_vars.h" // Force a test to use an already running browser instance. UI tests only. -const wchar_t UITestSuite::kUseExistingBrowser[] = L"use-existing-browser"; +const char UITestSuite::kUseExistingBrowser[] = "use-existing-browser"; // Timeout for the test in milliseconds. UI tests only. -const wchar_t UITestSuite::kTestTimeout[] = L"test-timeout"; +const char UITestSuite::kTestTimeout[] = "test-timeout"; // Parameters to run test in parallel. UI tests only. -const wchar_t UITestSuite::kBatchCount[] = L"batch-count"; -const wchar_t UITestSuite::kBatchIndex[] = L"batch-index"; +const char UITestSuite::kBatchCount[] = "batch-count"; +const char UITestSuite::kBatchIndex[] = "batch-index"; const char UITestSuite::kGTestTotalShards[] = "GTEST_TOTAL_SHARDS="; const char UITestSuite::kGTestShardIndex[] = "GTEST_SHARD_INDEX="; diff --git a/chrome/test/ui/ui_test_suite.h b/chrome/test/ui/ui_test_suite.h index b5771cb..6354d5f 100644 --- a/chrome/test/ui/ui_test_suite.h +++ b/chrome/test/ui/ui_test_suite.h @@ -27,10 +27,10 @@ class UITestSuite : public ChromeTestSuite { base::ProcessHandle crash_service_; #endif - static const wchar_t kUseExistingBrowser[]; - static const wchar_t kTestTimeout[]; - static const wchar_t kBatchCount[]; - static const wchar_t kBatchIndex[]; + static const char kUseExistingBrowser[]; + static const char kTestTimeout[]; + static const char kBatchCount[]; + static const char kBatchIndex[]; static const char kGTestTotalShards[]; static const char kGTestShardIndex[]; }; diff --git a/chrome/test/ui/v8_benchmark_uitest.cc b/chrome/test/ui/v8_benchmark_uitest.cc index 103e47a..4a248f7 100644 --- a/chrome/test/ui/v8_benchmark_uitest.cc +++ b/chrome/test/ui/v8_benchmark_uitest.cc @@ -22,7 +22,7 @@ namespace { static const FilePath::CharType kStartFile[] = FILE_PATH_LITERAL("run.html"); -const wchar_t kRunV8Benchmark[] = L"run-v8-benchmark"; +const char kRunV8Benchmark[] = "run-v8-benchmark"; class V8BenchmarkTest : public UITest { public: diff --git a/chrome/test/url_fetch_test/url_fetch_test.cc b/chrome/test/url_fetch_test/url_fetch_test.cc index 75be5ab..ed70f20 100644 --- a/chrome/test/url_fetch_test/url_fetch_test.cc +++ b/chrome/test/url_fetch_test/url_fetch_test.cc @@ -27,7 +27,7 @@ class UrlFetchTest : public UITest { void SetUp() { const CommandLine *cmdLine = CommandLine::ForCurrentProcess(); - if (cmdLine->HasSwitch(L"reference_build")) { + if (cmdLine->HasSwitch("reference_build")) { FilePath dir; PathService::Get(chrome::DIR_TEST_TOOLS, &dir); dir = dir.AppendASCII("reference_build"); @@ -109,19 +109,19 @@ bool writeValueToFile(std::string value, std::wstring filePath) { TEST_F(UrlFetchTest, UrlFetch) { const CommandLine *cmdLine = CommandLine::ForCurrentProcess(); - if (!cmdLine->HasSwitch(L"url")) { + if (!cmdLine->HasSwitch("url")) { return; } std::string cookieName = - WideToASCII(cmdLine->GetSwitchValue(L"wait_cookie_name")); + cmdLine->GetSwitchValueASCII("wait_cookie_name"); std::string cookieValue = - WideToASCII(cmdLine->GetSwitchValue(L"wait_cookie_value")); + cmdLine->GetSwitchValueASCII("wait_cookie_value"); - std::wstring jsvar = cmdLine->GetSwitchValue(L"jsvar"); + std::wstring jsvar = cmdLine->GetSwitchValue("jsvar"); UrlFetchTestResult result; - RunTest(GURL(WideToASCII(cmdLine->GetSwitchValue(L"url"))), + RunTest(GURL(WideToASCII(cmdLine->GetSwitchValue("url"))), cookieName.length() > 0 ? cookieName.c_str() : NULL, cookieValue.length() > 0 ? cookieValue.c_str() : NULL, jsvar.length() > 0 ? jsvar.c_str() : NULL, @@ -129,13 +129,13 @@ TEST_F(UrlFetchTest, UrlFetch) { // Write out the cookie if requested std::wstring cookieOutputPath = - cmdLine->GetSwitchValue(L"wait_cookie_output"); + cmdLine->GetSwitchValue("wait_cookie_output"); if (cookieOutputPath.length() > 0) { ASSERT_TRUE(writeValueToFile(result.cookie_value, cookieOutputPath)); } // Write out the JS Variable if requested - std::wstring jsvarOutputPath = cmdLine->GetSwitchValue(L"jsvar_output"); + std::wstring jsvarOutputPath = cmdLine->GetSwitchValue("jsvar_output"); if (jsvarOutputPath.length() > 0) { ASSERT_TRUE(writeValueToFile(result.javascript_variable, jsvarOutputPath)); } diff --git a/chrome/tools/crash_service/crash_service.cc b/chrome/tools/crash_service/crash_service.cc index badfd33..058c40a 100644 --- a/chrome/tools/crash_service/crash_service.cc +++ b/chrome/tools/crash_service/crash_service.cc @@ -147,9 +147,9 @@ struct DumpJobInfo { } // namespace // Command line switches: -const wchar_t CrashService::kMaxReports[] = L"max-reports"; -const wchar_t CrashService::kNoWindow[] = L"no-window"; -const wchar_t CrashService::kReporterTag[]= L"reporter"; +const char CrashService::kMaxReports[] = "max-reports"; +const char CrashService::kNoWindow[] = "no-window"; +const char CrashService::kReporterTag[] = "reporter"; CrashService::CrashService(const std::wstring& report_dir) : report_path_(report_dir), diff --git a/chrome/tools/crash_service/crash_service.h b/chrome/tools/crash_service/crash_service.h index 0c022bd..3197eea 100644 --- a/chrome/tools/crash_service/crash_service.h +++ b/chrome/tools/crash_service/crash_service.h @@ -42,17 +42,17 @@ class CrashService { // Allows to override the maximum number for reports per day. Normally // the crash dumps are never sent so if you want to send any you must // specify a positive number here. - static const wchar_t kMaxReports[]; + static const char kMaxReports[]; // --no-window // Does not create a visible window on the desktop. The window does not have // any other functionality other than allowing the crash service to be // gracefully closed. - static const wchar_t kNoWindow[]; + static const char kNoWindow[]; // --reporter=<string> // Allows to specify a custom string that appears on the detail crash report // page in the crash server. This should be a 25 chars or less string. // The default tag if not specified is 'crash svc'. - static const wchar_t kReporterTag[]; + static const char kReporterTag[]; // Returns the actual report path. std::wstring report_path() const { diff --git a/chrome_frame/chrome_launcher_unittest.cc b/chrome_frame/chrome_launcher_unittest.cc index 1181f09..268369d 100644 --- a/chrome_frame/chrome_launcher_unittest.cc +++ b/chrome_frame/chrome_launcher_unittest.cc @@ -33,7 +33,7 @@ TEST(ChromeLauncher, SanitizeCommandLine) { CommandLine bad(L"dummy.exe");
bad.AppendSwitch(switches::kDisableMetrics); // in whitelist
bad.AppendSwitchWithValue(switches::kLoadExtension, L"foo"); // in whitelist
- bad.AppendSwitch(L"no-such-switch"); // does not exist
+ bad.AppendSwitch("no-such-switch"); // does not exist
bad.AppendSwitch(switches::kHomePage); // exists but not in whitelist
LogDisabler no_dchecks;
@@ -42,7 +42,7 @@ TEST(ChromeLauncher, SanitizeCommandLine) { chrome_launcher::SanitizeCommandLine(bad, &sanitized);
EXPECT_TRUE(sanitized.HasSwitch(switches::kDisableMetrics));
EXPECT_TRUE(sanitized.HasSwitch(switches::kLoadExtension));
- EXPECT_FALSE(sanitized.HasSwitch(L"no-such-switch"));
+ EXPECT_FALSE(sanitized.HasSwitch("no-such-switch"));
EXPECT_FALSE(sanitized.HasSwitch(switches::kHomePage));
EXPECT_EQ(sanitized.GetSwitchValue(switches::kLoadExtension), L"foo");
diff --git a/courgette/courgette_tool.cc b/courgette/courgette_tool.cc index 91f02aa6..ea5106e 100644 --- a/courgette/courgette_tool.cc +++ b/courgette/courgette_tool.cc @@ -349,22 +349,22 @@ int main(int argc, const char* argv[]) { CommandLine::Init(argc, argv); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - bool cmd_dis = command_line.HasSwitch(L"dis"); - bool cmd_asm = command_line.HasSwitch(L"asm"); - bool cmd_disadj = command_line.HasSwitch(L"disadj"); - bool cmd_make_patch = command_line.HasSwitch(L"gen"); - bool cmd_apply_patch = command_line.HasSwitch(L"apply"); - bool cmd_make_bsdiff_patch = command_line.HasSwitch(L"genbsdiff"); - bool cmd_apply_bsdiff_patch = command_line.HasSwitch(L"applybsdiff"); - bool cmd_spread_1_adjusted = command_line.HasSwitch(L"gen1a"); - bool cmd_spread_1_unadjusted = command_line.HasSwitch(L"gen1u"); + bool cmd_dis = command_line.HasSwitch("dis"); + bool cmd_asm = command_line.HasSwitch("asm"); + bool cmd_disadj = command_line.HasSwitch("disadj"); + bool cmd_make_patch = command_line.HasSwitch("gen"); + bool cmd_apply_patch = command_line.HasSwitch("apply"); + bool cmd_make_bsdiff_patch = command_line.HasSwitch("genbsdiff"); + bool cmd_apply_bsdiff_patch = command_line.HasSwitch("applybsdiff"); + bool cmd_spread_1_adjusted = command_line.HasSwitch("gen1a"); + bool cmd_spread_1_unadjusted = command_line.HasSwitch("gen1u"); std::vector<std::wstring> values = command_line.GetLooseValues(); // '-repeat=N' is for debugging. Running many iterations can reveal leaks and // bugs in cleanup. int repeat_count = 1; - std::wstring repeat_switch = command_line.GetSwitchValue(L"repeat"); + std::wstring repeat_switch = command_line.GetSwitchValue("repeat"); if (!repeat_switch.empty()) if (!WideStringToInt(repeat_switch, &repeat_count)) repeat_count = 1; diff --git a/ipc/ipc_switches.cc b/ipc/ipc_switches.cc index 18f7c27..2a8f470 100644 --- a/ipc/ipc_switches.cc +++ b/ipc/ipc_switches.cc @@ -13,16 +13,16 @@ namespace switches { // On POSIX only: use FIFO for IPC channels so that "unrelated" process // can connect to a channel, provided it knows its name. For debugging purposes. -const wchar_t kIPCUseFIFO[] = L"ipc-use-fifo"; +const char kIPCUseFIFO[] = "ipc-use-fifo"; // The value of this switch tells the child process which // IPC channel the browser expects to use to communicate with it. -const wchar_t kProcessChannelID[] = L"channel"; +const char kProcessChannelID[] = "channel"; // Will add kDebugOnStart to every child processes. If a value is passed, it // will be used as a filter to determine if the child process should have the // kDebugOnStart flag passed on or not. -const wchar_t kDebugChildren[] = L"debug-children"; +const char kDebugChildren[] = "debug-children"; } // namespace switches diff --git a/ipc/ipc_switches.h b/ipc/ipc_switches.h index 1468432..143dc3d 100644 --- a/ipc/ipc_switches.h +++ b/ipc/ipc_switches.h @@ -11,9 +11,9 @@ namespace switches { -extern const wchar_t kIPCUseFIFO[]; -extern const wchar_t kProcessChannelID[]; -extern const wchar_t kDebugChildren[]; +extern const char kIPCUseFIFO[]; +extern const char kProcessChannelID[]; +extern const char kDebugChildren[]; } // namespace switches diff --git a/media/bench/bench.cc b/media/bench/bench.cc index 11afdf9..f1c3248 100644 --- a/media/bench/bench.cc +++ b/media/bench/bench.cc @@ -34,16 +34,16 @@ #include "media/filters/ffmpeg_video_decoder.h" namespace switches { -const wchar_t kStream[] = L"stream"; -const wchar_t kVideoThreads[] = L"video-threads"; -const wchar_t kVerbose[] = L"verbose"; -const wchar_t kFast2[] = L"fast2"; -const wchar_t kSkip[] = L"skip"; -const wchar_t kFlush[] = L"flush"; -const wchar_t kDjb2[] = L"djb2"; -const wchar_t kMd5[] = L"md5"; -const wchar_t kFrames[] = L"frames"; -const wchar_t kLoop[] = L"loop"; +const char kStream[] = "stream"; +const char kVideoThreads[] = "video-threads"; +const char kVerbose[] = "verbose"; +const char kFast2[] = "fast2"; +const char kSkip[] = "skip"; +const char kFlush[] = "flush"; +const char kDjb2[] = "djb2"; +const char kMd5[] = "md5"; +const char kFrames[] = "frames"; +const char kLoop[] = "loop"; } // namespace switches @@ -125,11 +125,11 @@ int main(int argc, const char** argv) { CodecType target_codec = CODEC_TYPE_UNKNOWN; // Determine whether to benchmark audio or video decoding. - std::wstring stream(cmd_line->GetSwitchValue(switches::kStream)); + std::string stream(cmd_line->GetSwitchValueASCII(switches::kStream)); if (!stream.empty()) { - if (stream.compare(L"audio") == 0) { + if (stream.compare("audio") == 0) { target_codec = CODEC_TYPE_AUDIO; - } else if (stream.compare(L"video") == 0) { + } else if (stream.compare("video") == 0) { target_codec = CODEC_TYPE_VIDEO; } else { std::cerr << "Unknown --stream option " << stream << std::endl; diff --git a/net/tools/dump_cache/dump_cache.cc b/net/tools/dump_cache/dump_cache.cc index 748bf0f..8a84b91 100644 --- a/net/tools/dump_cache/dump_cache.cc +++ b/net/tools/dump_cache/dump_cache.cc @@ -57,8 +57,8 @@ const wchar_t kDumpToFiles[] = L"dump-to-files"; const wchar_t kUpgrade[] = L"upgrade"; // Internal use: -const wchar_t kSlave[] = L"slave"; -const wchar_t kPipe[] = L"pipe"; +const char kSlave[] = "slave"; +const char kPipe[] = "pipe"; int Help() { printf("warning: input files are modified by this tool\n"); diff --git a/net/tools/fetch/fetch_client.cc b/net/tools/fetch/fetch_client.cc index 7a3dea7..4c4ac46 100644 --- a/net/tools/fetch/fetch_client.cc +++ b/net/tools/fetch/fetch_client.cc @@ -120,14 +120,14 @@ int main(int argc, char**argv) { CommandLine::Init(argc, argv); const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); - std::string url = WideToASCII(parsed_command_line.GetSwitchValue(L"url")); + std::string url = WideToASCII(parsed_command_line.GetSwitchValue("url")); if (!url.length()) usage(argv[0]); int client_limit = 1; - if (parsed_command_line.HasSwitch(L"n")) - StringToInt(WideToASCII(parsed_command_line.GetSwitchValue(L"n")), + if (parsed_command_line.HasSwitch("n")) + StringToInt(WideToASCII(parsed_command_line.GetSwitchValue("n")), &client_limit); - bool use_cache = parsed_command_line.HasSwitch(L"use-cache"); + bool use_cache = parsed_command_line.HasSwitch("use-cache"); // Do work here. MessageLoop loop(MessageLoop::TYPE_IO); @@ -184,7 +184,7 @@ int main(int argc, char**argv) { printf("Bandwidth : %.2f%s\n", bps, units); } - if (parsed_command_line.HasSwitch(L"stats")) { + if (parsed_command_line.HasSwitch("stats")) { // Dump the stats table. printf("<stats>\n"); int counter_max = table.GetMaxCounters(); diff --git a/net/tools/fetch/fetch_server.cc b/net/tools/fetch/fetch_server.cc index eab8851..085bd46 100644 --- a/net/tools/fetch/fetch_server.cc +++ b/net/tools/fetch/fetch_server.cc @@ -39,7 +39,7 @@ int main(int argc, char**argv) { HttpServer server("", 80); // TODO(mbelshe): make port configurable MessageLoop::current()->Run(); - if (parsed_command_line.HasSwitch(L"stats")) { + if (parsed_command_line.HasSwitch("stats")) { // Dump the stats table. printf("<stats>\n"); int counter_max = table.GetMaxCounters(); diff --git a/o3d/converter/cross/converter_main.cc b/o3d/converter/cross/converter_main.cc index f7c60c5..bb1dc7d 100644 --- a/o3d/converter/cross/converter_main.cc +++ b/o3d/converter/cross/converter_main.cc @@ -109,23 +109,23 @@ int CrossMain(int argc, char**argv) { } o3d::converter::Options options; - options.condition = !command_line->HasSwitch(L"no-condition"); - options.pretty_print = command_line->HasSwitch(L"pretty-print"); - options.binary = !command_line->HasSwitch(L"no-binary"); - options.json_only = !command_line->HasSwitch(L"json-only"); - if (command_line->HasSwitch(L"base-path")) { + options.condition = !command_line->HasSwitch("no-condition"); + options.pretty_print = command_line->HasSwitch("pretty-print"); + options.binary = !command_line->HasSwitch("no-binary"); + options.json_only = !command_line->HasSwitch("json-only"); + if (command_line->HasSwitch("base-path")) { options.base_path = o3d::WideToFilePath( - command_line->GetSwitchValue(L"base-path")); + command_line->GetSwitchValue("base-path")); } - if (command_line->HasSwitch(L"asset-paths")) { + if (command_line->HasSwitch("asset-paths")) { std::vector<std::wstring> paths; - SplitString(command_line->GetSwitchValue(L"asset-paths"), ',', &paths); + SplitString(command_line->GetSwitchValue("asset-paths"), ',', &paths); for (size_t ii = 0; ii < paths.size(); ++ii) { options.file_paths.push_back(o3d::WideToFilePath(paths[ii])); } } - if (command_line->HasSwitch(L"up-axis")) { - wstring up_axis_string = command_line->GetSwitchValue(L"up-axis"); + if (command_line->HasSwitch("up-axis")) { + wstring up_axis_string = command_line->GetSwitchValue("up-axis"); int x, y, z; if (swscanf(up_axis_string.c_str(), L"%d,%d,%d", &x, &y, &z) != 3) { std::cerr << "Invalid --up-axis value. Should be --up-axis=x,y,z\n"; diff --git a/o3d/converter/cross/verifier_main.cc b/o3d/converter/cross/verifier_main.cc index 4ffde5b..931fa39 100644 --- a/o3d/converter/cross/verifier_main.cc +++ b/o3d/converter/cross/verifier_main.cc @@ -82,7 +82,7 @@ int CrossMain(int argc, char**argv) { } o3d::converter::Options options; - options.condition = !command_line->HasSwitch(L"no-condition"); + options.condition = !command_line->HasSwitch("no-condition"); if (!options.condition && !out_filename.empty()) { std::cerr << "Warning: Ignoring output filename because conditioning " diff --git a/o3d/converter_edge/cross/converter_main.cc b/o3d/converter_edge/cross/converter_main.cc index ee40311..eef1dec 100644 --- a/o3d/converter_edge/cross/converter_main.cc +++ b/o3d/converter_edge/cross/converter_main.cc @@ -110,21 +110,21 @@ int CrossMain(int argc, char**argv) { } o3d::converter::Options options; - options.condition = !command_line->HasSwitch(L"no-condition"); - options.pretty_print = command_line->HasSwitch(L"pretty-print"); - if (command_line->HasSwitch(L"base-path")) { + options.condition = !command_line->HasSwitch("no-condition"); + options.pretty_print = command_line->HasSwitch("pretty-print"); + if (command_line->HasSwitch("base-path")) { options.base_path = o3d::WideToFilePath( - command_line->GetSwitchValue(L"base-path")); + command_line->GetSwitchValue("base-path")); } - if (command_line->HasSwitch(L"asset-paths")) { + if (command_line->HasSwitch("asset-paths")) { std::vector<std::wstring> paths; - SplitString(command_line->GetSwitchValue(L"asset-paths"), ',', &paths); + SplitString(command_line->GetSwitchValue("asset-paths"), ',', &paths); for (size_t ii = 0; ii < paths.size(); ++ii) { options.file_paths.push_back(o3d::WideToFilePath(paths[ii])); } } - if (command_line->HasSwitch(L"up-axis")) { - wstring up_axis_string = command_line->GetSwitchValue(L"up-axis"); + if (command_line->HasSwitch("up-axis")) { + wstring up_axis_string = command_line->GetSwitchValue("up-axis"); int x, y, z; if (swscanf(up_axis_string.c_str(), L"%d,%d,%d", &x, &y, &z) != 3) { std::cerr << "Invalid --up-axis value. Should be --up-axis=x,y,z\n"; @@ -134,9 +134,9 @@ int CrossMain(int argc, char**argv) { static_cast<float>(y), static_cast<float>(z)); } - if (command_line->HasSwitch(L"sharp-edge-threshold")) { + if (command_line->HasSwitch("sharp-edge-threshold")) { wstring soften_edge_string = - command_line->GetSwitchValue(L"sharp-edge-threshold"); + command_line->GetSwitchValue("sharp-edge-threshold"); float soft_threshold; if (swscanf(soften_edge_string.c_str(), L"%f", &soft_threshold) != 1) { std::cerr << "Invalid --sharp-edges-threshold value.\n"; @@ -145,9 +145,9 @@ int CrossMain(int argc, char**argv) { options.enable_add_sharp_edge = true; options.sharp_edge_threshold = soft_threshold; } - if (command_line->HasSwitch(L"sharp-edge-color")) { + if (command_line->HasSwitch("sharp-edge-color")) { wstring edge_color_str = - command_line->GetSwitchValue(L"sharp-edge-color"); + command_line->GetSwitchValue("sharp-edge-color"); int r, g, b; if (swscanf(edge_color_str.c_str(), L"%d,%d,%d", &r, &g, &b) != 3) { std::cerr << "Invalid --sharp-edge-color value. Should be " diff --git a/o3d/converter_edge/cross/verifier_main.cc b/o3d/converter_edge/cross/verifier_main.cc index bc0e8a9..c401596 100644 --- a/o3d/converter_edge/cross/verifier_main.cc +++ b/o3d/converter_edge/cross/verifier_main.cc @@ -82,7 +82,7 @@ int CrossMain(int argc, char**argv) { } o3d::converter::Options options; - options.condition = !command_line->HasSwitch(L"no-condition"); + options.condition = !command_line->HasSwitch("no-condition"); if (!options.condition && !out_filename.empty()) { std::cerr << "Warning: Ignoring output filename because conditioning " diff --git a/tools/imagediff/image_diff.cc b/tools/imagediff/image_diff.cc index 60c3a7f..deba3cc 100644 --- a/tools/imagediff/image_diff.cc +++ b/tools/imagediff/image_diff.cc @@ -28,8 +28,8 @@ // Causes the app to remain open, waiting for pairs of filenames on stdin. // The caller is then responsible for terminating this app. -static const wchar_t kOptionPollStdin[] = L"use-stdin"; -static const wchar_t kOptionGenerateDiff[] = L"diff"; +static const char kOptionPollStdin[] = "use-stdin"; +static const char kOptionGenerateDiff[] = "diff"; // Return codes used by this utility. static const int kStatusSame = 0; diff --git a/webkit/glue/plugins/plugin_constants_win.h b/webkit/glue/plugins/plugin_constants_win.h index f00886d..7357369 100644 --- a/webkit/glue/plugins/plugin_constants_win.h +++ b/webkit/glue/plugins/plugin_constants_win.h @@ -7,7 +7,7 @@ // Used by the plugins_test when testing the older WMP plugin to force the new // plugin to not get loaded. -#define kUseOldWMPPluginSwitch L"use-old-wmp" +#define kUseOldWMPPluginSwitch "use-old-wmp" // The window class name for a plugin window. #define kNativeWindowClassName L"NativeWindowClass" diff --git a/webkit/glue/plugins/plugin_list_linux.cc b/webkit/glue/plugins/plugin_list_linux.cc index 4f72ab1..d740bc6 100644 --- a/webkit/glue/plugins/plugin_list_linux.cc +++ b/webkit/glue/plugins/plugin_list_linux.cc @@ -13,7 +13,7 @@ namespace { // Return true if we're in debug-plugin-loading mode. bool DebugPluginLoading() { - static const wchar_t kDebugPluginLoading[] = L"debug-plugin-loading"; + static const char kDebugPluginLoading[] = "debug-plugin-loading"; return CommandLine::ForCurrentProcess()->HasSwitch(kDebugPluginLoading); } diff --git a/webkit/glue/webworkerclient_impl.cc b/webkit/glue/webworkerclient_impl.cc index 0946bc2..e84a411 100644 --- a/webkit/glue/webworkerclient_impl.cc +++ b/webkit/glue/webworkerclient_impl.cc @@ -67,7 +67,7 @@ WebCore::WorkerContextProxy* WebWorkerClientImpl::createWorkerContextProxy( WebCore::Worker* worker) { if (!worker->scriptExecutionContext()->isDocument() && CommandLine::ForCurrentProcess()->HasSwitch( - L"web-worker-share-processes")) { + "web-worker-share-processes")) { return new WebCore::WorkerMessagingProxy(worker); } diff --git a/webkit/tools/test_shell/node_leak_test.cc b/webkit/tools/test_shell/node_leak_test.cc index bfd5688..dc5a2b8 100644 --- a/webkit/tools/test_shell/node_leak_test.cc +++ b/webkit/tools/test_shell/node_leak_test.cc @@ -18,7 +18,7 @@ namespace { -const wchar_t kTestUrlSwitch[] = L"test-url"; +const char kTestUrlSwitch[] = "test-url"; // A test to help determine if any nodes have been leaked as a result of // visiting a given URL. If enabled in WebCore, the number of leaked nodes diff --git a/webkit/tools/test_shell/test_shell_switches.cc b/webkit/tools/test_shell/test_shell_switches.cc index 26a79cb..1142ee1 100644 --- a/webkit/tools/test_shell/test_shell_switches.cc +++ b/webkit/tools/test_shell/test_shell_switches.cc @@ -7,79 +7,79 @@ namespace test_shell { // Suppresses all error dialogs when present. -const wchar_t kNoErrorDialogs[] = L"noerrdialogs"; +const char kNoErrorDialogs[] = "noerrdialogs"; // Causes the test_shell to run using stdin and stdout for URLs and output, // respectively, and interferes with interactive use of the UI. -const wchar_t kLayoutTests[] = L"layout-tests"; -const wchar_t kCrashDumps[] = L"crash-dumps"; // Enable crash dumps +const char kLayoutTests[] = "layout-tests"; +const char kCrashDumps[] = "crash-dumps"; // Enable crash dumps // Causes the test_shell to run with a generic theme (part of layout_tests). -const wchar_t kGenericTheme[] = L"generic-theme"; +const char kGenericTheme[] = "generic-theme"; // This causes the test_shell to run with the classic theme. // Passing --layout-tests enables this by default. -const wchar_t kClassicTheme[] = L"classic-theme"; +const char kClassicTheme[] = "classic-theme"; // This causes the test_shell to run with the new windows theming engine // enabled. This is the default unless --layout-tests is specified. -const wchar_t kUxTheme[] = L"ux-theme"; +const char kUxTheme[] = "ux-theme"; // Command line flags that control the tests when layout-tests is specified. -const wchar_t kNoTree[] = L"notree"; // Don't dump the render tree. -const wchar_t kDumpPixels[] = L"pixel-tests"; // Enable pixel tests. +const char kNoTree[] = "notree"; // Don't dump the render tree. +const char kDumpPixels[] = "pixel-tests"; // Enable pixel tests. // Optional command line switch that specifies timeout time for page load when // running file tests in layout test mode, in ms. -const wchar_t kTestShellTimeOut[] = L"time-out-ms"; +const char kTestShellTimeOut[] = "time-out-ms"; -const wchar_t kStartupDialog[] = L"testshell-startup-dialog"; +const char kStartupDialog[] = "testshell-startup-dialog"; // Enable the Windows dialogs for GP faults in the test shell. This allows makes // it possible to attach a crashed test shell to a debugger. -const wchar_t kGPFaultErrorBox[] = L"gp-fault-error-box"; +const char kGPFaultErrorBox[] = "gp-fault-error-box"; // JavaScript flags passed to engine. -const wchar_t kJavaScriptFlags[] = L"js-flags"; +const char kJavaScriptFlags[] = "js-flags"; // Run the http cache in record mode. -const wchar_t kRecordMode[] = L"record-mode"; +const char kRecordMode[] = "record-mode"; // Run the http cache in playback mode. -const wchar_t kPlaybackMode[] = L"playback-mode"; +const char kPlaybackMode[] = "playback-mode"; // Don't record/playback events when using record & playback. -const wchar_t kNoEvents[] = L"no-events"; +const char kNoEvents[] = "no-events"; // Dump stats table on exit. -const wchar_t kDumpStatsTable[] = L"stats"; +const char kDumpStatsTable[] = "stats"; // Use a specified cache directory. -const wchar_t kCacheDir[] = L"cache-dir"; +const char kCacheDir[] = "cache-dir"; // When being run through a memory profiler, trigger memory in use dumps at // startup and just prior to shutdown. -const wchar_t kDebugMemoryInUse[] = L"debug-memory-in-use"; +const char kDebugMemoryInUse[] = "debug-memory-in-use"; // Enable cookies on the file:// scheme. --layout-tests also enables this. -const wchar_t kEnableFileCookies[] = L"enable-file-cookies"; +const char kEnableFileCookies[] = "enable-file-cookies"; // Enable tracing events (see base/trace_event.h) -const wchar_t kEnableTracing[] = L"enable-tracing"; +const char kEnableTracing[] = "enable-tracing"; // Allow scripts to close windows in all cases. -const wchar_t kAllowScriptsToCloseWindows[] = L"allow-scripts-to-close-windows"; +const char kAllowScriptsToCloseWindows[] = "allow-scripts-to-close-windows"; // Test the system dependencies (themes, fonts, ...). When this flag is // specified, the test shell will exit immediately with either 0 (success) or // 1 (failure). Combining with other flags has no effect. -extern const wchar_t kCheckLayoutTestSystemDeps[] = - L"check-layout-test-sys-deps"; +extern const char kCheckLayoutTestSystemDeps[] = + "check-layout-test-sys-deps"; // If set, we are running under GDB so allow a certain class of errors // to happen even if in layout test mode. -extern const wchar_t kGDB[] = L"gdb"; +extern const char kGDB[] = "gdb"; // Make functions of the Profiler class available in javascript -extern const wchar_t kProfiler[] = L"profiler"; +extern const char kProfiler[] = "profiler"; } // namespace test_shell diff --git a/webkit/tools/test_shell/test_shell_switches.h b/webkit/tools/test_shell/test_shell_switches.h index d07398b..d580695 100644 --- a/webkit/tools/test_shell/test_shell_switches.h +++ b/webkit/tools/test_shell/test_shell_switches.h @@ -9,30 +9,30 @@ namespace test_shell { -extern const wchar_t kCrashDumps[]; -extern const wchar_t kDumpPixels[]; -extern const wchar_t kLayoutTests[]; -extern const wchar_t kGenericTheme[]; -extern const wchar_t kClassicTheme[]; -extern const wchar_t kUxTheme[]; -extern const wchar_t kNoErrorDialogs[]; -extern const wchar_t kNoTree[]; -extern const wchar_t kTestShellTimeOut[]; -extern const wchar_t kStartupDialog[]; -extern const wchar_t kGPFaultErrorBox[]; -extern const wchar_t kJavaScriptFlags[]; -extern const wchar_t kRecordMode[]; -extern const wchar_t kPlaybackMode[]; -extern const wchar_t kNoEvents[]; -extern const wchar_t kDumpStatsTable[]; -extern const wchar_t kCacheDir[]; -extern const wchar_t kDebugMemoryInUse[]; -extern const wchar_t kEnableFileCookies[]; -extern const wchar_t kEnableTracing[]; -extern const wchar_t kAllowScriptsToCloseWindows[]; -extern const wchar_t kCheckLayoutTestSystemDeps[]; -extern const wchar_t kGDB[]; -extern const wchar_t kProfiler[]; +extern const char kCrashDumps[]; +extern const char kDumpPixels[]; +extern const char kLayoutTests[]; +extern const char kGenericTheme[]; +extern const char kClassicTheme[]; +extern const char kUxTheme[]; +extern const char kNoErrorDialogs[]; +extern const char kNoTree[]; +extern const char kTestShellTimeOut[]; +extern const char kStartupDialog[]; +extern const char kGPFaultErrorBox[]; +extern const char kJavaScriptFlags[]; +extern const char kRecordMode[]; +extern const char kPlaybackMode[]; +extern const char kNoEvents[]; +extern const char kDumpStatsTable[]; +extern const char kCacheDir[]; +extern const char kDebugMemoryInUse[]; +extern const char kEnableFileCookies[]; +extern const char kEnableTracing[]; +extern const char kAllowScriptsToCloseWindows[]; +extern const char kCheckLayoutTestSystemDeps[]; +extern const char kGDB[]; +extern const char kProfiler[]; } // namespace test_shell |