diff options
107 files changed, 283 insertions, 251 deletions
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc index d0f3f2c..0554398 100644 --- a/ash/extended_desktop_unittest.cc +++ b/ash/extended_desktop_unittest.cc @@ -14,6 +14,7 @@ #include "ash/wm/window_properties.h" #include "ash/wm/window_util.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "ui/aura/client/activation_client.h" #include "ui/aura/client/capture_client.h" #include "ui/aura/client/focus_client.h" @@ -740,20 +741,20 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) { event_generator.PressKey(ui::VKEY_A, 0); event_generator.ReleaseKey(ui::VKEY_A, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); - EXPECT_EQ("a", UTF16ToASCII(textfield->text())); + EXPECT_EQ("a", base::UTF16ToASCII(textfield->text())); event_generator.set_current_host(root_windows[1]->GetHost()); event_generator.PressKey(ui::VKEY_B, 0); event_generator.ReleaseKey(ui::VKEY_B, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); - EXPECT_EQ("ab", UTF16ToASCII(textfield->text())); + EXPECT_EQ("ab", base::UTF16ToASCII(textfield->text())); // Deleting 2nd display. The lock window still should get the events. UpdateDisplay("100x100"); event_generator.PressKey(ui::VKEY_C, 0); event_generator.ReleaseKey(ui::VKEY_C, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); - EXPECT_EQ("abc", UTF16ToASCII(textfield->text())); + EXPECT_EQ("abc", base::UTF16ToASCII(textfield->text())); // Creating 2nd display again, and lock window still should get events // on both root windows. @@ -763,13 +764,13 @@ TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) { event_generator.PressKey(ui::VKEY_D, 0); event_generator.ReleaseKey(ui::VKEY_D, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); - EXPECT_EQ("abcd", UTF16ToASCII(textfield->text())); + EXPECT_EQ("abcd", base::UTF16ToASCII(textfield->text())); event_generator.set_current_host(root_windows[1]->GetHost()); event_generator.PressKey(ui::VKEY_E, 0); event_generator.ReleaseKey(ui::VKEY_E, 0); EXPECT_EQ(lock_widget->GetNativeView(), focus_client->GetFocusedWindow()); - EXPECT_EQ("abcde", UTF16ToASCII(textfield->text())); + EXPECT_EQ("abcde", base::UTF16ToASCII(textfield->text())); } TEST_F(ExtendedDesktopTest, PassiveGrab) { diff --git a/base/command_line.cc b/base/command_line.cc index eb3da4b..be6b4f2 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -81,7 +81,8 @@ void AppendSwitchesAndArguments(CommandLine& command_line, parse_switches &= (arg != kSwitchTerminator); if (parse_switches && IsSwitch(arg, &switch_string, &switch_value)) { #if defined(OS_WIN) - command_line.AppendSwitchNative(WideToASCII(switch_string), switch_value); + command_line.AppendSwitchNative(base::UTF16ToASCII(switch_string), + switch_value); #elif defined(OS_POSIX) command_line.AppendSwitchNative(switch_string, switch_value); #endif @@ -308,7 +309,7 @@ std::string CommandLine::GetSwitchValueASCII( return std::string(); } #if defined(OS_WIN) - return WideToASCII(value); + return base::UTF16ToASCII(value); #else return value; #endif diff --git a/base/files/file_path.cc b/base/files/file_path.cc index 3ea5856..d47becb 100644 --- a/base/files/file_path.cc +++ b/base/files/file_path.cc @@ -633,8 +633,8 @@ string16 FilePath::LossyDisplayName() const { std::string FilePath::MaybeAsASCII() const { if (IsStringASCII(path_)) - return WideToASCII(path_); - return ""; + return UTF16ToASCII(path_); + return std::string(); } std::string FilePath::AsUTF8Unsafe() const { diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc index eb9f315..e514ac1 100644 --- a/base/strings/string_util.cc +++ b/base/strings/string_util.cc @@ -326,20 +326,6 @@ bool ContainsOnlyChars(const StringPiece16& input, } // namespace base -#if !defined(WCHAR_T_IS_UTF16) -bool IsStringASCII(const std::wstring& str); -#endif - -std::string WideToASCII(const std::wstring& wide) { - DCHECK(IsStringASCII(wide)) << wide; - return std::string(wide.begin(), wide.end()); -} - -std::string UTF16ToASCII(const string16& utf16) { - DCHECK(IsStringASCII(utf16)) << utf16; - return std::string(utf16.begin(), utf16.end()); -} - template<class STR> static bool DoIsStringASCII(const STR& str) { for (size_t i = 0; i < str.length(); i++) { @@ -350,17 +336,11 @@ static bool DoIsStringASCII(const STR& str) { return true; } -#if !defined(WCHAR_T_IS_UTF16) -bool IsStringASCII(const std::wstring& str) { - return DoIsStringASCII(str); -} -#endif - -bool IsStringASCII(const string16& str) { +bool IsStringASCII(const base::StringPiece& str) { return DoIsStringASCII(str); } -bool IsStringASCII(const base::StringPiece& str) { +bool IsStringASCII(const base::string16& str) { return DoIsStringASCII(str); } diff --git a/base/strings/string_util.h b/base/strings/string_util.h index c6fe14a..473deae 100644 --- a/base/strings/string_util.h +++ b/base/strings/string_util.h @@ -19,8 +19,6 @@ #include "base/strings/string16.h" #include "base/strings/string_piece.h" // For implicit conversions. -// Safe standard library wrappers for all platforms. - namespace base { // C standard-library functions like "strncasecmp" and "snprintf" that aren't @@ -246,11 +244,6 @@ BASE_EXPORT bool ContainsOnlyChars(const StringPiece16& input, #error Define string operations appropriately for your platform #endif -// Converts to 7-bit ASCII by truncating. The result must be known to be ASCII -// beforehand. -BASE_EXPORT std::string WideToASCII(const std::wstring& wide); -BASE_EXPORT std::string UTF16ToASCII(const base::string16& utf16); - // Returns true if the specified string matches the criteria. How can a wide // string be 8-bit or UTF8? It contains only characters that are < 256 (in the // first case) or characters that use only 8-bits and whose 8-bit diff --git a/base/strings/string_util_unittest.cc b/base/strings/string_util_unittest.cc index 3434e11..e447cdc 100644 --- a/base/strings/string_util_unittest.cc +++ b/base/strings/string_util_unittest.cc @@ -400,20 +400,20 @@ TEST(StringUtilTest, ConvertASCII) { for (size_t i = 0; i < arraysize(char_cases); ++i) { EXPECT_TRUE(IsStringASCII(char_cases[i])); - std::wstring wide = ASCIIToWide(char_cases[i]); - EXPECT_EQ(wchar_cases[i], wide); + string16 utf16 = ASCIIToUTF16(char_cases[i]); + EXPECT_EQ(WideToUTF16(wchar_cases[i]), utf16); - std::string ascii = WideToASCII(wchar_cases[i]); + std::string ascii = UTF16ToASCII(WideToUTF16(wchar_cases[i])); EXPECT_EQ(char_cases[i], ascii); } EXPECT_FALSE(IsStringASCII("Google \x80Video")); // Convert empty strings. - std::wstring wempty; + string16 empty16; std::string empty; - EXPECT_EQ(empty, WideToASCII(wempty)); - EXPECT_EQ(wempty, ASCIIToWide(empty)); + EXPECT_EQ(empty, UTF16ToASCII(empty16)); + EXPECT_EQ(empty16, ASCIIToUTF16(empty)); // Convert strings with an embedded NUL character. const char chars_with_nul[] = "test\0string"; @@ -422,7 +422,7 @@ TEST(StringUtilTest, ConvertASCII) { std::wstring wide_with_nul = ASCIIToWide(string_with_nul); EXPECT_EQ(static_cast<std::wstring::size_type>(length_with_nul), wide_with_nul.length()); - std::string narrow_with_nul = WideToASCII(wide_with_nul); + std::string narrow_with_nul = UTF16ToASCII(WideToUTF16(wide_with_nul)); EXPECT_EQ(static_cast<std::string::size_type>(length_with_nul), narrow_with_nul.length()); EXPECT_EQ(0, string_with_nul.compare(narrow_with_nul)); diff --git a/base/strings/utf_string_conversions.cc b/base/strings/utf_string_conversions.cc index c3ea4f2..f13ed1b 100644 --- a/base/strings/utf_string_conversions.cc +++ b/base/strings/utf_string_conversions.cc @@ -182,4 +182,9 @@ string16 ASCIIToUTF16(const StringPiece& ascii) { return string16(ascii.begin(), ascii.end()); } +std::string UTF16ToASCII(const string16& utf16) { + DCHECK(IsStringASCII(utf16)) << UTF16ToUTF8(utf16); + return std::string(utf16.begin(), utf16.end()); +} + } // namespace base diff --git a/base/strings/utf_string_conversions.h b/base/strings/utf_string_conversions.h index fa245ea..242cd66 100644 --- a/base/strings/utf_string_conversions.h +++ b/base/strings/utf_string_conversions.h @@ -44,6 +44,10 @@ BASE_EXPORT std::string UTF16ToUTF8(const string16& utf16); BASE_EXPORT std::wstring ASCIIToWide(const StringPiece& ascii); BASE_EXPORT string16 ASCIIToUTF16(const StringPiece& ascii); +// Converts to 7-bit ASCII by truncating. The result must be known to be ASCII +// beforehand. +BASE_EXPORT std::string UTF16ToASCII(const string16& utf16); + } // namespace base // We are trying to get rid of wstring as much as possible, but it's too big a diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index 884922e..e8c0900 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -208,7 +208,7 @@ base::string16 GetCurrentModuleVersion() { FileVersionInfo::CreateFileVersionInfoForCurrentModule()); if (file_version_info.get()) { base::string16 version_string(file_version_info->file_version()); - if (Version(WideToASCII(version_string)).IsValid()) + if (Version(base::UTF16ToASCII(version_string)).IsValid()) return version_string; } return base::string16(); diff --git a/chrome/browser/autocomplete/autocomplete_input.cc b/chrome/browser/autocomplete/autocomplete_input.cc index 48670e7..ea42851 100644 --- a/chrome/browser/autocomplete/autocomplete_input.cc +++ b/chrome/browser/autocomplete/autocomplete_input.cc @@ -186,7 +186,7 @@ AutocompleteInput::Type AutocompleteInput::Parse( // the renderer handles internally without reaching the net::URLRequest // logic. They thus won't be listed as "handled protocols", but we should // still claim to handle them. - if (ProfileIOData::IsHandledProtocol(UTF16ToASCII(parsed_scheme)) || + if (ProfileIOData::IsHandledProtocol(base::UTF16ToASCII(parsed_scheme)) || LowerCaseEqualsASCII(parsed_scheme, content::kViewSourceScheme) || LowerCaseEqualsASCII(parsed_scheme, content::kJavaScriptScheme) || LowerCaseEqualsASCII(parsed_scheme, content::kDataScheme)) diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index be4653e..9ddf27e 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc @@ -431,7 +431,7 @@ void BackgroundContentsService::Observe( if (type == chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED) { BackgroundContents* bg = content::Details<BackgroundContents>(details).ptr(); - std::string extension_id = UTF16ToASCII( + std::string extension_id = base::UTF16ToASCII( BackgroundContentsServiceFactory::GetForProfile(profile)-> GetParentApplicationId(bg)); extension = @@ -738,7 +738,7 @@ void BackgroundContentsService::BackgroundContentsOpened( contents_map_[details->application_id].contents = details->contents; contents_map_[details->application_id].frame_name = details->frame_name; - ScheduleCloseBalloon(UTF16ToASCII(details->application_id)); + ScheduleCloseBalloon(base::UTF16ToASCII(details->application_id)); } // Used by test code and debug checks to verify whether a given diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index 59e34e3..65139b3 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -859,7 +859,7 @@ void PopulateBookmarkNode(TestNode* parent, PopulateBookmarkNode(child, model, new_bb_node); } else { model->AddURL(bb_node, i, child->GetTitle(), - GURL("http://" + UTF16ToASCII(child->GetTitle()))); + GURL("http://" + base::UTF16ToASCII(child->GetTitle()))); } } } @@ -1022,10 +1022,10 @@ TEST_F(BookmarkModelTest, Reorder) { // Make sure the order matches is correct (it should be reversed). ASSERT_EQ(4, parent->child_count()); - EXPECT_EQ("D", UTF16ToASCII(parent->GetChild(0)->GetTitle())); - EXPECT_EQ("C", UTF16ToASCII(parent->GetChild(1)->GetTitle())); - EXPECT_EQ("B", UTF16ToASCII(parent->GetChild(2)->GetTitle())); - EXPECT_EQ("A", UTF16ToASCII(parent->GetChild(3)->GetTitle())); + EXPECT_EQ("D", base::UTF16ToASCII(parent->GetChild(0)->GetTitle())); + EXPECT_EQ("C", base::UTF16ToASCII(parent->GetChild(1)->GetTitle())); + EXPECT_EQ("B", base::UTF16ToASCII(parent->GetChild(2)->GetTitle())); + EXPECT_EQ("A", base::UTF16ToASCII(parent->GetChild(3)->GetTitle())); } TEST_F(BookmarkModelTest, NodeVisibility) { diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 6c4cee6..8eb447b 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -244,10 +244,10 @@ PrefService* InitializeLocalState( // language the user selected when downloading the installer. This // becomes our default language in the prefs. // Other platforms obey the system locale. - std::wstring install_lang; + base::string16 install_lang; if (GoogleUpdateSettings::GetLanguage(&install_lang)) { local_state->SetString(prefs::kApplicationLocale, - WideToASCII(install_lang)); + base::UTF16ToASCII(install_lang)); } } #endif // defined(OS_WIN) diff --git a/chrome/browser/chromeos/login/supervised_user_manager_impl.cc b/chrome/browser/chromeos/login/supervised_user_manager_impl.cc index bb00ab8..c004097 100644 --- a/chrome/browser/chromeos/login/supervised_user_manager_impl.cc +++ b/chrome/browser/chromeos/login/supervised_user_manager_impl.cc @@ -334,7 +334,7 @@ void SupervisedUserManagerImpl::StartCreationTransaction( const base::string16& display_name) { g_browser_process->local_state()-> SetString(kLocallyManagedUserCreationTransactionDisplayName, - UTF16ToASCII(display_name)); + base::UTF16ToASCII(display_name)); g_browser_process->local_state()->CommitPendingWrite(); } diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.cc b/chrome/browser/chromeos/memory/oom_priority_manager.cc index c5018c2..c010068 100644 --- a/chrome/browser/chromeos/memory/oom_priority_manager.cc +++ b/chrome/browser/chromeos/memory/oom_priority_manager.cc @@ -137,7 +137,7 @@ void OomMemoryDetails::OnDetailsAvailable() { base::SystemMemoryInfoKB memory; if (base::GetSystemMemoryInfo(&memory) && memory.gem_size != -1) { log_string += "Graphics "; - log_string += UTF16ToASCII(ui::FormatBytes(memory.gem_size)); + log_string += base::UTF16ToASCII(ui::FormatBytes(memory.gem_size)); } LOG(WARNING) << "OOM details (" << delta.InMilliseconds() << " ms):\n" << log_string; diff --git a/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc b/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc index 34b496c..c05eafd 100644 --- a/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc +++ b/chrome/browser/chromeos/profiles/profile_list_chromeos_unittest.cc @@ -78,7 +78,7 @@ class ProfileListChromeOSTest : public testing::Test { } void AddProfile(base::string16 name, bool log_in) { - std::string email_string = UTF16ToASCII(name) + "@example.com"; + std::string email_string = base::UTF16ToASCII(name) + "@example.com"; // Add a user to the fake user manager. GetFakeUserManager()->AddUser(email_string); @@ -181,7 +181,7 @@ TEST_F(ProfileListChromeOSTest, DontShowManagedUsers) { cache->GetUserDataDir().AppendASCII("p2"), managed_name, base::string16(), 0, "TEST_ID"); - GetFakeUserManager()->AddUser(UTF16ToASCII(managed_name)); + GetFakeUserManager()->AddUser(base::UTF16ToASCII(managed_name)); AvatarMenu* menu = GetAvatarMenu(); ASSERT_EQ(1U, menu->GetNumberOfItems()); @@ -225,7 +225,7 @@ TEST_F(ProfileListChromeOSTest, ActiveItem) { AddProfile(name2, true); // Initialize ProfileHelper, it will be accessed from GetActiveProfileIndex. - std::string email_string = UTF16ToASCII(name1) + "@example.com"; + std::string email_string = base::UTF16ToASCII(name1) + "@example.com"; std::string hash = email_string + kUserIdHashSuffix; ActiveUserChanged( g_browser_process->platform_part()->profile_helper(), hash); @@ -261,7 +261,7 @@ TEST_F(ProfileListChromeOSTest, ModifyingNameResortsCorrectly) { // Change name of the first profile, to trigger resorting of the profiles: // now the first menu item should be named "beta", and the second be "gamma". GetFakeUserManager()->SaveUserDisplayName( - UTF16ToASCII(name1) + "@example.com", newname1); + base::UTF16ToASCII(name1) + "@example.com", newname1); manager()->profile_info_cache()->SetNameOfProfileAtIndex(0, newname1); const AvatarMenu::Item& item1next = menu->GetItemAt(0); diff --git a/chrome/browser/component_updater/component_patcher_win.cc b/chrome/browser/component_updater/component_patcher_win.cc index 9e38c0c..8935f42 100644 --- a/chrome/browser/component_updater/component_patcher_win.cc +++ b/chrome/browser/component_updater/component_patcher_win.cc @@ -13,6 +13,7 @@ #include "base/process/kill.h" #include "base/process/launch.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "base/win/scoped_handle.h" #include "chrome/installer/util/util_constants.h" @@ -39,8 +40,8 @@ base::FilePath FindSetupProgram() { if (!PathService::Get(base::DIR_MODULE, &exe_dir)) return base::FilePath(); - const std::string installer_dir(WideToASCII(installer::kInstallerDir)); - const std::string setup_exe(WideToASCII(installer::kSetupExe)); + const std::string installer_dir(base::UTF16ToASCII(installer::kInstallerDir)); + const std::string setup_exe(base::UTF16ToASCII(installer::kSetupExe)); base::FilePath setup_path = exe_dir; setup_path = setup_path.AppendASCII(installer_dir); diff --git a/chrome/browser/devtools/adb/android_usb_device.cc b/chrome/browser/devtools/adb/android_usb_device.cc index e5b5ab8..c383a7d 100644 --- a/chrome/browser/devtools/adb/android_usb_device.cc +++ b/chrome/browser/devtools/adb/android_usb_device.cc @@ -13,6 +13,7 @@ #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/browser/devtools/adb/android_rsa.h" #include "chrome/browser/devtools/adb/android_usb_socket.h" #include "chrome/browser/usb/usb_device.h" @@ -98,7 +99,7 @@ scoped_refptr<AndroidUsbDevice> ClaimInterface( if (!usb_handle->GetSerial(&serial) || serial.empty()) return NULL; - return new AndroidUsbDevice(rsa_key, usb_handle, UTF16ToASCII(serial), + return new AndroidUsbDevice(rsa_key, usb_handle, base::UTF16ToASCII(serial), inbound_address, outbound_address, zero_mask); } diff --git a/chrome/browser/download/download_extensions.cc b/chrome/browser/download/download_extensions.cc index 5dab5fb..4d36aa0 100644 --- a/chrome/browser/download/download_extensions.cc +++ b/chrome/browser/download/download_extensions.cc @@ -8,6 +8,7 @@ #include "chrome/browser/download/download_extensions.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "net/base/mime_util.h" #include "net/base/net_util.h" @@ -211,7 +212,7 @@ DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) { if (!IsStringASCII(extension)) return NOT_DANGEROUS; #if defined(OS_WIN) - std::string ascii_extension = WideToASCII(extension); + std::string ascii_extension = base::UTF16ToASCII(extension); #elif defined(OS_POSIX) std::string ascii_extension = extension; #endif diff --git a/chrome/browser/enumerate_modules_model_unittest_win.cc b/chrome/browser/enumerate_modules_model_unittest_win.cc index 4c15a0a..68ec154 100644 --- a/chrome/browser/enumerate_modules_model_unittest_win.cc +++ b/chrome/browser/enumerate_modules_model_unittest_win.cc @@ -204,7 +204,7 @@ TEST_F(EnumerateModulesTest, MatchFunction) { kMatchineEntryList[i].blacklist; SCOPED_TRACE("Test case no " + base::IntToString(i) + - ": '" + UTF16ToASCII(test.name) + "'"); + ": '" + base::UTF16ToASCII(test.name) + "'"); EXPECT_EQ(kMatchineEntryList[i].expected_result, ModuleEnumerator::Match(test, blacklist)); } @@ -235,8 +235,8 @@ TEST_F(EnumerateModulesTest, CollapsePath) { module.location = kCollapsePathList[i].test_case; module_enumerator->CollapsePath(&module); - SCOPED_TRACE("Test case no " + base::IntToString(i) + - ": '" + UTF16ToASCII(kCollapsePathList[i].expected_result) + + SCOPED_TRACE("Test case no " + base::IntToString(i) + ": '" + + base::UTF16ToASCII(kCollapsePathList[i].expected_result) + "'"); EXPECT_EQ(kCollapsePathList[i].expected_result, module.location); } diff --git a/chrome/browser/enumerate_modules_model_win.cc b/chrome/browser/enumerate_modules_model_win.cc index 0cb554e..a3597c3 100644 --- a/chrome/browser/enumerate_modules_model_win.cc +++ b/chrome/browser/enumerate_modules_model_win.cc @@ -384,7 +384,7 @@ ModuleEnumerator::ModuleStatus ModuleEnumerator::Match( location_hash == blacklisted.location)) { // We have a name match against the blacklist (and possibly location match // also), so check version. - Version module_version(UTF16ToASCII(module.version)); + Version module_version(base::UTF16ToASCII(module.version)); Version version_min(blacklisted.version_from); Version version_max(blacklisted.version_to); bool version_ok = !version_min.IsValid() && !version_max.IsValid(); @@ -644,7 +644,7 @@ void ModuleEnumerator::PreparePathMappings() { for (std::vector<base::string16>::const_iterator variable = env_vars.begin(); variable != env_vars.end(); ++variable) { std::string path; - if (environment->GetVar(WideToASCII(*variable).c_str(), &path)) { + if (environment->GetVar(base::UTF16ToASCII(*variable).c_str(), &path)) { path_mapping_.push_back( std::make_pair(base::i18n::ToLower(base::UTF8ToUTF16(path)) + L"\\", L"%" + base::i18n::ToLower(*variable) + L"%")); diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc index 2961a2c..e7c1174 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc @@ -117,7 +117,7 @@ bool GetPacUrlFromExtensionPref(const base::DictionaryValue* proxy_config, "(encode URLs in Punycode format)."; return false; } - *out = UTF16ToASCII(pac_url16); + *out = base::UTF16ToASCII(pac_url16); return true; } @@ -142,7 +142,7 @@ bool GetPacDataFromExtensionPref(const base::DictionaryValue* proxy_config, "(encode URLs in Punycode format)."; return false; } - *out = UTF16ToASCII(pac_data16); + *out = base::UTF16ToASCII(pac_data16); return true; } @@ -176,7 +176,7 @@ bool GetProxyServer(const base::DictionaryValue* proxy_server, base::UTF16ToUTF8(host16)); return false; } - std::string host = UTF16ToASCII(host16); + std::string host = base::UTF16ToASCII(host16); int port; // optional. if (!proxy_server->GetInteger(keys::kProxyConfigRulePort, &port)) @@ -277,7 +277,7 @@ bool JoinUrlList(const base::ListValue* list, "(encode URLs in Punycode format)."; return false; } - result.append(UTF16ToASCII(entry)); + result.append(base::UTF16ToASCII(entry)); } *out = result; return true; diff --git a/chrome/browser/extensions/external_pref_loader.cc b/chrome/browser/extensions/external_pref_loader.cc index 99572ce..49edcac 100644 --- a/chrome/browser/extensions/external_pref_loader.cc +++ b/chrome/browser/extensions/external_pref_loader.cc @@ -210,7 +210,7 @@ void ExternalPrefLoader::ReadStandaloneExtensionPrefFiles( std::string id = #if defined(OS_WIN) - WideToASCII( + base::UTF16ToASCII( extension_candidate_path.RemoveExtension().BaseName().value()); #elif defined(OS_POSIX) extension_candidate_path.RemoveExtension().BaseName().value().c_str(); diff --git a/chrome/browser/extensions/external_registry_loader_win.cc b/chrome/browser/extensions/external_registry_loader_win.cc index ed8e2c0..d988f49 100644 --- a/chrome/browser/extensions/external_registry_loader_win.cc +++ b/chrome/browser/extensions/external_registry_loader_win.cc @@ -86,7 +86,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { } } - std::string id = WideToASCII(*it); + std::string id = base::UTF16ToASCII(*it); StringToLowerASCII(&id); if (!Extension::IdIsValid(id)) { LOG(ERROR) << "Invalid id value " << id @@ -101,7 +101,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { == ERROR_SUCCESS) { prefs->SetString( id + "." + ExternalProviderImpl::kExternalUpdateUrl, - WideToASCII(extension_update_url)); + base::UTF16ToASCII(extension_update_url)); continue; } @@ -146,7 +146,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { continue; } - Version version(WideToASCII(extension_version)); + Version version(base::UTF16ToASCII(extension_version)); if (!version.IsValid()) { LOG(ERROR) << "Invalid version value " << extension_version << " for key " << key_path << "."; @@ -155,7 +155,7 @@ void ExternalRegistryLoader::LoadOnFileThread() { prefs->SetString( id + "." + ExternalProviderImpl::kExternalVersion, - WideToASCII(extension_version)); + base::UTF16ToASCII(extension_version)); prefs->SetString( id + "." + ExternalProviderImpl::kExternalCrx, extension_path_str); diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc index 1ebbe66..bfba698 100644 --- a/chrome/browser/file_select_helper.cc +++ b/chrome/browser/file_select_helper.cc @@ -250,7 +250,7 @@ FileSelectHelper::GetFileTypesFromAcceptType( int valid_type_count = 0; int description_id = 0; for (size_t i = 0; i < accept_types.size(); ++i) { - std::string ascii_type = UTF16ToASCII(accept_types[i]); + std::string ascii_type = base::UTF16ToASCII(accept_types[i]); if (!IsAcceptTypeValid(ascii_type)) continue; diff --git a/chrome/browser/google/google_util.cc b/chrome/browser/google/google_util.cc index 50ae223..53c4626 100644 --- a/chrome/browser/google/google_util.cc +++ b/chrome/browser/google/google_util.cc @@ -139,7 +139,7 @@ bool GetBrand(std::string* brand) { base::string16 brand16; bool ret = GoogleUpdateSettings::GetBrand(&brand16); if (ret) - brand->assign(WideToASCII(brand16)); + brand->assign(base::UTF16ToASCII(brand16)); return ret; } @@ -147,7 +147,7 @@ bool GetReactivationBrand(std::string* brand) { base::string16 brand16; bool ret = GoogleUpdateSettings::GetReactivationBrand(&brand16); if (ret) - brand->assign(WideToASCII(brand16)); + brand->assign(base::UTF16ToASCII(brand16)); return ret; } diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc index 5739a77..a725f84 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller_unittest.cc @@ -33,7 +33,7 @@ namespace { std::string GalleryName(const MediaGalleryPrefInfo& gallery) { base::string16 name = gallery.GetGalleryDisplayName(); - return UTF16ToASCII(name); + return base::UTF16ToASCII(name); } class MockMediaGalleriesDialog diff --git a/chrome/browser/parsers/metadata_parser_filebase_unittest.cc b/chrome/browser/parsers/metadata_parser_filebase_unittest.cc index 2924128..99d4566 100644 --- a/chrome/browser/parsers/metadata_parser_filebase_unittest.cc +++ b/chrome/browser/parsers/metadata_parser_filebase_unittest.cc @@ -9,7 +9,7 @@ #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/string_util.h" // TODO(brettw) remove when WideToASCII moves. +#include "base/strings/utf_string_conversions.h" #include "chrome/browser/parsers/metadata_parser_filebase.h" #include "testing/gtest/include/gtest/gtest.h" @@ -34,7 +34,7 @@ class FileMetaDataParserTest : public testing::Test { #if defined(OS_POSIX) return test_file_.BaseName().value(); #elif defined(OS_WIN) - return WideToASCII(test_file_.BaseName().value()); + return base::UTF16ToASCII(test_file_.BaseName().value()); #endif // defined(OS_POSIX) } diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index 350c029..6e85849 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc @@ -364,7 +364,7 @@ void ProfileManager::CreateProfileAsync( ProfileInfoCache& cache = GetProfileInfoCache(); // Get the icon index from the user's icon url size_t icon_index; - std::string icon_url_std = UTF16ToASCII(icon_url); + std::string icon_url_std = base::UTF16ToASCII(icon_url); if (cache.IsDefaultAvatarIconUrl(icon_url_std, &icon_index)) { // add profile to cache with user selected name and avatar cache.AddProfileToCache(profile_path, name, base::string16(), icon_index, diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index f54d191..00882db 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -137,8 +137,8 @@ bool SendFinancialPing(const std::string& brand, rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX, RLZTracker::CHROME_HOME_PAGE, rlz_lib::NO_ACCESS_POINT}; - std::string lang_ascii(UTF16ToASCII(lang)); - std::string referral_ascii(UTF16ToASCII(referral)); + std::string lang_ascii(base::UTF16ToASCII(lang)); + std::string referral_ascii(base::UTF16ToASCII(referral)); std::string product_signature; #if defined(OS_CHROMEOS) product_signature = "chromeos"; diff --git a/chrome/browser/search/search_unittest.cc b/chrome/browser/search/search_unittest.cc index f205e11..e3c1cec 100644 --- a/chrome/browser/search/search_unittest.cc +++ b/chrome/browser/search/search_unittest.cc @@ -827,8 +827,8 @@ TEST_F(SearchTest, ExtractSearchTermsFromURL) { const ExtractSearchTermsTestCase& test = kTestCases[i]; EXPECT_EQ( test.expected_result, - UTF16ToASCII(chrome::ExtractSearchTermsFromURL(profile(), - GURL(test.url)))) + base::UTF16ToASCII(chrome::ExtractSearchTermsFromURL(profile(), + GURL(test.url)))) << test.url << " " << test.comment; } } diff --git a/chrome/browser/search_engines/template_url_parser.cc b/chrome/browser/search_engines/template_url_parser.cc index 7ccad03..44a654f 100644 --- a/chrome/browser/search_engines/template_url_parser.cc +++ b/chrome/browser/search_engines/template_url_parser.cc @@ -260,7 +260,7 @@ void TemplateURLParsingContext::EndElementImpl(void* ctx, const xmlChar* name) { break; } case TemplateURLParsingContext::INPUT_ENCODING: { - std::string input_encoding = UTF16ToASCII(context->string_); + std::string input_encoding = base::UTF16ToASCII(context->string_); if (IsValidEncodingString(input_encoding)) context->data_.input_encodings.push_back(input_encoding); break; diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index 1e107b0..91704e0 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -216,7 +216,7 @@ void LogDuplicatesHistogram( std::map<std::string, int> duplicates; for (TemplateURLService::TemplateURLVector::const_iterator it = template_urls.begin(); it != template_urls.end(); ++it) { - std::string keyword = UTF16ToASCII((*it)->keyword()); + std::string keyword = base::UTF16ToASCII((*it)->keyword()); base::TrimString(keyword, "_", &keyword); duplicates[keyword]++; } diff --git a/chrome/browser/sync/test/integration/search_engines_helper.cc b/chrome/browser/sync/test/integration/search_engines_helper.cc index 2a1baa1..6f427f4 100644 --- a/chrome/browser/sync/test/integration/search_engines_helper.cc +++ b/chrome/browser/sync/test/integration/search_engines_helper.cc @@ -39,8 +39,9 @@ GUIDToTURLMap CreateGUIDToTURLMap(TemplateURLService* service) { std::string GetTURLInfoString(const TemplateURL* turl) { DCHECK(turl); - return "TemplateURL: shortname: " + UTF16ToASCII(turl->short_name()) + - " keyword: " + UTF16ToASCII(turl->keyword()) + " url: " + turl->url(); + return "TemplateURL: shortname: " + base::UTF16ToASCII(turl->short_name()) + + " keyword: " + base::UTF16ToASCII(turl->keyword()) + " url: " + + turl->url(); } bool TURLsMatch(const TemplateURL* turl1, const TemplateURL* turl2) { diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index c540f7f..8e381ae 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -685,8 +685,9 @@ void SyncTest::DisableNotificationsImpl() { std::string path = "chromiumsync/disablenotifications"; ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); ASSERT_EQ("Notifications disabled", - UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> - GetTitle())); + base::UTF16ToASCII( + browser()->tab_strip_model()->GetActiveWebContents()-> + GetTitle())); } void SyncTest::DisableNotifications() { @@ -699,8 +700,9 @@ void SyncTest::EnableNotificationsImpl() { std::string path = "chromiumsync/enablenotifications"; ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); ASSERT_EQ("Notifications enabled", - UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> - GetTitle())); + base::UTF16ToASCII( + browser()->tab_strip_model()->GetActiveWebContents()-> + GetTitle())); } void SyncTest::EnableNotifications() { @@ -721,8 +723,9 @@ void SyncTest::TriggerNotification(syncer::ModelTypeSet changed_types) { syncer::kSyncP2PNotificationChannel + "&data=" + data; ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); ASSERT_EQ("Notification sent", - UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> - GetTitle())); + base::UTF16ToASCII( + browser()->tab_strip_model()->GetActiveWebContents()-> + GetTitle())); } bool SyncTest::ServerSupportsErrorTriggering() const { @@ -746,8 +749,9 @@ void SyncTest::TriggerMigrationDoneError(syncer::ModelTypeSet model_types) { } ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); ASSERT_EQ("Migration: 200", - UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> - GetTitle())); + base::UTF16ToASCII( + browser()->tab_strip_model()->GetActiveWebContents()-> + GetTitle())); } void SyncTest::TriggerBirthdayError() { @@ -755,8 +759,9 @@ void SyncTest::TriggerBirthdayError() { std::string path = "chromiumsync/birthdayerror"; ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); ASSERT_EQ("Birthday error", - UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> - GetTitle())); + base::UTF16ToASCII( + browser()->tab_strip_model()->GetActiveWebContents()-> + GetTitle())); } void SyncTest::TriggerTransientError() { @@ -764,8 +769,9 @@ void SyncTest::TriggerTransientError() { std::string path = "chromiumsync/transienterror"; ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); ASSERT_EQ("Transient error", - UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> - GetTitle())); + base::UTF16ToASCII( + browser()->tab_strip_model()->GetActiveWebContents()-> + GetTitle())); } void SyncTest::TriggerAuthState(PythonServerAuthState auth_state) { @@ -850,7 +856,7 @@ void SyncTest::TriggerSyncError(const syncer::SyncProtocolError& error, path.append(base::StringPrintf("&frequency=%d", frequency)); ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); - std::string output = UTF16ToASCII( + std::string output = base::UTF16ToASCII( browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); ASSERT_TRUE(output.find("SetError: 200") != base::string16::npos); } @@ -860,8 +866,9 @@ void SyncTest::TriggerCreateSyncedBookmarks() { std::string path = "chromiumsync/createsyncedbookmarks"; ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); ASSERT_EQ("Synced Bookmarks", - UTF16ToASCII(browser()->tab_strip_model()->GetActiveWebContents()-> - GetTitle())); + base::UTF16ToASCII( + browser()->tab_strip_model()->GetActiveWebContents()-> + GetTitle())); } void SyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, diff --git a/chrome/browser/task_manager/task_manager_browsertest_util.cc b/chrome/browser/task_manager/task_manager_browsertest_util.cc index 277e572..e3ebee1 100644 --- a/chrome/browser/task_manager/task_manager_browsertest_util.cc +++ b/chrome/browser/task_manager/task_manager_browsertest_util.cc @@ -116,13 +116,13 @@ class ResourceChangeObserver : public TaskManagerModelObserver { testing::Message task_manager_state_dump; task_manager_state_dump << "Waiting for exactly " << required_count_ << " matches of wildcard pattern \"" - << UTF16ToASCII(title_pattern_) << "\"\n"; + << base::UTF16ToASCII(title_pattern_) << "\"\n"; task_manager_state_dump << "Currently there are " << CountMatches() << " matches.\n"; task_manager_state_dump << "Current Task Manager Model is:\n"; for (int i = 0; i < model_->ResourceCount(); i++) { task_manager_state_dump - << " > " << UTF16ToASCII(model_->GetResourceTitle(i)) << "\n"; + << " > " << base::UTF16ToASCII(model_->GetResourceTitle(i)) << "\n"; } return task_manager_state_dump; } diff --git a/chrome/browser/translate/translate_browsertest.cc b/chrome/browser/translate/translate_browsertest.cc index 0f17fcb..62a7fec 100644 --- a/chrome/browser/translate/translate_browsertest.cc +++ b/chrome/browser/translate/translate_browsertest.cc @@ -190,7 +190,7 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, TranslateInIsolatedWorld) { // Wait for the page title is changed after the test finished. const base::string16 result = watcher.WaitAndGetTitle(); - EXPECT_EQ("PASS", UTF16ToASCII(result)); + EXPECT_EQ("PASS", base::UTF16ToASCII(result)); } IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, IgnoreRefreshMetaTag) { @@ -220,7 +220,7 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, IgnoreRefreshMetaTag) { // Wait for the page title is changed after the test finished. const base::string16 result = watcher.WaitAndGetTitle(); - EXPECT_EQ("PASS", UTF16ToASCII(result)); + EXPECT_EQ("PASS", base::UTF16ToASCII(result)); // Check if there is no Translate infobar. translate = GetExistingTranslateInfoBarDelegate(); @@ -255,7 +255,7 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, // Wait for the page title is changed after the test finished. const base::string16 result = watcher.WaitAndGetTitle(); - EXPECT_EQ("PASS", UTF16ToASCII(result)); + EXPECT_EQ("PASS", base::UTF16ToASCII(result)); // Check if there is no Translate infobar. translate = GetExistingTranslateInfoBarDelegate(); @@ -289,7 +289,7 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, IgnoreRefreshMetaTagAtOnload) { // Wait for the page title is changed after the test finished. const base::string16 result = watcher.WaitAndGetTitle(); - EXPECT_EQ("PASS", UTF16ToASCII(result)); + EXPECT_EQ("PASS", base::UTF16ToASCII(result)); // Check if there is no Translate infobar. translate = GetExistingTranslateInfoBarDelegate(); @@ -323,7 +323,7 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, UpdateLocation) { // Wait for the page title is changed after the test finished. const base::string16 result = watcher.WaitAndGetTitle(); - EXPECT_EQ("PASS", UTF16ToASCII(result)); + EXPECT_EQ("PASS", base::UTF16ToASCII(result)); // Check if there is no Translate infobar. translate = GetExistingTranslateInfoBarDelegate(); @@ -357,7 +357,7 @@ IN_PROC_BROWSER_TEST_F(TranslateBrowserTest, UpdateLocationAtOnload) { // Wait for the page title is changed after the test finished. const base::string16 result = watcher.WaitAndGetTitle(); - EXPECT_EQ("PASS", UTF16ToASCII(result)); + EXPECT_EQ("PASS", base::UTF16ToASCII(result)); // Check if there is no Translate infobar. translate = GetExistingTranslateInfoBarDelegate(); diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc index e1dd9b8..234665b 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc @@ -2924,7 +2924,7 @@ void AutofillDialogControllerImpl::SuggestionsUpdated() { const AutofillProfile& profile = *profiles[i]; if (!i18ninput::AddressHasCompleteAndVerifiedData(profile) || !i18ninput::CountryIsFullySupported( - UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)))) { + base::UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)))) { continue; } @@ -3170,7 +3170,7 @@ bool AutofillDialogControllerImpl::ShouldSuggestProfile( DialogSection section, const AutofillProfile& profile) { std::string country_code = - UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)); + base::UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)); return country_code.empty() || CanAcceptCountry(section, country_code); } diff --git a/chrome/browser/ui/autofill/data_model_wrapper.cc b/chrome/browser/ui/autofill/data_model_wrapper.cc index d2cc22f..25e1673 100644 --- a/chrome/browser/ui/autofill/data_model_wrapper.cc +++ b/chrome/browser/ui/autofill/data_model_wrapper.cc @@ -27,9 +27,6 @@ namespace autofill { -using base::ASCIIToUTF16; -using base::UTF16ToUTF8; - DataModelWrapper::~DataModelWrapper() {} void DataModelWrapper::FillInputs(DetailInputs* inputs) { @@ -67,9 +64,9 @@ bool DataModelWrapper::GetDisplayText( base::string16 non_address_info; base::string16 email = GetInfoForDisplay(AutofillType(EMAIL_ADDRESS)); if (!email.empty()) - non_address_info += ASCIIToUTF16("\n") + email; + non_address_info += base::ASCIIToUTF16("\n") + email; - non_address_info += ASCIIToUTF16("\n") + phone; + non_address_info += base::ASCIIToUTF16("\n") + phone; // The separator is locale-specific. std::string compact_separator = @@ -137,8 +134,9 @@ base::string16 AutofillProfileWrapper::GetInfoForDisplay( // If there is no user-defined formatting at all, add some standard // formatting. - if (base::ContainsOnlyChars(phone_number, ASCIIToUTF16("0123456789"))) { - std::string region = UTF16ToASCII( + if (base::ContainsOnlyChars(phone_number, + base::ASCIIToUTF16("0123456789"))) { + std::string region = base::UTF16ToASCII( GetInfo(AutofillType(HTML_TYPE_COUNTRY_CODE, HTML_MODE_NONE))); i18n::PhoneObject phone(phone_number, region); return phone.GetFormattedNumber(); @@ -289,7 +287,8 @@ bool WalletInstrumentWrapper::GetDisplayText( // TODO(estade): descriptive_name() is user-provided. Should we use it or // just type + last 4 digits? - base::string16 line1 = instrument_->descriptive_name() + ASCIIToUTF16("\n"); + base::string16 line1 = + instrument_->descriptive_name() + base::ASCIIToUTF16("\n"); *vertically_compact = line1 + *vertically_compact; *horizontally_compact = line1 + *horizontally_compact; return true; diff --git a/chrome/browser/ui/search/instant_search_prerenderer_unittest.cc b/chrome/browser/ui/search/instant_search_prerenderer_unittest.cc index 9216c4e..f4ba748 100644 --- a/chrome/browser/ui/search/instant_search_prerenderer_unittest.cc +++ b/chrome/browser/ui/search/instant_search_prerenderer_unittest.cc @@ -237,15 +237,17 @@ TEST_F(InstantSearchPrerendererTest, GetSearchTermsFromPrerenderedPage) { GURL url(GetPrerenderURL()); EXPECT_EQ(GURL("https://www.google.com/instant?ion=1&foo=foo#foo=foo&strk"), url); - EXPECT_EQ(UTF16ToASCII(prerenderer->get_last_query()), - UTF16ToASCII(chrome::ExtractSearchTermsFromURL(profile(), url))); + EXPECT_EQ(base::UTF16ToASCII(prerenderer->get_last_query()), + base::UTF16ToASCII( + chrome::ExtractSearchTermsFromURL(profile(), url))); // Assume the prerendered page prefetched search results for the query // "flowers". SetLastQuery(ASCIIToUTF16("flowers")); - EXPECT_EQ("flowers", UTF16ToASCII(prerenderer->get_last_query())); - EXPECT_EQ(UTF16ToASCII(prerenderer->get_last_query()), - UTF16ToASCII(chrome::ExtractSearchTermsFromURL(profile(), url))); + EXPECT_EQ("flowers", base::UTF16ToASCII(prerenderer->get_last_query())); + EXPECT_EQ(base::UTF16ToASCII(prerenderer->get_last_query()), + base::UTF16ToASCII( + chrome::ExtractSearchTermsFromURL(profile(), url))); } TEST_F(InstantSearchPrerendererTest, PrefetchSearchResults) { @@ -254,7 +256,7 @@ TEST_F(InstantSearchPrerendererTest, PrefetchSearchResults) { InstantSearchPrerenderer* prerenderer = GetInstantSearchPrerenderer(); prerenderer->Prerender( InstantSuggestion(ASCIIToUTF16("flowers"), std::string())); - EXPECT_EQ("flowers", UTF16ToASCII(prerenderer->get_last_query())); + EXPECT_EQ("flowers", base::UTF16ToASCII(prerenderer->get_last_query())); EXPECT_TRUE(MessageWasSent( ChromeViewMsg_SearchBoxSetSuggestionToPrefetch::ID)); } @@ -266,7 +268,7 @@ TEST_F(InstantSearchPrerendererTest, DoNotPrefetchSearchResults) { InstantSearchPrerenderer* prerenderer = GetInstantSearchPrerenderer(); prerenderer->Prerender( InstantSuggestion(ASCIIToUTF16("flowers"), std::string())); - EXPECT_EQ("", UTF16ToASCII(prerenderer->get_last_query())); + EXPECT_EQ("", base::UTF16ToASCII(prerenderer->get_last_query())); EXPECT_FALSE(MessageWasSent( ChromeViewMsg_SearchBoxSetSuggestionToPrefetch::ID)); } diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc index b53eaac..e6f5dce 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc @@ -431,5 +431,5 @@ TEST_F(BookmarkEditorViewTest, NewFolderTitleUpdatedOnCommit) { ASSERT_EQ(1, parent->child_count()); const BookmarkNode* new_folder = parent->GetChild(0); ASSERT_TRUE(new_folder->is_folder()); - EXPECT_EQ("modified", UTF16ToASCII(new_folder->GetTitle())); + EXPECT_EQ("modified", base::UTF16ToASCII(new_folder->GetTitle())); } diff --git a/chrome/browser/ui/webui/ntp/android/promo_handler.cc b/chrome/browser/ui/webui/ntp/android/promo_handler.cc index 58d7e89..8f9f03f 100644 --- a/chrome/browser/ui/webui/ntp/android/promo_handler.cc +++ b/chrome/browser/ui/webui/ntp/android/promo_handler.cc @@ -211,7 +211,7 @@ void PromoHandler::HandleGetPromotions(const base::ListValue* /*args*/) { void PromoHandler::HandleRecordImpression(const base::ListValue* args) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(args && !args->empty()); - RecordPromotionImpression(UTF16ToASCII(ExtractStringValue(args))); + RecordPromotionImpression(base::UTF16ToASCII(ExtractStringValue(args))); } void PromoHandler::InjectPromoDecorations() { diff --git a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc index c753a73..fec16e0 100644 --- a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc @@ -408,7 +408,8 @@ void CrosLanguageOptionsHandler::RestartCallback(const base::ListValue* args) { void CrosLanguageOptionsHandler::InputMethodDisableCallback( const base::ListValue* args) { - const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args)); + const std::string input_method_id = + base::UTF16ToASCII(ExtractStringValue(args)); const std::string action = base::StringPrintf( "LanguageOptions_DisableInputMethod_%s", input_method_id.c_str()); content::RecordComputedAction(action); @@ -416,7 +417,8 @@ void CrosLanguageOptionsHandler::InputMethodDisableCallback( void CrosLanguageOptionsHandler::InputMethodEnableCallback( const base::ListValue* args) { - const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args)); + const std::string input_method_id = + base::UTF16ToASCII(ExtractStringValue(args)); const std::string action = base::StringPrintf( "LanguageOptions_EnableInputMethod_%s", input_method_id.c_str()); content::RecordComputedAction(action); @@ -424,7 +426,8 @@ void CrosLanguageOptionsHandler::InputMethodEnableCallback( void CrosLanguageOptionsHandler::InputMethodOptionsOpenCallback( const base::ListValue* args) { - const std::string input_method_id = UTF16ToASCII(ExtractStringValue(args)); + const std::string input_method_id = + base::UTF16ToASCII(ExtractStringValue(args)); const std::string extension_id = extension_ime_util::GetExtensionIDFromInputMethodID(input_method_id); if (extension_id.empty()) diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc index 05ba280..8580abd 100644 --- a/chrome/browser/ui/webui/options/core_options_handler.cc +++ b/chrome/browser/ui/webui/options/core_options_handler.cc @@ -436,7 +436,7 @@ void CoreOptionsHandler::HandleFetchPrefs(const base::ListValue* args) { result_value.Set(pref_name.c_str(), FetchPref(pref_name)); } - web_ui()->CallJavascriptFunction(UTF16ToASCII(callback_function), + web_ui()->CallJavascriptFunction(base::UTF16ToASCII(callback_function), result_value); } diff --git a/chrome/browser/ui/webui/options/language_options_handler_common.cc b/chrome/browser/ui/webui/options/language_options_handler_common.cc index c5fb995..27c4ab5 100644 --- a/chrome/browser/ui/webui/options/language_options_handler_common.cc +++ b/chrome/browser/ui/webui/options/language_options_handler_common.cc @@ -227,7 +227,8 @@ void LanguageOptionsHandlerCommon::LanguageOptionsOpenCallback( void LanguageOptionsHandlerCommon::UiLanguageChangeCallback( const base::ListValue* args) { - const std::string language_code = UTF16ToASCII(ExtractStringValue(args)); + const std::string language_code = + base::UTF16ToASCII(ExtractStringValue(args)); CHECK(!language_code.empty()); const std::string action = base::StringPrintf( "LanguageOptions_UiLanguageChange_%s", language_code.c_str()); @@ -240,7 +241,8 @@ void LanguageOptionsHandlerCommon::UiLanguageChangeCallback( void LanguageOptionsHandlerCommon::SpellCheckLanguageChangeCallback( const base::ListValue* args) { - const std::string language_code = UTF16ToASCII(ExtractStringValue(args)); + const std::string language_code = + base::UTF16ToASCII(ExtractStringValue(args)); CHECK(!language_code.empty()); const std::string action = base::StringPrintf( "LanguageOptions_SpellCheckLanguageChange_%s", language_code.c_str()); diff --git a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc index 8b41c80..45ca4f1 100644 --- a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc +++ b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc @@ -8,6 +8,7 @@ #include "base/prefs/pref_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/signin_global_error.h" @@ -105,7 +106,7 @@ void InlineLoginHandlerImpl::HandleSwitchToFullTabMessage( content::WebContents* web_contents = web_ui()->GetWebContents(); GURL main_frame_url(web_contents->GetURL()); main_frame_url = net::AppendOrReplaceQueryParameter( - main_frame_url, "frameUrl", UTF16ToASCII(url_str)); + main_frame_url, "frameUrl", base::UTF16ToASCII(url_str)); chrome::NavigateParams params( Profile::FromWebUI(web_ui()), net::AppendOrReplaceQueryParameter(main_frame_url, "constrained", "0"), @@ -145,10 +146,10 @@ void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) { base::string16 email; dict->GetString("email", &email); DCHECK(!email.empty()); - email_ = UTF16ToASCII(email); + email_ = base::UTF16ToASCII(email); base::string16 password; dict->GetString("password", &password); - password_ = UTF16ToASCII(password); + password_ = base::UTF16ToASCII(password); // When doing a SAML sign in, this email check may result in a false // positive. This happens when the user types one email address in the @@ -168,7 +169,7 @@ void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) { base::string16 session_index; dict->GetString("sessionIndex", &session_index); - session_index_ = UTF16ToASCII(session_index); + session_index_ = base::UTF16ToASCII(session_index); DCHECK(!session_index_.empty()); dict->GetBoolean("chooseWhatToSync", &choose_what_to_sync_); diff --git a/chrome/browser/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector_impl.cc index 74a1388..a58cf76 100644 --- a/chrome/browser/upgrade_detector_impl.cc +++ b/chrome/browser/upgrade_detector_impl.cc @@ -238,7 +238,7 @@ void UpgradeDetectorImpl::DetectUpgradeTask( } #elif defined(OS_MACOSX) installed_version = - Version(UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion())); + Version(base::UTF16ToASCII(keystone_glue::CurrentlyInstalledVersion())); #elif defined(OS_POSIX) // POSIX but not Mac OS X: Linux, etc. CommandLine command_line(*CommandLine::ForCurrentProcess()); diff --git a/chrome/common/chrome_version_info_win.cc b/chrome/common/chrome_version_info_win.cc index a7568a8..e540c2d 100644 --- a/chrome/common/chrome_version_info_win.cc +++ b/chrome/common/chrome_version_info_win.cc @@ -9,6 +9,7 @@ #include "base/files/file_path.h" #include "base/path_service.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/install_util.h" @@ -30,7 +31,7 @@ std::string VersionInfo::GetVersionStringModifier() { if (base::debug::IsBinaryInstrumented()) channel += L" SyzyASan"; #endif - return UTF16ToASCII(channel); + return base::UTF16ToASCII(channel); #else return std::string(); #endif diff --git a/chrome/common/custom_handlers/protocol_handler.cc b/chrome/common/custom_handlers/protocol_handler.cc index f8af6a9..714feb1 100644 --- a/chrome/common/custom_handlers/protocol_handler.cc +++ b/chrome/common/custom_handlers/protocol_handler.cc @@ -75,7 +75,7 @@ base::DictionaryValue* ProtocolHandler::Encode() const { std::string ProtocolHandler::ToString() const { return "{ protocol=" + protocol_ + ", url=" + url_.spec() + - ", title=" + UTF16ToASCII(title_) + + ", title=" + base::UTF16ToASCII(title_) + " }"; } #endif diff --git a/chrome/common/extensions/api/commands/commands_manifest_unittest.cc b/chrome/common/extensions/api/commands/commands_manifest_unittest.cc index b753003..8837e53 100644 --- a/chrome/common/extensions/api/commands/commands_manifest_unittest.cc +++ b/chrome/common/extensions/api/commands/commands_manifest_unittest.cc @@ -6,6 +6,7 @@ #include "base/command_line.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/api/commands/commands_handler.h" #include "chrome/common/extensions/features/feature_channel.h" @@ -43,7 +44,8 @@ TEST_F(CommandsManifestTest, CommandManifestSimple) { ASSERT_TRUE(commands->end() != iter); const Command* named_command = &(*iter).second; ASSERT_STREQ("feature1", named_command->command_name().c_str()); - ASSERT_STREQ("desc", UTF16ToASCII(named_command->description()).c_str()); + ASSERT_STREQ("desc", + base::UTF16ToASCII(named_command->description()).c_str()); ASSERT_EQ(ctrl_shift_f, named_command->accelerator()); const Command* browser_action = @@ -51,7 +53,7 @@ TEST_F(CommandsManifestTest, CommandManifestSimple) { ASSERT_TRUE(NULL != browser_action); ASSERT_STREQ("_execute_browser_action", browser_action->command_name().c_str()); - ASSERT_STREQ("", UTF16ToASCII(browser_action->description()).c_str()); + ASSERT_STREQ("", base::UTF16ToASCII(browser_action->description()).c_str()); ASSERT_EQ(alt_shift_f, browser_action->accelerator()); const Command* page_action = @@ -59,7 +61,7 @@ TEST_F(CommandsManifestTest, CommandManifestSimple) { ASSERT_TRUE(NULL != page_action); ASSERT_STREQ("_execute_page_action", page_action->command_name().c_str()); - ASSERT_STREQ("", UTF16ToASCII(page_action->description()).c_str()); + ASSERT_STREQ("", base::UTF16ToASCII(page_action->description()).c_str()); ASSERT_EQ(ctrl_f, page_action->accelerator()); } diff --git a/chrome/common/extensions/command_unittest.cc b/chrome/common/extensions/command_unittest.cc index 0b3c392..b36a86a 100644 --- a/chrome/common/extensions/command_unittest.cc +++ b/chrome/common/extensions/command_unittest.cc @@ -137,7 +137,7 @@ TEST(CommandTest, ExtensionCommandParsing) { EXPECT_EQ(kTests[i].expected_result, result); if (result) { EXPECT_STREQ(kTests[i].description, - UTF16ToASCII(command.description()).c_str()); + base::UTF16ToASCII(command.description()).c_str()); EXPECT_STREQ(kTests[i].command_name, command.command_name().c_str()); EXPECT_EQ(kTests[i].accelerator, command.accelerator()); } @@ -157,7 +157,7 @@ TEST(CommandTest, ExtensionCommandParsing) { EXPECT_EQ(kTests[i].expected_result, result); if (result) { EXPECT_STREQ(kTests[i].description, - UTF16ToASCII(command.description()).c_str()); + base::UTF16ToASCII(command.description()).c_str()); EXPECT_STREQ(kTests[i].command_name, command.command_name().c_str()); EXPECT_EQ(kTests[i].accelerator, command.accelerator()); } @@ -185,7 +185,7 @@ TEST(CommandTest, ExtensionCommandParsingFallback) { base::string16 error; EXPECT_TRUE(command.Parse(input.get(), command_name, 0, &error)); EXPECT_STREQ(description.c_str(), - UTF16ToASCII(command.description()).c_str()); + base::UTF16ToASCII(command.description()).c_str()); EXPECT_STREQ(command_name.c_str(), command.command_name().c_str()); #if defined(OS_WIN) diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc index 8b053bd..f186053 100644 --- a/chrome/common/extensions/extension_file_util.cc +++ b/chrome/common/extensions/extension_file_util.cc @@ -351,7 +351,7 @@ void GarbageCollectExtensions( // Parse directory name as a potential extension ID. if (IsStringASCII(basename.value())) { - extension_id = UTF16ToASCII(basename.LossyDisplayName()); + extension_id = base::UTF16ToASCII(basename.LossyDisplayName()); if (!Extension::IdIsValid(extension_id)) extension_id.clear(); } diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index 991ef79..de2d127 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -215,7 +215,7 @@ void AddCommandWithParameterWorkItems(const InstallerState& installer_state, if (installer_state.operation() == InstallerState::UNINSTALL) { work_item_list->AddDeleteRegKeyWorkItem( installer_state.root_key(), full_cmd_key)->set_log_message( - "removing " + WideToASCII(command_key) + " command"); + "removing " + base::UTF16ToASCII(command_key) + " command"); } else { CommandLine cmd_line(installer_state.target_path().Append(app)); cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); @@ -1446,7 +1446,7 @@ void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, // not left behind in any case. work_item_list->AddDeleteRegKeyWorkItem( installer_state.root_key(), cmd_key)->set_log_message( - "removing " + WideToASCII(kCmdQuickEnableCf) + " command"); + "removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + " command"); } diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc index 1626ab0..c588406 100644 --- a/chrome/installer/setup/setup_util.cc +++ b/chrome/installer/setup/setup_util.cc @@ -18,6 +18,7 @@ #include "base/process/launch.h" #include "base/process/process_handle.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "base/version.h" #include "base/win/registry.h" #include "base/win/windows_version.h" @@ -155,7 +156,7 @@ Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) { VLOG(1) << "directory found: " << find_data.GetName().value(); scoped_ptr<Version> found_version( - new Version(WideToASCII(find_data.GetName().value()))); + new Version(base::UTF16ToASCII(find_data.GetName().value()))); if (found_version->IsValid() && found_version->CompareTo(*max_version.get()) > 0) { max_version.reset(found_version.release()); diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 62effc7..d1b67ff 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -176,7 +176,7 @@ void ClearRlzProductState() { // If chrome has been reactivated, clear all events for this brand as well. base::string16 reactivation_brand_wide; if (GoogleUpdateSettings::GetReactivationBrand(&reactivation_brand_wide)) { - std::string reactivation_brand(WideToASCII(reactivation_brand_wide)); + std::string reactivation_brand(base::UTF16ToASCII(reactivation_brand_wide)); rlz_lib::SupplementaryBranding branding(reactivation_brand.c_str()); rlz_lib::ClearProductState(rlz_lib::CHROME, points); } diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc index 774ee4f..146f1b0 100644 --- a/chrome/installer/test/alternate_version_generator.cc +++ b/chrome/installer/test/alternate_version_generator.cc @@ -42,6 +42,7 @@ #include "base/process/launch.h" #include "base/process/process_handle.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "base/version.h" #include "base/win/pe_image.h" #include "base/win/scoped_handle.h" @@ -667,7 +668,7 @@ bool GenerateAlternatePEFileVersion(const base::FilePath& original_file, return false; } - Version new_version(WideToASCII(ctx.new_version_str)); + Version new_version(base::UTF16ToASCII(ctx.new_version_str)); GenerateSpecificPEFileVersion(original_file, target_file, new_version); return true; diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index 500f7e7..e29f987 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc @@ -677,7 +677,7 @@ bool GoogleUpdateSettings::GetUpdateDetailForApp(bool system_install, (clientstate.ReadValue(google_update::kRegVersionField, &version) == ERROR_SUCCESS)) { product_found = true; - data->version = WideToASCII(version); + data->version = base::UTF16ToASCII(version); data->last_success = base::Time::FromTimeT(dword_value); data->last_result = 0; data->last_error_code = 0; diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index ebdf3b0..570386e 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -21,6 +21,7 @@ #include "base/platform_file.h" #include "base/process/launch.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "base/sys_info.h" #include "base/values.h" #include "base/version.h" @@ -230,7 +231,7 @@ void InstallUtil::GetChromeVersion(BrowserDistribution* dist, if (result == ERROR_SUCCESS && !version_str.empty()) { VLOG(1) << "Existing " << dist->GetDisplayName() << " version found " << version_str; - *version = Version(WideToASCII(version_str)); + *version = Version(base::UTF16ToASCII(version_str)); } else { DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); VLOG(1) << "No existing " << dist->GetDisplayName() @@ -256,7 +257,7 @@ void InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist, if (result == ERROR_SUCCESS && !version_str.empty()) { VLOG(1) << "Critical Update version for " << dist->GetDisplayName() << " found " << version_str; - *version = Version(WideToASCII(version_str)); + *version = Version(base::UTF16ToASCII(version_str)); } else { DCHECK_EQ(ERROR_FILE_NOT_FOUND, result); VLOG(1) << "No existing " << dist->GetDisplayName() diff --git a/chrome/installer/util/installation_state.cc b/chrome/installer/util/installation_state.cc index d6d06ab..91631b1 100644 --- a/chrome/installer/util/installation_state.cc +++ b/chrome/installer/util/installation_state.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "base/version.h" #include "base/win/registry.h" #include "chrome/installer/util/google_update_constants.h" @@ -57,10 +58,10 @@ bool ProductState::Initialize(bool system_install, // Read from the Clients key. if (key.Open(root_key, version_key.c_str(), KEY_QUERY_VALUE) == ERROR_SUCCESS) { - std::wstring version_str; + base::string16 version_str; if (key.ReadValue(google_update::kRegVersionField, &version_str) == ERROR_SUCCESS) { - version_.reset(new Version(WideToASCII(version_str))); + version_.reset(new Version(base::UTF16ToASCII(version_str))); if (!version_->IsValid()) version_.reset(); } @@ -70,7 +71,7 @@ bool ProductState::Initialize(bool system_install, // only be accessible via InstallationState::GetNonVersionedProductState. if (key.ReadValue(google_update::kRegOldVersionField, &version_str) == ERROR_SUCCESS) { - old_version_.reset(new Version(WideToASCII(version_str))); + old_version_.reset(new Version(base::UTF16ToASCII(version_str))); if (!old_version_->IsValid()) old_version_.reset(); } diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc index 500aadc..a5ed9d9 100644 --- a/chrome/installer/util/installer_state.cc +++ b/chrome/installer/util/installer_state.cc @@ -662,7 +662,7 @@ void InstallerState::GetExistingExeVersions( if (file_version_info) { base::string16 version_string = file_version_info->file_version(); if (!version_string.empty() && IsStringASCII(version_string)) - existing_versions->insert(WideToASCII(version_string)); + existing_versions->insert(base::UTF16ToASCII(version_string)); } } } @@ -689,7 +689,7 @@ void InstallerState::RemoveOldVersionDirectories( for (base::FilePath next_version = version_enum.Next(); !next_version.empty(); next_version = version_enum.Next()) { base::FilePath dir_name(next_version.BaseName()); - version = Version(WideToASCII(dir_name.value())); + version = Version(base::UTF16ToASCII(dir_name.value())); // Delete the version folder if it is less than the new version and not // equal to the old version (if we have an old version). if (version.IsValid() && diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc index 3818712..a9e4f06 100644 --- a/chrome/installer/util/installer_state_unittest.cc +++ b/chrome/installer/util/installer_state_unittest.cc @@ -589,7 +589,7 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { for (base::FilePath next_version = version_enum.Next(); !next_version.empty(); next_version = version_enum.Next()) { base::FilePath dir_name(next_version.BaseName()); - Version version(WideToASCII(dir_name.value())); + Version version(base::UTF16ToASCII(dir_name.value())); if (version.IsValid()) { EXPECT_TRUE(expected_remaining_dirs.erase(version.GetString())) << "Unexpected version dir found: " << version.GetString(); diff --git a/chrome/installer/util/move_tree_work_item_unittest.cc b/chrome/installer/util/move_tree_work_item_unittest.cc index e51d88f..8d60bd6 100644 --- a/chrome/installer/util/move_tree_work_item_unittest.cc +++ b/chrome/installer/util/move_tree_work_item_unittest.cc @@ -12,6 +12,7 @@ #include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/installer/util/installer_util_test_common.h" #include "chrome/installer/util/move_tree_work_item.h" #include "chrome/installer/util/work_item.h" @@ -33,7 +34,7 @@ class MoveTreeWorkItemTest : public testing::Test { void CreateTextFile(const std::wstring& filename, const std::wstring& contents) { std::wofstream file; - file.open(WideToASCII(filename).c_str()); + file.open(base::UTF16ToASCII(filename).c_str()); ASSERT_TRUE(file.is_open()); file << contents; file.close(); @@ -43,7 +44,7 @@ void CreateTextFile(const std::wstring& filename, std::wstring ReadTextFile(const base::FilePath& path) { WCHAR contents[64]; std::wifstream file; - file.open(WideToASCII(path.value()).c_str()); + file.open(base::UTF16ToASCII(path.value()).c_str()); EXPECT_TRUE(file.is_open()); file.getline(contents, arraysize(contents)); file.close(); diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 93971ea..9e705cc 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -152,7 +152,7 @@ UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() { } COMPILE_ASSERT(sizeof(base::MD5Digest) == 16, size_of_MD5_not_as_expected_); base::MD5Digest md5_digest; - std::string user_sid_ascii(UTF16ToASCII(user_sid)); + std::string user_sid_ascii(base::UTF16ToASCII(user_sid)); base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest); const base::string16 base32_md5( ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a))); diff --git a/chrome/installer/util/user_experiment.cc b/chrome/installer/util/user_experiment.cc index 9565b6e..4febe24 100644 --- a/chrome/installer/util/user_experiment.cc +++ b/chrome/installer/util/user_experiment.cc @@ -476,7 +476,7 @@ void LaunchBrowserUserExperiment(const CommandLine& base_cmd_line, cmd_line.AppendSwitchASCII(switches::kInactiveUserToast, base::IntToString(flavor)); cmd_line.AppendSwitchASCII(switches::kExperimentGroup, - WideToASCII(base_group)); + base::UTF16ToASCII(base_group)); LaunchSetup(&cmd_line, system_level); } diff --git a/chrome/test/perf/startup_test.cc b/chrome/test/perf/startup_test.cc index 2f93bb0..8fe062a 100644 --- a/chrome/test/perf/startup_test.cc +++ b/chrome/test/perf/startup_test.cc @@ -135,10 +135,10 @@ class StartupTest : public UIPerfTest { // Rewrite prefs file. std::vector<base::string16> subst; subst.push_back(base::WideToUTF16(user_data_dir_w)); - const std::string prefs_string = - UTF16ToASCII(ReplaceStringPlaceholders(format_string, subst, NULL)); + const std::string prefs_string = base::UTF16ToASCII( + ReplaceStringPlaceholders(format_string, subst, NULL)); EXPECT_TRUE(base::WriteFile(pref_path, prefs_string.c_str(), - prefs_string.size())); + prefs_string.size())); file_util::EvictFileFromSystemCache(pref_path); } diff --git a/chrome/test/pyautolib/pyautolib.cc b/chrome/test/pyautolib/pyautolib.cc index fdd48a8..aa50f92 100644 --- a/chrome/test/pyautolib/pyautolib.cc +++ b/chrome/test/pyautolib/pyautolib.cc @@ -44,7 +44,7 @@ void PyUITestSuiteBase::SetCrSourceRoot(const base::FilePath& path) { PyUITestBase::PyUITestBase(bool clear_profile, std::wstring homepage) : UITestBase() { set_clear_profile(clear_profile); - set_homepage(WideToASCII(homepage)); + set_homepage(base::UTF16ToASCII(homepage)); // We add this so that pyauto can execute javascript in the renderer and // read values back. dom_automation_enabled_ = true; diff --git a/components/autofill/content/browser/wallet/wallet_address.cc b/components/autofill/content/browser/wallet/wallet_address.cc index ad63c70..ac92acb 100644 --- a/components/autofill/content/browser/wallet/wallet_address.cc +++ b/components/autofill/content/browser/wallet/wallet_address.cc @@ -113,7 +113,7 @@ Address::Address() {} Address::Address(const AutofillProfile& profile) : country_name_code_( - UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY))), + base::UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY))), recipient_name_(profile.GetRawInfo(NAME_FULL)), locality_name_(profile.GetRawInfo(ADDRESS_HOME_CITY)), dependent_locality_name_( diff --git a/components/autofill/core/browser/address.cc b/components/autofill/core/browser/address.cc index 031ff6b..de651479 100644 --- a/components/autofill/core/browser/address.cc +++ b/components/autofill/core/browser/address.cc @@ -108,7 +108,7 @@ void Address::SetRawInfo(ServerFieldType type, const base::string16& value) { case ADDRESS_HOME_COUNTRY: DCHECK(value.empty() || (value.length() == 2u && IsStringASCII(value))); - country_code_ = UTF16ToASCII(value); + country_code_ = base::UTF16ToASCII(value); break; case ADDRESS_HOME_ZIP: @@ -149,7 +149,7 @@ bool Address::SetInfo(const AutofillType& type, return false; } - country_code_ = StringToUpperASCII(UTF16ToASCII(value)); + country_code_ = StringToUpperASCII(base::UTF16ToASCII(value)); return true; } diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc index 661387a..3e7e7aa 100644 --- a/components/autofill/core/browser/autofill_profile.cc +++ b/components/autofill/core/browser/autofill_profile.cc @@ -482,7 +482,7 @@ bool AutofillProfile::IsSubsetOf(const AutofillProfile& profile, } else if (!i18n::PhoneNumbersMatch( GetRawInfo(*it), profile.GetRawInfo(*it), - UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)), + base::UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)), app_locale)) { return false; } @@ -650,7 +650,8 @@ void AutofillProfile::AddPhoneIfUnique( DCHECK(existing_phones); // Phones allow "fuzzy" matching, so "1-800-FLOWERS", "18003569377", // "(800)356-9377" and "356-9377" are considered the same. - std::string country_code = UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)); + std::string country_code = + base::UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)); if (std::find_if(existing_phones->begin(), existing_phones->end(), FindByPhone(phone, country_code, app_locale)) == existing_phones->end()) { diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc index 8544c6c..9ad41ca 100644 --- a/components/autofill/core/browser/personal_data_manager.cc +++ b/components/autofill/core/browser/personal_data_manager.cc @@ -89,7 +89,7 @@ bool IsMinimumAddress(const AutofillProfile& profile, return false; std::string country_code = - UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)); + base::UTF16ToASCII(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)); if (country_code.empty()) country_code = AutofillCountry::CountryCodeForLocale(app_locale); @@ -770,7 +770,7 @@ bool PersonalDataManager::IsCountryOfInterest(const std::string& country_code) const std::vector<AutofillProfile*>& profiles = web_profiles(); std::list<std::string> country_codes; for (size_t i = 0; i < profiles.size(); ++i) { - country_codes.push_back(StringToLowerASCII(UTF16ToASCII( + country_codes.push_back(StringToLowerASCII(base::UTF16ToASCII( profiles[i]->GetRawInfo(ADDRESS_HOME_COUNTRY)))); } @@ -1053,7 +1053,7 @@ std::string PersonalDataManager::MostCommonCountryCodeFromProfiles() const { std::vector<std::string> country_codes; AutofillCountry::GetAvailableCountries(&country_codes); for (size_t i = 0; i < profiles.size(); ++i) { - std::string country_code = StringToUpperASCII(UTF16ToASCII( + std::string country_code = StringToUpperASCII(base::UTF16ToASCII( profiles[i]->GetRawInfo(ADDRESS_HOME_COUNTRY))); if (std::find(country_codes.begin(), country_codes.end(), country_code) != diff --git a/components/autofill/core/browser/phone_number.cc b/components/autofill/core/browser/phone_number.cc index e997cc4..57afcc9 100644 --- a/components/autofill/core/browser/phone_number.cc +++ b/components/autofill/core/browser/phone_number.cc @@ -31,7 +31,7 @@ std::string GetRegion(const AutofillProfile& profile, const std::string& app_locale) { base::string16 country_code = profile.GetRawInfo(ADDRESS_HOME_COUNTRY); if (!country_code.empty()) - return UTF16ToASCII(country_code); + return base::UTF16ToASCII(country_code); return AutofillCountry::CountryCodeForLocale(app_locale); } diff --git a/components/autofill/core/browser/webdata/autofill_table_unittest.cc b/components/autofill/core/browser/webdata/autofill_table_unittest.cc index 0cd34b4..9a4f4a5 100644 --- a/components/autofill/core/browser/webdata/autofill_table_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_table_unittest.cc @@ -32,7 +32,8 @@ namespace autofill { // So we can compare AutofillKeys with EXPECT_EQ(). std::ostream& operator<<(std::ostream& os, const AutofillKey& key) { - return os << UTF16ToASCII(key.name()) << ", " << UTF16ToASCII(key.value()); + return os << base::UTF16ToASCII(key.name()) << ", " + << base::UTF16ToASCII(key.value()); } // So we can compare AutofillChanges with EXPECT_EQ(). diff --git a/components/breakpad/app/breakpad_win.cc b/components/breakpad/app/breakpad_win.cc index f683ce4..1550938 100644 --- a/components/breakpad/app/breakpad_win.cc +++ b/components/breakpad/app/breakpad_win.cc @@ -653,7 +653,7 @@ static void InitPipeNameEnvVar(bool is_per_user_install) { pipe_name = kGoogleUpdatePipeName; pipe_name += user_sid; } - env->SetVar(kPipeNameVar, WideToASCII(pipe_name)); + env->SetVar(kPipeNameVar, base::UTF16ToASCII(pipe_name)); } void InitDefaultCrashCallback(LPTOP_LEVEL_EXCEPTION_FILTER filter) { diff --git a/components/wifi/wifi_test.cc b/components/wifi/wifi_test.cc index 0897745..d88232f 100644 --- a/components/wifi/wifi_test.cc +++ b/components/wifi/wifi_test.cc @@ -17,6 +17,7 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" #include "base/time/time.h" #include "components/wifi/wifi_service.h" @@ -99,7 +100,7 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) { if (parsed_command_line.GetArgs().size() == 1) { #if defined(OS_WIN) - network_guid = WideToASCII(parsed_command_line.GetArgs()[0]); + network_guid = base::UTF16ToASCII(parsed_command_line.GetArgs()[0]); #else network_guid = parsed_command_line.GetArgs()[0]; #endif diff --git a/content/browser/session_history_browsertest.cc b/content/browser/session_history_browsertest.cc index 04d00da..c1f0565 100644 --- a/content/browser/session_history_browsertest.cc +++ b/content/browser/session_history_browsertest.cc @@ -85,7 +85,7 @@ class SessionHistoryTest : public ContentBrowserTest { } std::string GetTabTitle() { - return UTF16ToASCII(shell()->web_contents()->GetTitle()); + return base::UTF16ToASCII(shell()->web_contents()->GetTitle()); } GURL GetTabURL() { diff --git a/content/child/simple_webmimeregistry_impl.cc b/content/child/simple_webmimeregistry_impl.cc index e0b728d..3b3ebd6 100644 --- a/content/child/simple_webmimeregistry_impl.cc +++ b/content/child/simple_webmimeregistry_impl.cc @@ -18,7 +18,7 @@ namespace content { //static std::string SimpleWebMimeRegistryImpl::ToASCIIOrEmpty(const WebString& string) { - return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); + return IsStringASCII(string) ? base::UTF16ToASCII(string) : std::string(); } WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMIMEType( diff --git a/content/common/pepper_plugin_list.cc b/content/common/pepper_plugin_list.cc index 6f4b21b..fac77f6 100644 --- a/content/common/pepper_plugin_list.cc +++ b/content/common/pepper_plugin_list.cc @@ -134,9 +134,9 @@ bool MakePepperPluginInfo(const WebPluginInfo& webplugin_info, WebPluginInfo::PLUGIN_TYPE_PEPPER_UNSANDBOXED; pepper_info->path = base::FilePath(webplugin_info.path); - pepper_info->name = UTF16ToASCII(webplugin_info.name); - pepper_info->description = UTF16ToASCII(webplugin_info.desc); - pepper_info->version = UTF16ToASCII(webplugin_info.version); + pepper_info->name = base::UTF16ToASCII(webplugin_info.name); + pepper_info->description = base::UTF16ToASCII(webplugin_info.desc); + pepper_info->version = base::UTF16ToASCII(webplugin_info.version); pepper_info->mime_types = webplugin_info.mime_types; pepper_info->permissions = webplugin_info.pepper_permissions; diff --git a/content/common/plugin_list_win.cc b/content/common/plugin_list_win.cc index 3afe1ab..dfc1711 100644 --- a/content/common/plugin_list_win.cc +++ b/content/common/plugin_list_win.cc @@ -16,6 +16,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "base/win/pe_image.h" #include "base/win/registry.h" #include "base/win/scoped_handle.h" @@ -284,8 +285,8 @@ bool PluginList::ReadWebPluginInfo(const base::FilePath& filename, // TODO(evan): Move the ParseMimeTypes code inline once Pepper is updated. if (!PluginList::ParseMimeTypes( - UTF16ToASCII(version_info_win->GetStringValue(L"MIMEType")), - UTF16ToASCII(version_info_win->GetStringValue(L"FileExtents")), + base::UTF16ToASCII(version_info_win->GetStringValue(L"MIMEType")), + base::UTF16ToASCII(version_info_win->GetStringValue(L"FileExtents")), version_info_win->GetStringValue(L"FileOpenName"), &info->mime_types)) { LOG_IF(ERROR, PluginList::DebugPluginLoading()) diff --git a/content/public/common/webplugininfo.cc b/content/public/common/webplugininfo.cc index 6f53d05..b6fedb9 100644 --- a/content/public/common/webplugininfo.cc +++ b/content/public/common/webplugininfo.cc @@ -73,7 +73,7 @@ void WebPluginInfo::CreateVersionFromString( base::Version* parsed_version) { // Remove spaces and ')' from the version string, // Replace any instances of 'r', ',' or '(' with a dot. - std::string version = UTF16ToASCII(version_string); + std::string version = base::UTF16ToASCII(version_string); base::RemoveChars(version, ") ", &version); std::replace(version.begin(), version.end(), 'd', '.'); std::replace(version.begin(), version.end(), 'r', '.'); diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc index 9a87ecfd..65387b8 100644 --- a/content/renderer/media/android/webmediaplayer_android.cc +++ b/content/renderer/media/android/webmediaplayer_android.cc @@ -14,6 +14,7 @@ #include "base/message_loop/message_loop.h" #include "base/metrics/histogram.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/utf_string_conversions.h" #include "cc/layers/video_layer.h" #include "content/public/common/content_client.h" #include "content/public/renderer/render_frame.h" @@ -1100,7 +1101,7 @@ const gfx::RectF WebMediaPlayerAndroid::GetBoundaryRectangle() { // Convert a WebString to ASCII, falling back on an empty string in the case // of a non-ASCII string. static std::string ToASCIIOrEmpty(const blink::WebString& string) { - return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); + return IsStringASCII(string) ? base::UTF16ToASCII(string) : std::string(); } // Helper functions to report media EME related stats to UMA. They follow the diff --git a/content/renderer/media/webcontentdecryptionmodule_impl.cc b/content/renderer/media/webcontentdecryptionmodule_impl.cc index 7b2131b..8a4cf47 100644 --- a/content/renderer/media/webcontentdecryptionmodule_impl.cc +++ b/content/renderer/media/webcontentdecryptionmodule_impl.cc @@ -11,6 +11,7 @@ #include "base/bind.h" #include "base/logging.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "content/renderer/media/cdm_session_adapter.h" #include "content/renderer/media/webcontentdecryptionmodulesession_impl.h" #include "media/base/media_keys.h" @@ -39,7 +40,7 @@ WebContentDecryptionModuleImpl* WebContentDecryptionModuleImpl::Create( base::Bind(&PepperCdmWrapperImpl::Create, static_cast<blink::WebFrame*>(NULL)), #endif - UTF16ToASCII(key_system))) { + base::UTF16ToASCII(key_system))) { return NULL; } diff --git a/content/renderer/media/webcontentdecryptionmodulesession_impl.cc b/content/renderer/media/webcontentdecryptionmodulesession_impl.cc index f46e247..14fa798 100644 --- a/content/renderer/media/webcontentdecryptionmodulesession_impl.cc +++ b/content/renderer/media/webcontentdecryptionmodulesession_impl.cc @@ -7,6 +7,7 @@ #include "base/callback_helpers.h" #include "base/logging.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "content/renderer/media/cdm_session_adapter.h" #include "third_party/WebKit/public/platform/WebURL.h" @@ -42,7 +43,7 @@ void WebContentDecryptionModuleSessionImpl::initializeNewSession( } adapter_->InitializeNewSession( - session_id_, UTF16ToASCII(mime_type), init_data, init_data_length); + session_id_, base::UTF16ToASCII(mime_type), init_data, init_data_length); } void WebContentDecryptionModuleSessionImpl::update(const uint8* response, diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc index 2fa0032..9399476 100644 --- a/content/renderer/media/webmediaplayer_impl.cc +++ b/content/renderer/media/webmediaplayer_impl.cc @@ -19,6 +19,7 @@ #include "base/message_loop/message_loop_proxy.h" #include "base/metrics/histogram.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/utf_string_conversions.h" #include "base/synchronization/waitable_event.h" #include "cc/layers/video_layer.h" #include "content/public/common/content_switches.h" @@ -747,7 +748,7 @@ static void ReportMediaKeyExceptionToUMA(const std::string& method, // Convert a WebString to ASCII, falling back on an empty string in the case // of a non-ASCII string. static std::string ToASCIIOrEmpty(const blink::WebString& string) { - return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); + return IsStringASCII(string) ? base::UTF16ToASCII(string) : std::string(); } WebMediaPlayer::MediaKeyException diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc index 5e53960..f9caddc 100644 --- a/content/renderer/npapi/webplugin_impl.cc +++ b/content/renderer/npapi/webplugin_impl.cc @@ -544,7 +544,7 @@ WebPluginImpl::WebPluginImpl( first_geometry_update_(true), ignore_response_error_(false), file_path_(file_path), - mime_type_(UTF16ToASCII(params.mimeType)), + mime_type_(base::UTF16ToASCII(params.mimeType)), weak_factory_(this), loader_client_(this) { DCHECK_EQ(params.attributeNames.size(), params.attributeValues.size()); diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index 98dc41e..1e8f7ab 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc @@ -1363,7 +1363,7 @@ bool PepperPluginInstanceImpl::StartFind(const base::string16& search_text, return PP_ToBool( plugin_find_interface_->StartFind( pp_instance(), - base::UTF16ToUTF8(search_text.c_str()).c_str(), + base::UTF16ToUTF8(search_text).c_str(), PP_FromBool(case_sensitive))); } diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index e065232..1365a38 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -1034,7 +1034,7 @@ blink::WebPlugin* RenderFrameImpl::createPlugin( return plugin; } - if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { + if (base::UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( render_view_.get(), frame); } diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc index c668b47..c669ac8 100644 --- a/content/renderer/render_view_browsertest.cc +++ b/content/renderer/render_view_browsertest.cc @@ -2128,7 +2128,8 @@ TEST_F(SuppressErrorPageTest, MAYBE_Suppresses) { // An error occurred. view()->main_render_frame()->didFailProvisionalLoad(web_frame, error); const int kMaxOutputCharacters = 22; - EXPECT_EQ("", UTF16ToASCII(web_frame->contentAsText(kMaxOutputCharacters))); + EXPECT_EQ("", + base::UTF16ToASCII(web_frame->contentAsText(kMaxOutputCharacters))); } #if defined(OS_ANDROID) @@ -2158,7 +2159,7 @@ TEST_F(SuppressErrorPageTest, MAYBE_DoesNotSuppress) { ProcessPendingMessages(); const int kMaxOutputCharacters = 22; EXPECT_EQ("A suffusion of yellow.", - UTF16ToASCII(web_frame->contentAsText(kMaxOutputCharacters))); + base::UTF16ToASCII(web_frame->contentAsText(kMaxOutputCharacters))); } // Tests if IME API's candidatewindow* events sent from browser are handled diff --git a/content/renderer/render_view_browsertest_mac.mm b/content/renderer/render_view_browsertest_mac.mm index f0959e0..93174c8 100644 --- a/content/renderer/render_view_browsertest_mac.mm +++ b/content/renderer/render_view_browsertest_mac.mm @@ -4,6 +4,7 @@ #include "base/strings/string16.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/test/render_view_test.h" #include "content/renderer/render_view_impl.h" @@ -103,7 +104,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) { ProcessPendingMessages(); ExecuteJavaScript("scroll.textContent = window.pageYOffset"); output = GetMainFrame()->contentAsText(kMaxOutputCharacters); - EXPECT_EQ(kArrowDownScrollDown, UTF16ToASCII(output)); + EXPECT_EQ(kArrowDownScrollDown, base::UTF16ToASCII(output)); const char* kArrowUpScrollUp = "38,false,false,true,false\n0\np1"; view->OnSetEditCommandsForNextKeyEvent( @@ -112,7 +113,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) { ProcessPendingMessages(); ExecuteJavaScript("scroll.textContent = window.pageYOffset"); output = GetMainFrame()->contentAsText(kMaxOutputCharacters); - EXPECT_EQ(kArrowUpScrollUp, UTF16ToASCII(output)); + EXPECT_EQ(kArrowUpScrollUp, base::UTF16ToASCII(output)); // Now let javascript eat the key events -- no scrolling should happen. // Set a scroll position slightly down the page to ensure that it does not @@ -126,7 +127,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) { ProcessPendingMessages(); ExecuteJavaScript("scroll.textContent = window.pageYOffset"); output = GetMainFrame()->contentAsText(kMaxOutputCharacters); - EXPECT_EQ(kArrowDownNoScroll, UTF16ToASCII(output)); + EXPECT_EQ(kArrowDownNoScroll, base::UTF16ToASCII(output)); const char* kArrowUpNoScroll = "38,false,false,true,false\n100\np1"; view->OnSetEditCommandsForNextKeyEvent( @@ -135,7 +136,7 @@ TEST_F(RenderViewTest, MacTestCmdUp) { ProcessPendingMessages(); ExecuteJavaScript("scroll.textContent = window.pageYOffset"); output = GetMainFrame()->contentAsText(kMaxOutputCharacters); - EXPECT_EQ(kArrowUpNoScroll, UTF16ToASCII(output)); + EXPECT_EQ(kArrowUpNoScroll, base::UTF16ToASCII(output)); } } // namespace content diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc index c4b54dc..ce81e56 100644 --- a/content/renderer/renderer_webkitplatformsupport_impl.cc +++ b/content/renderer/renderer_webkitplatformsupport_impl.cc @@ -409,7 +409,7 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::supportsMediaMIMEType( return IsNotSupported; std::string key_system_ascii = - GetUnprefixedKeySystemName(UTF16ToASCII(key_system)); + GetUnprefixedKeySystemName(base::UTF16ToASCII(key_system)); std::vector<std::string> strict_codecs; bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); net::ParseCodecString(ToASCIIOrEmpty(codecs), &strict_codecs, strip_suffix); @@ -475,14 +475,15 @@ RendererWebKitPlatformSupportImpl::MimeRegistry::supportsEncryptedMediaMIMEType( if (key_system.isEmpty()) return false; - const std::string mime_type_ascii = UTF16ToASCII(mime_type); + const std::string mime_type_ascii = base::UTF16ToASCII(mime_type); std::vector<std::string> codec_vector; bool strip_suffix = !net::IsStrictMediaMimeType(mime_type_ascii); - net::ParseCodecString(UTF16ToASCII(codecs), &codec_vector, strip_suffix); + net::ParseCodecString(base::UTF16ToASCII(codecs), &codec_vector, + strip_suffix); return IsSupportedKeySystemWithMediaMimeType( - mime_type_ascii, codec_vector, UTF16ToASCII(key_system)); + mime_type_ascii, codec_vector, base::UTF16ToASCII(key_system)); } WebString diff --git a/content/test/image_decoder_test.cc b/content/test/image_decoder_test.cc index 00341c0..7d89e18 100644 --- a/content/test/image_decoder_test.cc +++ b/content/test/image_decoder_test.cc @@ -11,6 +11,7 @@ #include "base/memory/scoped_ptr.h" #include "base/path_service.h" #include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" #include "third_party/WebKit/public/platform/WebData.h" #include "third_party/WebKit/public/platform/WebImage.h" #include "third_party/WebKit/public/platform/WebSize.h" @@ -131,7 +132,7 @@ std::vector<base::FilePath> ImageDecoderTest::GetImageFiles() const { while (!(next_file_name = enumerator.Next()).empty()) { base::FilePath base_name = next_file_name.BaseName(); #if defined(OS_WIN) - std::string base_name_ascii = WideToASCII(base_name.value()); + std::string base_name_ascii = base::UTF16ToASCII(base_name.value()); #else std::string base_name_ascii = base_name.value(); #endif diff --git a/device/serial/serial_device_enumerator_win.cc b/device/serial/serial_device_enumerator_win.cc index e3bde29..a45a609 100644 --- a/device/serial/serial_device_enumerator_win.cc +++ b/device/serial/serial_device_enumerator_win.cc @@ -10,6 +10,7 @@ #include "base/memory/scoped_ptr.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" #include "base/win/registry.h" namespace device { @@ -34,7 +35,7 @@ void SerialDeviceEnumeratorWin::GetDevices(SerialDeviceInfoList* devices) { for (; iter_key.Valid(); ++iter_key) { base::string16 value(iter_key.Value()); linked_ptr<SerialDeviceInfo> info(new SerialDeviceInfo); - info->path = WideToASCII(value); + info->path = base::UTF16ToASCII(value); devices->push_back(info); } } diff --git a/gpu/config/gpu_info_collector_win.cc b/gpu/config/gpu_info_collector_win.cc index 6467262..f7b1f9e 100644 --- a/gpu/config/gpu_info_collector_win.cc +++ b/gpu/config/gpu_info_collector_win.cc @@ -27,6 +27,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" #include "base/threading/thread.h" #include "base/threading/worker_pool.h" #include "base/win/registry.h" @@ -186,7 +187,7 @@ Version DisplayLinkVersion() { if (key.ReadValue(L"Version", &version)) return Version(); - return Version(WideToASCII(version)); + return Version(base::UTF16ToASCII(version)); } // Returns whether Lenovo dCute is installed. @@ -407,7 +408,7 @@ bool CollectDriverInfoD3D(const std::wstring& device_id, key, L"DriverVersion", NULL, NULL, reinterpret_cast<LPBYTE>(value), &dwcb_data); if (result == ERROR_SUCCESS) - driver_version = WideToASCII(std::wstring(value)); + driver_version = base::UTF16ToASCII(std::wstring(value)); std::string driver_date; dwcb_data = sizeof(value); @@ -415,7 +416,7 @@ bool CollectDriverInfoD3D(const std::wstring& device_id, key, L"DriverDate", NULL, NULL, reinterpret_cast<LPBYTE>(value), &dwcb_data); if (result == ERROR_SUCCESS) - driver_date = WideToASCII(std::wstring(value)); + driver_date = base::UTF16ToASCII(std::wstring(value)); std::string driver_vendor; dwcb_data = sizeof(value); @@ -423,7 +424,7 @@ bool CollectDriverInfoD3D(const std::wstring& device_id, key, L"ProviderName", NULL, NULL, reinterpret_cast<LPBYTE>(value), &dwcb_data); if (result == ERROR_SUCCESS) { - driver_vendor = WideToASCII(std::wstring(value)); + driver_vendor = base::UTF16ToASCII(std::wstring(value)); if (driver_vendor == "Advanced Micro Devices, Inc." || driver_vendor == "ATI Technologies Inc.") { // We are conservative and assume that in the absence of a clear @@ -537,8 +538,8 @@ GpuIDResult CollectGpuID(uint32* vendor_id, uint32* device_id) { int vendor = 0, device = 0; std::wstring vendor_string = id.substr(8, 4); std::wstring device_string = id.substr(17, 4); - base::HexStringToInt(WideToASCII(vendor_string), &vendor); - base::HexStringToInt(WideToASCII(device_string), &device); + base::HexStringToInt(base::UTF16ToASCII(vendor_string), &vendor); + base::HexStringToInt(base::UTF16ToASCII(device_string), &device); *vendor_id = vendor; *device_id = device; return kGpuIDSuccess; @@ -592,8 +593,8 @@ bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) { int vendor_id = 0, device_id = 0; base::string16 vendor_id_string = id.substr(8, 4); base::string16 device_id_string = id.substr(17, 4); - base::HexStringToInt(WideToASCII(vendor_id_string), &vendor_id); - base::HexStringToInt(WideToASCII(device_id_string), &device_id); + base::HexStringToInt(base::UTF16ToASCII(vendor_id_string), &vendor_id); + base::HexStringToInt(base::UTF16ToASCII(device_id_string), &device_id); gpu_info->gpu.vendor_id = vendor_id; gpu_info->gpu.device_id = device_id; // TODO(zmo): we only need to call CollectDriverInfoD3D() if we use ANGLE. diff --git a/net/cert/x509_certificate_win.cc b/net/cert/x509_certificate_win.cc index c3f0a27..c679107 100644 --- a/net/cert/x509_certificate_win.cc +++ b/net/cert/x509_certificate_win.cc @@ -183,11 +183,11 @@ void X509Certificate::GetSubjectAltName( int num_entries = alt_name->cAltEntry; for (int i = 0; i < num_entries; i++) { // dNSName is an ASN.1 IA5String representing a string of ASCII - // characters, so we can use WideToASCII here. + // characters, so we can use UTF16ToASCII here. const CERT_ALT_NAME_ENTRY& entry = alt_name->rgAltEntry[i]; if (dns_names && entry.dwAltNameChoice == CERT_ALT_NAME_DNS_NAME) { - dns_names->push_back(WideToASCII(entry.pwszDNSName)); + dns_names->push_back(base::UTF16ToASCII(entry.pwszDNSName)); } else if (ip_addrs && entry.dwAltNameChoice == CERT_ALT_NAME_IP_ADDRESS) { ip_addrs->push_back(std::string( diff --git a/net/disk_cache/cache_util.cc b/net/disk_cache/cache_util.cc index 4452e7b..276f2f3 100644 --- a/net/disk_cache/cache_util.cc +++ b/net/disk_cache/cache_util.cc @@ -9,6 +9,7 @@ #include "base/location.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" #include "base/threading/worker_pool.h" @@ -118,7 +119,7 @@ bool DelayedCacheCleanup(const base::FilePath& full_path) { std::string name_str = name.value(); #elif defined(OS_WIN) // We created this file so it should only contain ASCII. - std::string name_str = WideToASCII(name.value()); + std::string name_str = base::UTF16ToASCII(name.value()); #endif base::FilePath to_delete = GetTempCacheName(path, name_str); diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc index dcc9181..be7e771 100644 --- a/net/dns/dns_config_service_win.cc +++ b/net/dns/dns_config_service_win.cc @@ -140,7 +140,7 @@ bool ParseDomainASCII(const base::string16& widestr, std::string* domain) { // Check if already ASCII. if (IsStringASCII(widestr)) { - *domain = UTF16ToASCII(widestr); + *domain = base::UTF16ToASCII(widestr); return true; } diff --git a/net/proxy/proxy_config_service_win.cc b/net/proxy/proxy_config_service_win.cc index a1295f3..828b5cc 100644 --- a/net/proxy/proxy_config_service_win.cc +++ b/net/proxy/proxy_config_service_win.cc @@ -12,6 +12,7 @@ #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/strings/string_tokenizer.h" +#include "base/strings/utf_string_conversions.h" #include "base/threading/thread_restrictions.h" #include "base/win/registry.h" #include "net/base/net_errors.h" @@ -175,10 +176,11 @@ void ProxyConfigServiceWin::SetFromIEConfig( if (ie_config.lpszProxy) { // lpszProxy may be a single proxy, or a proxy per scheme. The format // is compatible with ProxyConfig::ProxyRules's string format. - config->proxy_rules().ParseFromString(WideToASCII(ie_config.lpszProxy)); + config->proxy_rules().ParseFromString( + base::UTF16ToASCII(ie_config.lpszProxy)); } if (ie_config.lpszProxyBypass) { - std::string proxy_bypass = WideToASCII(ie_config.lpszProxyBypass); + std::string proxy_bypass = base::UTF16ToASCII(ie_config.lpszProxyBypass); base::StringTokenizer proxy_server_bypass_list(proxy_bypass, ";, \t\n\r"); while (proxy_server_bypass_list.GetNext()) { diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc index fa62c2b0..7e44f15 100644 --- a/net/proxy/proxy_resolver_v8.cc +++ b/net/proxy/proxy_resolver_v8.cc @@ -217,7 +217,7 @@ bool GetHostnameArgument(const v8::FunctionCallbackInfo<v8::Value>& args, // If the hostname is already in ASCII, simply return it as is. if (IsStringASCII(hostname_utf16)) { - *hostname = UTF16ToASCII(hostname_utf16); + *hostname = base::UTF16ToASCII(hostname_utf16); return true; } @@ -410,7 +410,7 @@ class ProxyResolverV8::Context { return ERR_PAC_SCRIPT_FAILED; } - results->UsePacString(UTF16ToASCII(ret_str)); + results->UsePacString(base::UTF16ToASCII(ret_str)); return OK; } diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc index c0bd779..5cad3a2 100644 --- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc +++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc @@ -75,7 +75,7 @@ class MockErrorObserver : public ProxyResolverErrorObserver { { base::AutoLock l(lock_); output += base::StringPrintf("Error: line %d: %s\n", line_number, - UTF16ToASCII(error).c_str()); + base::UTF16ToASCII(error).c_str()); } event_.Signal(); } diff --git a/net/proxy/proxy_resolver_winhttp.cc b/net/proxy/proxy_resolver_winhttp.cc index 116b33c..2d90dab 100644 --- a/net/proxy/proxy_resolver_winhttp.cc +++ b/net/proxy/proxy_resolver_winhttp.cc @@ -108,7 +108,7 @@ int ProxyResolverWinHttp::GetProxyForURL(const GURL& query_url, // things like "foopy1:80;foopy2:80". It strips out the non-HTTP // proxy types, and stops the list when PAC encounters a "DIRECT". // So UseNamedProxy() should work OK. - results->UseNamedProxy(WideToASCII(info.lpszProxy)); + results->UseNamedProxy(base::UTF16ToASCII(info.lpszProxy)); break; default: NOTREACHED(); diff --git a/net/tools/gdig/gdig.cc b/net/tools/gdig/gdig.cc index 2ab8fa30..2dd165e 100644 --- a/net/tools/gdig/gdig.cc +++ b/net/tools/gdig/gdig.cc @@ -16,6 +16,7 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" +#include "base/strings/utf_string_conversions.h" #include "base/time/time.h" #include "net/base/address_list.h" #include "net/base/ip_endpoint.h" @@ -361,7 +362,7 @@ bool GDig::ParseCommandLine(int argc, const char* argv[]) { ReplayLogEntry entry; entry.start_time = base::TimeDelta(); #if defined(OS_WIN) - entry.domain_name = WideToASCII(parsed_command_line.GetArgs()[0]); + entry.domain_name = base::UTF16ToASCII(parsed_command_line.GetArgs()[0]); #else entry.domain_name = parsed_command_line.GetArgs()[0]; #endif diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc index 5d724b0..b7183b0 100644 --- a/remoting/host/setup/me2me_native_messaging_host.cc +++ b/remoting/host/setup/me2me_native_messaging_host.cc @@ -537,7 +537,7 @@ void Me2MeNativeMessagingHost::EnsureElevatedHostCreated() { // Create a security descriptor that gives full access to the caller and // denies access by anyone else. std::string security_descriptor = base::StringPrintf( - "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", WideToASCII(user_sid).c_str()); + "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", base::UTF16ToASCII(user_sid).c_str()); ScopedSd sd = ConvertSddlToSd(security_descriptor); if (!sd) { diff --git a/skia/ext/vector_canvas_unittest.cc b/skia/ext/vector_canvas_unittest.cc index b7e9105..bd394d6 100644 --- a/skia/ext/vector_canvas_unittest.cc +++ b/skia/ext/vector_canvas_unittest.cc @@ -254,7 +254,7 @@ class ImageTest : public testing::Test { // Hack for a quick lowercase. We assume all the test data file names are // ASCII. #if defined(OS_WIN) - std::string tmp = WideToASCII(filename); + std::string tmp = base::UTF16ToASCII(filename); #else std::string tmp(filename); #endif diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc index d3fb160..da409a0 100644 --- a/ui/base/l10n/l10n_util.cc +++ b/ui/base/l10n/l10n_util.cc @@ -507,7 +507,8 @@ bool IsLocaleNameTranslated(const char* locale, // the translation is available or not. If ICU doesn't have a translated // name for this locale, GetDisplayNameForLocale will just return the // locale code. - return !IsStringASCII(display_name) || UTF16ToASCII(display_name) != locale; + return !IsStringASCII(display_name) || + base::UTF16ToASCII(display_name) != locale; } base::string16 GetDisplayNameForLocale(const std::string& locale, diff --git a/ui/base/l10n/l10n_util_win.cc b/ui/base/l10n/l10n_util_win.cc index 4b91fa2..cd0a084 100644 --- a/ui/base/l10n/l10n_util_win.cc +++ b/ui/base/l10n/l10n_util_win.cc @@ -11,6 +11,7 @@ #include "base/i18n/rtl.h" #include "base/lazy_instance.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/utf_string_conversions.h" #include "base/win/i18n.h" #include "base/win/windows_version.h" #include "grit/app_locale_settings.h" @@ -185,12 +186,12 @@ void AdjustUIFontForWindow(HWND hwnd) { } void OverrideLocaleWithUILanguageList() { - std::vector<std::wstring> ui_languages; + std::vector<base::string16> ui_languages; if (base::win::i18n::GetThreadPreferredUILanguageList(&ui_languages)) { std::vector<std::string> ascii_languages; ascii_languages.reserve(ui_languages.size()); std::transform(ui_languages.begin(), ui_languages.end(), - std::back_inserter(ascii_languages), &WideToASCII); + std::back_inserter(ascii_languages), &base::UTF16ToASCII); override_locale_holder.Get().swap_value(&ascii_languages); } else { NOTREACHED() << "Failed to determine the UI language for locale override."; diff --git a/ui/views/controls/tree/tree_view_unittest.cc b/ui/views/controls/tree/tree_view_unittest.cc index fd77026..bf73da9 100644 --- a/ui/views/controls/tree/tree_view_unittest.cc +++ b/ui/views/controls/tree/tree_view_unittest.cc @@ -90,12 +90,14 @@ std::string TreeViewTest::TreeViewContentsAsString() { std::string TreeViewTest::GetSelectedNodeTitle() { TreeModelNode* model_node = tree_.GetSelectedNode(); - return model_node ? UTF16ToASCII(model_node->GetTitle()) : std::string(); + return model_node ? base::UTF16ToASCII(model_node->GetTitle()) + : std::string(); } std::string TreeViewTest::GetEditingNodeTitle() { TreeModelNode* model_node = tree_.GetEditingNode(); - return model_node ? UTF16ToASCII(model_node->GetTitle()) : std::string(); + return model_node ? base::UTF16ToASCII(model_node->GetTitle()) + : std::string(); } TestNode* TreeViewTest::GetNodeByTitle(const std::string& title) { @@ -133,7 +135,7 @@ TestNode* TreeViewTest::GetNodeByTitleImpl(TestNode* node, std::string TreeViewTest::InternalNodeAsString( TreeView::InternalNode* node) { - std::string result = UTF16ToASCII(node->model_node()->GetTitle()); + std::string result = base::UTF16ToASCII(node->model_node()->GetTitle()); if (node->is_expanded() && node->child_count()) { result += " ["; for (int i = 0; i < node->child_count(); ++i) { diff --git a/ui/views/examples/table_example.cc b/ui/views/examples/table_example.cc index eb1a29a..5c9eebf 100644 --- a/ui/views/examples/table_example.cc +++ b/ui/views/examples/table_example.cc @@ -145,14 +145,14 @@ void TableExample::GetGroupRange(int model_index, GroupRange* range) { void TableExample::OnSelectionChanged() { PrintStatus("Selected: %s", - UTF16ToASCII(GetText(table_->selection_model().active(), - 0)).c_str()); + base::UTF16ToASCII(GetText(table_->selection_model().active(), + 0)).c_str()); } void TableExample::OnDoubleClick() { PrintStatus("Double Click: %s", - UTF16ToASCII(GetText(table_->selection_model().active(), - 0)).c_str()); + base::UTF16ToASCII(GetText(table_->selection_model().active(), + 0)).c_str()); } void TableExample::OnMiddleClick() {} diff --git a/webkit/browser/database/database_util.cc b/webkit/browser/database/database_util.cc index f037638..bfa0879 100644 --- a/webkit/browser/database/database_util.cc +++ b/webkit/browser/database/database_util.cc @@ -32,7 +32,7 @@ bool DatabaseUtil::CrackVfsFileName(const base::string16& vfs_file_name, } if (origin_identifier) { - *origin_identifier = UTF16ToASCII( + *origin_identifier = base::UTF16ToASCII( vfs_file_name.substr(0, first_slash_index)); } if (database_name) { @@ -61,7 +61,7 @@ base::FilePath DatabaseUtil::GetFullFilePathForVfsFile( if (!full_path.empty() && !sqlite_suffix.empty()) { DCHECK(full_path.Extension().empty()); full_path = full_path.InsertBeforeExtensionASCII( - UTF16ToASCII(sqlite_suffix)); + base::UTF16ToASCII(sqlite_suffix)); } // Watch out for directory traversal attempts from a compromised renderer. if (full_path.value().find(FILE_PATH_LITERAL("..")) != |