diff --git a/apps/launcher.cc b/apps/launcher.cc index f4875aae2f3f9e..25c3a5f2bd14e4 100644 --- a/apps/launcher.cc +++ b/apps/launcher.cc @@ -328,7 +328,7 @@ void LaunchPlatformAppWithCommandLine(Profile* profile, #if defined(OS_WIN) base::CommandLine::StringType about_blank_url( - base::ASCIIToWide(url::kAboutBlankURL)); + base::ASCIIToUTF16(url::kAboutBlankURL)); #else base::CommandLine::StringType about_blank_url(url::kAboutBlankURL); #endif diff --git a/components/crash/app/breakpad_win.cc b/components/crash/app/breakpad_win.cc index 32c48915426e71..862174cab411e8 100644 --- a/components/crash/app/breakpad_win.cc +++ b/components/crash/app/breakpad_win.cc @@ -508,7 +508,7 @@ void InitCrashReporter(const std::string& process_type_switch) { // Disable the message box for assertions. _CrtSetReportMode(_CRT_ASSERT, 0); - std::wstring process_type = base::ASCIIToWide(process_type_switch); + base::string16 process_type = base::ASCIIToUTF16(process_type_switch); if (process_type.empty()) process_type = L"browser"; @@ -555,7 +555,7 @@ void InitCrashReporter(const std::string& process_type_switch) { InitDefaultCrashCallback(default_filter); return; } - std::wstring pipe_name = base::ASCIIToWide(pipe_name_ascii); + base::string16 pipe_name = base::ASCIIToUTF16(pipe_name_ascii); #ifdef _WIN64 // The protocol for connecting to the out-of-process Breakpad crash diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc index 8c0975e1f02d55..708ef6685a4ce4 100644 --- a/components/policy/core/common/policy_loader_win_unittest.cc +++ b/components/policy/core/common/policy_loader_win_unittest.cc @@ -155,7 +155,7 @@ class ScopedGroupPolicyRegistrySandbox { // Deletes the sandbox keys. void DeleteKeys(); - std::wstring key_name_; + base::string16 key_name_; // Keys are created for the lifetime of a test to contain // the sandboxed HKCU and HKLM hives, respectively. @@ -296,7 +296,7 @@ ScopedGroupPolicyRegistrySandbox::ScopedGroupPolicyRegistrySandbox() { // Generate a unique registry key for the override for each test. This // makes sure that tests executing in parallel won't delete each other's // key, at DeleteKeys(). - key_name_ = base::ASCIIToWide(base::StringPrintf( + key_name_ = base::ASCIIToUTF16(base::StringPrintf( "SOFTWARE\\chromium unittest %d", base::GetCurrentProcId())); std::wstring hklm_key_name = key_name_ + L"\\HKLM"; std::wstring hkcu_key_name = key_name_ + L"\\HKCU"; diff --git a/content/browser/download/save_package_unittest.cc b/content/browser/download/save_package_unittest.cc index 0d3b31fde497fc..c0dcbf0a7ebefc 100644 --- a/content/browser/download/save_package_unittest.cc +++ b/content/browser/download/save_package_unittest.cc @@ -242,7 +242,7 @@ TEST_F(SavePackageTest, MAYBE_TestLongSafePureFilename) { const base::FilePath::StringType ext(FPL_HTML_EXTENSION); base::FilePath::StringType filename = #if defined(OS_WIN) - base::ASCIIToWide(long_file_name); + base::ASCIIToUTF16(long_file_name); #else long_file_name; #endif diff --git a/content/test/plugin/plugin_geturl_test.cc b/content/test/plugin/plugin_geturl_test.cc index 825c75a1390423..ed686f2a848088 100644 --- a/content/test/plugin/plugin_geturl_test.cc +++ b/content/test/plugin/plugin_geturl_test.cc @@ -206,7 +206,7 @@ NPError PluginGetURLTest::NewStream(NPMIMEType type, NPStream* stream, #if defined(OS_WIN) filename = filename.substr(8); // remove "file:///" // Assume an ASCII path on Windows. - base::FilePath path = base::FilePath(base::ASCIIToWide(filename)); + base::FilePath path = base::FilePath(base::ASCIIToUTF16(filename)); #else filename = filename.substr(7); // remove "file://" base::FilePath path = base::FilePath(filename); diff --git a/ipc/ipc_channel_win.cc b/ipc/ipc_channel_win.cc index 870cf53245c9a6..db8c96116e3e71 100644 --- a/ipc/ipc_channel_win.cc +++ b/ipc/ipc_channel_win.cc @@ -231,13 +231,13 @@ const base::string16 ChannelWin::PipeName( if (index != std::string::npos) { if (secret) // Retrieve the secret if asked for. base::StringToInt(channel_id.substr(index + 1), secret); - return base::ASCIIToWide(name.append(channel_id.substr(0, index - 1))); + return base::ASCIIToUTF16(name.append(channel_id.substr(0, index - 1))); } // This case is here to support predictable named pipes in tests. if (secret) *secret = 0; - return base::ASCIIToWide(name.append(channel_id)); + return base::ASCIIToUTF16(name.append(channel_id)); } bool ChannelWin::CreatePipe(const IPC::ChannelHandle &channel_handle, diff --git a/media/audio/win/audio_device_listener_win_unittest.cc b/media/audio/win/audio_device_listener_win_unittest.cc index 14b70a8fe90a10..49a13592766e95 100644 --- a/media/audio/win/audio_device_listener_win_unittest.cc +++ b/media/audio/win/audio_device_listener_win_unittest.cc @@ -47,7 +47,7 @@ class AudioDeviceListenerWinTest : public testing::Test { bool SimulateDefaultOutputDeviceChange(const char* new_device_id) { return output_device_listener_->OnDefaultDeviceChanged( static_cast(eConsole), static_cast(eRender), - base::ASCIIToWide(new_device_id).c_str()) == S_OK; + base::ASCIIToUTF16(new_device_id).c_str()) == S_OK; } void SetOutputDeviceId(std::string new_device_id) { diff --git a/net/base/keygen_handler_win.cc b/net/base/keygen_handler_win.cc index ffa3b2e414e665..44365fa136db23 100644 --- a/net/base/keygen_handler_win.cc +++ b/net/base/keygen_handler_win.cc @@ -65,7 +65,7 @@ bool GetSubjectPublicKeyInfo(HCRYPTPROV prov, std::vector* output) { bool GetSignedPublicKeyAndChallenge(HCRYPTPROV prov, const std::string& challenge, std::string* output) { - std::wstring wide_challenge = base::ASCIIToWide(challenge); + base::string16 challenge16 = base::ASCIIToUTF16(challenge); std::vector spki; if (!GetSubjectPublicKeyInfo(prov, &spki)) @@ -79,7 +79,7 @@ bool GetSignedPublicKeyAndChallenge(HCRYPTPROV prov, pkac.dwVersion = CERT_KEYGEN_REQUEST_V1; pkac.SubjectPublicKeyInfo = *reinterpret_cast(&spki[0]); - pkac.pwszChallengeString = const_cast(wide_challenge.c_str()); + pkac.pwszChallengeString = const_cast(challenge16.c_str()); CRYPT_ALGORITHM_IDENTIFIER sig_alg; memset(&sig_alg, 0, sizeof(sig_alg)); diff --git a/net/cert/cert_verify_proc_win.cc b/net/cert/cert_verify_proc_win.cc index 60e22865e5a1a5..13a337bfe2f54f 100644 --- a/net/cert/cert_verify_proc_win.cc +++ b/net/cert/cert_verify_proc_win.cc @@ -741,7 +741,7 @@ int CertVerifyProcWin::VerifyInternal( if (CertSubjectCommonNameHasNull(cert_handle)) verify_result->cert_status |= CERT_STATUS_INVALID; - std::wstring wstr_hostname = base::ASCIIToWide(hostname); + base::string16 hostname16 = base::ASCIIToUTF16(hostname); SSL_EXTRA_CERT_CHAIN_POLICY_PARA extra_policy_para; memset(&extra_policy_para, 0, sizeof(extra_policy_para)); @@ -752,7 +752,7 @@ int CertVerifyProcWin::VerifyInternal( extra_policy_para.fdwChecks = 0x00001000; // SECURITY_FLAG_IGNORE_CERT_CN_INVALID extra_policy_para.pwszServerName = - const_cast(wstr_hostname.c_str()); + const_cast(hostname16.c_str()); CERT_CHAIN_POLICY_PARA policy_para; memset(&policy_para, 0, sizeof(policy_para)); diff --git a/net/http/http_auth_sspi_win.cc b/net/http/http_auth_sspi_win.cc index 66038d122d64b6..156a55f7ed87d1 100644 --- a/net/http/http_auth_sspi_win.cc +++ b/net/http/http_auth_sspi_win.cc @@ -360,11 +360,11 @@ int HttpAuthSSPI::GetNextSecurityToken( // This returns a token that is passed to the remote server. DWORD context_attribute; - std::wstring spn_wide = base::ASCIIToWide(spn); + base::string16 spn16 = base::ASCIIToUTF16(spn); SECURITY_STATUS status = library_->InitializeSecurityContext( &cred_, // phCredential ctxt_ptr, // phContext - const_cast(spn_wide.c_str()), // pszTargetName + const_cast(spn16.c_str()), // pszTargetName context_flags, // fContextReq 0, // Reserved1 (must be 0) SECURITY_NATIVE_DREP, // TargetDataRep diff --git a/net/http/url_security_manager_win.cc b/net/http/url_security_manager_win.cc index 4e2d938963eeee..db5620ffa76f08 100644 --- a/net/http/url_security_manager_win.cc +++ b/net/http/url_security_manager_win.cc @@ -53,10 +53,10 @@ bool URLSecurityManagerWin::CanUseDefaultCredentials( if (!const_cast(this)->EnsureSystemSecurityManager()) return false; - std::wstring url_w = base::ASCIIToWide(auth_origin.spec()); + base::string16 url16 = base::ASCIIToUTF16(auth_origin.spec()); DWORD policy = 0; HRESULT hr; - hr = security_manager_->ProcessUrlAction(url_w.c_str(), + hr = security_manager_->ProcessUrlAction(url16.c_str(), URLACTION_CREDENTIALS_USE, reinterpret_cast(&policy), sizeof(policy), NULL, 0, @@ -84,7 +84,7 @@ bool URLSecurityManagerWin::CanUseDefaultCredentials( // URLZONE_INTERNET 3 // URLZONE_UNTRUSTED 4 DWORD zone = 0; - hr = security_manager_->MapUrlToZone(url_w.c_str(), &zone, 0); + hr = security_manager_->MapUrlToZone(url16.c_str(), &zone, 0); if (FAILED(hr)) { LOG(ERROR) << "IInternetSecurityManager::MapUrlToZone failed: " << hr; return false; diff --git a/net/proxy/proxy_resolver_winhttp.cc b/net/proxy/proxy_resolver_winhttp.cc index 2d90dab6e05f48..755a1bfe2f485f 100644 --- a/net/proxy/proxy_resolver_winhttp.cc +++ b/net/proxy/proxy_resolver_winhttp.cc @@ -54,8 +54,8 @@ int ProxyResolverWinHttp::GetProxyForURL(const GURL& query_url, WINHTTP_AUTOPROXY_OPTIONS options = {0}; options.fAutoLogonIfChallenged = FALSE; options.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL; - std::wstring pac_url_wide = base::ASCIIToWide(pac_url_.spec()); - options.lpszAutoConfigUrl = pac_url_wide.c_str(); + base::string16 pac_url16 = base::ASCIIToUTF16(pac_url_.spec()); + options.lpszAutoConfigUrl = pac_url16.c_str(); WINHTTP_PROXY_INFO info = {0}; DCHECK(session_handle_); @@ -66,13 +66,13 @@ int ProxyResolverWinHttp::GetProxyForURL(const GURL& query_url, // get good performance in the case where WinHTTP uses an out-of-process // resolver. This is important for Vista and Win2k3. BOOL ok = WinHttpGetProxyForUrl(session_handle_, - base::ASCIIToWide(query_url.spec()).c_str(), + base::ASCIIToUTF16(query_url.spec()).c_str(), &options, &info); if (!ok) { if (ERROR_WINHTTP_LOGIN_FAILURE == GetLastError()) { options.fAutoLogonIfChallenged = TRUE; ok = WinHttpGetProxyForUrl( - session_handle_, base::ASCIIToWide(query_url.spec()).c_str(), + session_handle_, base::ASCIIToUTF16(query_url.spec()).c_str(), &options, &info); } if (!ok) { diff --git a/tools/imagediff/image_diff.cc b/tools/imagediff/image_diff.cc index 936bf5d17f41fc..6a9ebb9f938010 100644 --- a/tools/imagediff/image_diff.cc +++ b/tools/imagediff/image_diff.cc @@ -397,7 +397,7 @@ int DiffImages(const base::FilePath& file1, const base::FilePath& file2, // paths as non-wide strings anyway. base::FilePath FilePathFromASCII(const std::string& str) { #if defined(OS_WIN) - return base::FilePath(base::ASCIIToWide(str)); + return base::FilePath(base::ASCIIToUTF16(str)); #else return base::FilePath(str); #endif diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc index f37f0772cadf29..b46aba58bc05d6 100644 --- a/ui/base/clipboard/clipboard_win.cc +++ b/ui/base/clipboard/clipboard_win.cc @@ -136,7 +136,7 @@ HGLOBAL CreateGlobalData(const std::basic_string& str) { ::GlobalUnlock(data); } return data; -}; +} bool BitmapHasInvalidPremultipliedColors(const SkBitmap& bitmap) { for (int x = 0; x < bitmap.width(); ++x) { @@ -238,7 +238,7 @@ bool Clipboard::FormatType::Equals(const FormatType& other) const { Clipboard::FormatType Clipboard::GetFormatType( const std::string& format_string) { return FormatType( - ::RegisterClipboardFormat(base::ASCIIToWide(format_string).c_str())); + ::RegisterClipboardFormat(base::ASCIIToUTF16(format_string).c_str())); } // static @@ -727,7 +727,7 @@ void ClipboardWin::WriteBookmark(const char* title_data, bookmark.append(1, L'\n'); bookmark.append(url_data, url_len); - base::string16 wide_bookmark = base::UTF8ToWide(bookmark); + base::string16 wide_bookmark = base::UTF8ToUTF16(bookmark); HGLOBAL glob = CreateGlobalData(wide_bookmark); WriteToClipboard(GetUrlWFormatType().ToFormatEtc().cfFormat, glob); diff --git a/win8/delegate_execute/delegate_execute_util_unittest.cc b/win8/delegate_execute/delegate_execute_util_unittest.cc index 40a2e7144bb6de..49c1776b7e68a3 100644 --- a/win8/delegate_execute/delegate_execute_util_unittest.cc +++ b/win8/delegate_execute/delegate_execute_util_unittest.cc @@ -29,7 +29,7 @@ TEST(DelegateExecuteUtil, CommandLineFromParametersTest) { // Parameters with a switch are parsed properly. cl = delegate_execute::CommandLineFromParameters( base::StringPrintf(L"--%ls", - base::ASCIIToWide(kSomeSwitch).c_str()).c_str()); + base::ASCIIToUTF16(kSomeSwitch).c_str()).c_str()); EXPECT_EQ(std::wstring(), cl.GetProgram().value()); EXPECT_TRUE(cl.HasSwitch(kSomeSwitch)); } @@ -62,7 +62,7 @@ TEST(DelegateExecuteUtil, MakeChromeCommandLineTest) { cl = delegate_execute::MakeChromeCommandLine( this_exe, delegate_execute::CommandLineFromParameters( base::StringPrintf(L"--%ls -- %ls", - base::ASCIIToWide(kSomeSwitch).c_str(), + base::ASCIIToUTF16(kSomeSwitch).c_str(), kOtherArgument).c_str()), base::string16(kSomeArgument)); EXPECT_EQ(5, cl.argv().size());