diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 19:37:03 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-25 19:37:03 +0000 |
commit | 6c3bf032651d5f912775e0c8cd7e962454145ced (patch) | |
tree | 88cf8b652147b9acf47aa81999f8652609890dde | |
parent | ce51317df2e23a717f95e56e1a9db1a7fb330a16 (diff) | |
download | chromium_src-6c3bf032651d5f912775e0c8cd7e962454145ced.zip chromium_src-6c3bf032651d5f912775e0c8cd7e962454145ced.tar.gz chromium_src-6c3bf032651d5f912775e0c8cd7e962454145ced.tar.bz2 |
Update uses of UTF conversions in ppapi/, printing/, remoting/, rlz/, sandbox/, skia/, sql/, sync/, tools/, webkit/, win8/ to use the base:: namespace.
BUG=330556
TEST=no change
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/121123002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242502 0039d316-1c4b-4281-b951-d872f2087c98
71 files changed, 186 insertions, 192 deletions
diff --git a/ppapi/proxy/pdf_resource_unittest.cc b/ppapi/proxy/pdf_resource_unittest.cc index d0a2ed3..62fcea8 100644 --- a/ppapi/proxy/pdf_resource_unittest.cc +++ b/ppapi/proxy/pdf_resource_unittest.cc @@ -67,8 +67,8 @@ TEST_F(PDFResourceTest, SearchString) { base::string16 input; base::string16 term; - UTF8ToUTF16("abcdefabcdef", 12, &input); - UTF8ToUTF16("bc", 2, &term); + base::UTF8ToUTF16("abcdefabcdef", 12, &input); + base::UTF8ToUTF16("bc", 2, &term); PP_PrivateFindResult* results; int count = 0; diff --git a/ppapi/shared_impl/file_ref_util.cc b/ppapi/shared_impl/file_ref_util.cc index 3d2deff..3be8e0a 100644 --- a/ppapi/shared_impl/file_ref_util.cc +++ b/ppapi/shared_impl/file_ref_util.cc @@ -23,7 +23,7 @@ std::string GetNameForExternalFilePath(const base::FilePath& path) { size_t pos = file_path.rfind(base::FilePath::kSeparators[0]); CHECK(pos != base::FilePath::StringType::npos); #if defined(OS_WIN) - return WideToUTF8(file_path.substr(pos + 1)); + return base::WideToUTF8(file_path.substr(pos + 1)); #elif defined(OS_POSIX) return file_path.substr(pos + 1); #else diff --git a/printing/backend/print_backend_win.cc b/printing/backend/print_backend_win.cc index 0d1958f..abf8404 100644 --- a/printing/backend/print_backend_win.cc +++ b/printing/backend/print_backend_win.cc @@ -95,14 +95,14 @@ std::string PrintBackendWin::GetDefaultPrinterName() { TCHAR default_printer_name[MAX_PATH]; if (!::GetDefaultPrinter(default_printer_name, &size)) return std::string(); - return WideToUTF8(default_printer_name); + return base::WideToUTF8(default_printer_name); } bool PrintBackendWin::GetPrinterSemanticCapsAndDefaults( const std::string& printer_name, PrinterSemanticCapsAndDefaults* printer_info) { ScopedPrinterHandle printer_handle; - if (!printer_handle.OpenPrinter(UTF8ToWide(printer_name).c_str())) { + if (!printer_handle.OpenPrinter(base::UTF8ToWide(printer_name).c_str())) { LOG(WARNING) << "Failed to open printer, error = " << GetLastError(); return false; } @@ -111,7 +111,7 @@ bool PrintBackendWin::GetPrinterSemanticCapsAndDefaults( if (!info_5.Init(printer_handle)) { return false; } - DCHECK_EQ(info_5.get()->pPrinterName, UTF8ToUTF16(printer_name)); + DCHECK_EQ(info_5.get()->pPrinterName, base::UTF8ToUTF16(printer_name)); PrinterSemanticCapsAndDefaults caps; @@ -173,7 +173,7 @@ bool PrintBackendWin::GetPrinterCapsAndDefaults( } DCHECK(printer_info); HPTPROVIDER provider = NULL; - std::wstring printer_name_wide = UTF8ToWide(printer_name); + std::wstring printer_name_wide = base::UTF8ToWide(printer_name); HRESULT hr = XPSModule::OpenProvider(printer_name_wide, 1, &provider); if (provider) { base::win::ScopedComPtr<IStream> print_capabilities_stream; @@ -236,7 +236,7 @@ bool PrintBackendWin::GetPrinterCapsAndDefaults( std::string PrintBackendWin::GetPrinterDriverInfo( const std::string& printer_name) { ScopedPrinterHandle printer; - if (!printer.OpenPrinter(UTF8ToWide(printer_name).c_str())) { + if (!printer.OpenPrinter(base::UTF8ToWide(printer_name).c_str())) { return std::string(); } return GetDriverInfo(printer); @@ -244,7 +244,7 @@ std::string PrintBackendWin::GetPrinterDriverInfo( bool PrintBackendWin::IsValidPrinter(const std::string& printer_name) { ScopedPrinterHandle printer_handle; - return printer_handle.OpenPrinter(UTF8ToWide(printer_name).c_str()); + return printer_handle.OpenPrinter(base::UTF8ToWide(printer_name).c_str()); } scoped_refptr<PrintBackend> PrintBackend::CreateInstance( diff --git a/printing/backend/win_helper.cc b/printing/backend/win_helper.cc index 3d114d9..f7b3310 100644 --- a/printing/backend/win_helper.cc +++ b/printing/backend/win_helper.cc @@ -289,15 +289,19 @@ bool InitBasicPrinterInfo(HANDLE printer, PrinterBasicInfo* printer_info) { if (!info_2.Init(printer)) return false; - printer_info->printer_name = WideToUTF8(info_2.get()->pPrinterName); - if (info_2.get()->pComment) - printer_info->printer_description = WideToUTF8(info_2.get()->pComment); - if (info_2.get()->pLocation) + printer_info->printer_name = base::WideToUTF8(info_2.get()->pPrinterName); + if (info_2.get()->pComment) { + printer_info->printer_description = + base::WideToUTF8(info_2.get()->pComment); + } + if (info_2.get()->pLocation) { printer_info->options[kLocationTagName] = - WideToUTF8(info_2.get()->pLocation); - if (info_2.get()->pDriverName) + base::WideToUTF8(info_2.get()->pLocation); + } + if (info_2.get()->pDriverName) { printer_info->options[kDriverNameTagName] = - WideToUTF8(info_2.get()->pDriverName); + base::WideToUTF8(info_2.get()->pDriverName); + } printer_info->printer_status = info_2.get()->Status; std::string driver_info = GetDriverInfo(printer); @@ -319,16 +323,16 @@ std::string GetDriverInfo(HANDLE printer) { std::string info[4]; if (info_6.get()->pName) - info[0] = WideToUTF8(info_6.get()->pName); + info[0] = base::WideToUTF8(info_6.get()->pName); if (info_6.get()->pDriverPath) { scoped_ptr<FileVersionInfo> version_info( FileVersionInfo::CreateFileVersionInfo( base::FilePath(info_6.get()->pDriverPath))); if (version_info.get()) { - info[1] = WideToUTF8(version_info->file_version()); - info[2] = WideToUTF8(version_info->product_name()); - info[3] = WideToUTF8(version_info->product_version()); + info[1] = base::WideToUTF8(version_info->file_version()); + info[2] = base::WideToUTF8(version_info->product_name()); + info[3] = base::WideToUTF8(version_info->product_version()); } } diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm index 088d3ea..8b40da3 100644 --- a/printing/printing_context_mac.mm +++ b/printing/printing_context_mac.mm @@ -149,7 +149,7 @@ PrintingContext::Result PrintingContextMac::UpdatePrinterSettings( return OnError(); } else { // Don't need this for preview. - if (!SetPrinter(UTF16ToUTF8(settings_.device_name())) || + if (!SetPrinter(base::UTF16ToUTF8(settings_.device_name())) || !SetCopiesInPrintSettings(settings_.copies()) || !SetCollateInPrintSettings(settings_.collate()) || !SetDuplexModeInPrintSettings(settings_.duplex_mode()) || diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc index 9e97dd2..1c1e3af 100644 --- a/printing/printing_context_win.cc +++ b/printing/printing_context_win.cc @@ -434,7 +434,7 @@ PrintingContext::Result PrintingContextWin::NewDocument( DCHECK(SimplifyDocumentTitle(document_name) == document_name); DOCINFO di = { sizeof(DOCINFO) }; - const std::wstring& document_name_wide = UTF16ToWide(document_name); + const std::wstring& document_name_wide = base::UTF16ToWide(document_name); di.lpszDocName = document_name_wide.c_str(); // Is there a debug dump directory specified? If so, force to print to a file. @@ -447,7 +447,7 @@ PrintingContext::Result PrintingContextWin::NewDocument( filename += L"_"; filename += base::TimeFormatTimeOfDay(now); filename += L"_"; - filename += UTF16ToWide(document_name); + filename += base::UTF16ToWide(document_name); filename += L"_"; filename += L"buffer.prn"; file_util::ReplaceIllegalCharactersInPath(&filename, '_'); diff --git a/printing/printing_utils_unittest.cc b/printing/printing_utils_unittest.cc index 24a380d..be66fab 100644 --- a/printing/printing_utils_unittest.cc +++ b/printing/printing_utils_unittest.cc @@ -9,7 +9,7 @@ namespace printing { std::string Simplify(const char* title) { - return UTF16ToUTF8(SimplifyDocumentTitle(ASCIIToUTF16(title))); + return base::UTF16ToUTF8(SimplifyDocumentTitle(base::ASCIIToUTF16(title))); } TEST(PrintingUtilsTest, SimplifyDocumentTitle) { diff --git a/remoting/base/breakpad_win.cc b/remoting/base/breakpad_win.cc index 6dce6db2..0c1f5bd 100644 --- a/remoting/base/breakpad_win.cc +++ b/remoting/base/breakpad_win.cc @@ -153,7 +153,8 @@ google_breakpad::CustomClientInfo* BreakpadWin::GetCustomInfo() { static wchar_t version[64]; if (version_info.get()) { - wcscpy_s(version, UTF16ToWide(version_info->product_version()).c_str()); + wcscpy_s(version, + base::UTF16ToWide(version_info->product_version()).c_str()); } else { wcscpy_s(version, kBreakpadVersionDefault); } diff --git a/remoting/base/breakpad_win_unittest.cc b/remoting/base/breakpad_win_unittest.cc index 53f5a8d..9f93f78 100644 --- a/remoting/base/breakpad_win_unittest.cc +++ b/remoting/base/breakpad_win_unittest.cc @@ -91,7 +91,7 @@ void BreakpadWinDeathTest::SetUp() { if (environment->GetVar(kPipeVariableName, &pipe_name)) { // This is a child process. Initialize crash dump reporting to the crash // dump server. - pipe_name_ = UTF8ToWide(pipe_name); + pipe_name_ = base::UTF8ToWide(pipe_name); InitializeCrashReportingForTest(pipe_name_.c_str()); } else { // This is the parent process. Generate a unique pipe name and setup @@ -116,7 +116,7 @@ void BreakpadWinDeathTest::SetUp() { guid.Data4[6], guid.Data4[7]); EXPECT_TRUE(environment->SetVar(kPipeVariableName, - WideToUTF8(pipe_name_))); + base::WideToUTF8(pipe_name_))); // Setup a dummy crash dump server. callbacks_.reset(new MockCrashServerCallbacks()); diff --git a/remoting/host/clipboard_win.cc b/remoting/host/clipboard_win.cc index 03d6044..dfb6270 100644 --- a/remoting/host/clipboard_win.cc +++ b/remoting/host/clipboard_win.cc @@ -195,7 +195,7 @@ void ClipboardWin::InjectClipboardEvent( return; } - base::string16 text = UTF8ToUTF16(ReplaceLfByCrLf(event.data())); + base::string16 text = base::UTF8ToUTF16(ReplaceLfByCrLf(event.data())); ScopedClipboard clipboard; if (!clipboard.Init(window_->hwnd())) { @@ -252,7 +252,7 @@ void ClipboardWin::OnClipboardUpdate() { protocol::ClipboardEvent event; event.set_mime_type(kMimeTypeTextUtf8); - event.set_data(ReplaceCrLfByLf(UTF16ToUTF8(text))); + event.set_data(ReplaceCrLfByLf(base::UTF16ToUTF8(text))); if (client_clipboard_.get()) { client_clipboard_->InjectClipboardEvent(event); diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc index 8691d0e..77e024f 100644 --- a/remoting/host/desktop_session_win.cc +++ b/remoting/host/desktop_session_win.cc @@ -256,7 +256,7 @@ bool RdpSession::Initialize(const ScreenResolution& resolution) { base::win::ScopedComPtr<IRdpDesktopSessionEventHandler> event_handler( new EventHandler(weak_factory_.GetWeakPtr())); terminal_id_ = base::GenerateGUID(); - base::win::ScopedBstr terminal_id(UTF8ToUTF16(terminal_id_).c_str()); + base::win::ScopedBstr terminal_id(base::UTF8ToUTF16(terminal_id_).c_str()); result = rdp_desktop_session_->Connect(host_size.width(), host_size.height(), terminal_id, @@ -544,7 +544,8 @@ void DesktopSessionWin::OnSessionAttached(uint32 session_id) { new WtsSessionProcessDelegate(io_task_runner_, target.Pass(), launch_elevated, - WideToUTF8(kDaemonIpcSecurityDescriptor))); + base::WideToUTF8( + kDaemonIpcSecurityDescriptor))); if (!delegate->Initialize(session_id)) { TerminateSession(); return; diff --git a/remoting/host/disconnect_window_gtk.cc b/remoting/host/disconnect_window_gtk.cc index 5b840e0..34c2683 100644 --- a/remoting/host/disconnect_window_gtk.cc +++ b/remoting/host/disconnect_window_gtk.cc @@ -161,7 +161,7 @@ void DisconnectWindowGtk::Start( // Extract the user name from the JID. std::string client_jid = client_session_control_->client_jid(); base::string16 username = - UTF8ToUTF16(client_jid.substr(0, client_jid.find('/'))); + base::UTF8ToUTF16(client_jid.substr(0, client_jid.find('/'))); gtk_label_set_text( GTK_LABEL(message_), l10n_util::GetStringFUTF8(IDR_MESSAGE_SHARED, username).c_str()); diff --git a/remoting/host/disconnect_window_mac.mm b/remoting/host/disconnect_window_mac.mm index 9cb170a..e58ae1c 100644 --- a/remoting/host/disconnect_window_mac.mm +++ b/remoting/host/disconnect_window_mac.mm @@ -86,7 +86,7 @@ scoped_ptr<HostWindow> HostWindow::CreateDisconnectWindow() { self = [super initWithWindowNibName:@"disconnect_window"]; if (self) { disconnect_callback_ = disconnect_callback; - username_ = UTF8ToUTF16(username); + username_ = base::UTF8ToUTF16(username); } return self; } diff --git a/remoting/host/disconnect_window_win.cc b/remoting/host/disconnect_window_win.cc index 59c8c24..07eeabc 100644 --- a/remoting/host/disconnect_window_win.cc +++ b/remoting/host/disconnect_window_win.cc @@ -316,7 +316,8 @@ bool DisconnectWindowWin::SetStrings() { } // Format and truncate "Your desktop is shared with ..." message. - message_text = ReplaceStringPlaceholders(message_text, UTF8ToUTF16(username_), + message_text = ReplaceStringPlaceholders(message_text, + base::UTF8ToUTF16(username_), NULL); if (message_text.length() > kMaxSharingWithTextLength) message_text.erase(kMaxSharingWithTextLength); diff --git a/remoting/host/host_event_logger_win.cc b/remoting/host/host_event_logger_win.cc index 6fd5b6b..a9e22ad 100644 --- a/remoting/host/host_event_logger_win.cc +++ b/remoting/host/host_event_logger_win.cc @@ -60,8 +60,8 @@ HostEventLoggerWin::HostEventLoggerWin(base::WeakPtr<HostStatusMonitor> monitor, const std::string& application_name) : monitor_(monitor), event_log_(NULL) { - event_log_ = RegisterEventSourceW(NULL, - UTF8ToUTF16(application_name).c_str()); + event_log_ = RegisterEventSourceW( + NULL, base::UTF8ToUTF16(application_name).c_str()); if (event_log_ != NULL) { monitor_->AddStatusObserver(this); } else { @@ -122,7 +122,7 @@ void HostEventLoggerWin::Log(WORD type, std::vector<const WCHAR*> raw_strings(strings.size()); std::vector<base::string16> utf16_strings(strings.size()); for (size_t i = 0; i < strings.size(); ++i) { - utf16_strings[i] = UTF8ToUTF16(strings[i]); + utf16_strings[i] = base::UTF8ToUTF16(strings[i]); raw_strings[i] = utf16_strings[i].c_str(); } diff --git a/remoting/host/host_main.cc b/remoting/host/host_main.cc index 7c9fb16..a3d163e 100644 --- a/remoting/host/host_main.cc +++ b/remoting/host/host_main.cc @@ -217,7 +217,7 @@ int HostMain(int argc, char** argv) { CommandLine::StringVector args = command_line->GetArgs(); if (!args.empty()) { #if defined(OS_WIN) - std::string origin = UTF16ToUTF8(args[0]); + std::string origin = base::UTF16ToUTF8(args[0]); #else std::string origin = args[0]; #endif diff --git a/remoting/host/ipc_util_win.cc b/remoting/host/ipc_util_win.cc index 3325be5..a8c28db 100644 --- a/remoting/host/ipc_util_win.cc +++ b/remoting/host/ipc_util_win.cc @@ -39,7 +39,7 @@ bool CreateConnectedIpcChannel( // to the network process. It gives full access to the account that // the calling code is running under and denies access by anyone else. std::string security_descriptor = base::StringPrintf( - "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", WideToUTF8(user_sid).c_str()); + "O:%1$sG:%1$sD:(A;;GA;;;%1$s)", base::WideToUTF8(user_sid).c_str()); // Generate a unique name for the channel. std::string channel_name = IPC::Channel::GenerateUniqueRandomChannelID(); @@ -69,7 +69,7 @@ bool CreateConnectedIpcChannel( // Create the client end of the channel. This code should match the code in // IPC::Channel. ScopedHandle client; - client.Set(CreateFile(UTF8ToUTF16(pipe_name).c_str(), + client.Set(CreateFile(base::UTF8ToUTF16(pipe_name).c_str(), GENERIC_READ | GENERIC_WRITE, 0, &security_attributes, @@ -112,7 +112,7 @@ bool CreateIpcChannel( // IPC::Channel with exception of passing a non-default security descriptor. base::win::ScopedHandle pipe; pipe.Set(CreateNamedPipe( - UTF8ToUTF16(pipe_name).c_str(), + base::UTF8ToUTF16(pipe_name).c_str(), PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, 1, diff --git a/remoting/host/pairing_registry_delegate_win.cc b/remoting/host/pairing_registry_delegate_win.cc index 20230d0..7987f1c 100644 --- a/remoting/host/pairing_registry_delegate_win.cc +++ b/remoting/host/pairing_registry_delegate_win.cc @@ -48,7 +48,7 @@ scoped_ptr<base::DictionaryValue> ReadValue(const base::win::RegKey& key, } // Parse the value. - std::string value_json_utf8 = WideToUTF8(value_json); + std::string value_json_utf8 = base::WideToUTF8(value_json); JSONStringValueSerializer serializer(&value_json_utf8); int error_code; std::string error_message; @@ -82,7 +82,7 @@ bool WriteValue(base::win::RegKey& key, } // presubmit: allow wstring - std::wstring value_json = UTF8ToWide(value_json_utf8); + std::wstring value_json = base::UTF8ToWide(value_json_utf8); LONG result = key.WriteValue(value_name, value_json.c_str()); if (result != ERROR_SUCCESS) { SetLastError(result); @@ -135,7 +135,7 @@ scoped_ptr<base::ListValue> PairingRegistryDelegateWin::LoadAll() { continue; } - PairingRegistry::Pairing pairing = Load(WideToUTF8(value_name)); + PairingRegistry::Pairing pairing = Load(base::WideToUTF8(value_name)); if (pairing.is_valid()) pairings->Append(pairing.ToValue().release()); } @@ -168,7 +168,7 @@ bool PairingRegistryDelegateWin::DeleteAll() { PairingRegistry::Pairing PairingRegistryDelegateWin::Load( const std::string& client_id) { // presubmit: allow wstring - std::wstring value_name = UTF8ToWide(client_id); + std::wstring value_name = base::UTF8ToWide(client_id); // Read unprivileged fields first. scoped_ptr<base::DictionaryValue> pairing = ReadValue(unprivileged_, @@ -207,7 +207,7 @@ bool PairingRegistryDelegateWin::Save(const PairingRegistry::Pairing& pairing) { secret_json->Set(PairingRegistry::kSharedSecretKey, secret_key.release()); // presubmit: allow wstring - std::wstring value_name = UTF8ToWide(pairing.client_id()); + std::wstring value_name = base::UTF8ToWide(pairing.client_id()); // Write pairing to the registry. if (!WriteValue(privileged_, value_name.c_str(), secret_json.Pass()) || @@ -226,7 +226,7 @@ bool PairingRegistryDelegateWin::Delete(const std::string& client_id) { } // presubmit: allow wstring - std::wstring value_name = UTF8ToWide(client_id); + std::wstring value_name = base::UTF8ToWide(client_id); LONG result = privileged_.DeleteValue(value_name.c_str()); if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND && diff --git a/remoting/host/pairing_registry_delegate_win_unittest.cc b/remoting/host/pairing_registry_delegate_win_unittest.cc index b8b3953..991ac8f 100644 --- a/remoting/host/pairing_registry_delegate_win_unittest.cc +++ b/remoting/host/pairing_registry_delegate_win_unittest.cc @@ -22,7 +22,8 @@ class PairingRegistryDelegateWinTest : public testing::Test { key_name_ = base::GenerateGUID(); base::win::RegKey root; - EXPECT_TRUE(root.Create(HKEY_CURRENT_USER, UTF8ToWide(key_name_).c_str(), + EXPECT_TRUE(root.Create(HKEY_CURRENT_USER, + base::UTF8ToWide(key_name_).c_str(), KEY_READ | KEY_WRITE) == ERROR_SUCCESS); EXPECT_TRUE(privileged_.Create(root.Handle(), L"privileged", @@ -34,8 +35,9 @@ class PairingRegistryDelegateWinTest : public testing::Test { virtual void TearDown() OVERRIDE { privileged_.Close(); unprivileged_.Close(); - EXPECT_TRUE(SHDeleteKey(HKEY_CURRENT_USER, - UTF8ToWide(key_name_).c_str()) == ERROR_SUCCESS); + EXPECT_TRUE( + SHDeleteKey(HKEY_CURRENT_USER, + base::UTF8ToWide(key_name_).c_str()) == ERROR_SUCCESS); } protected: diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index 288b240..456ca50 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -939,7 +939,7 @@ void HostNPScriptObject::LocalizeStrings(NPObject* localize_func) { #if !defined(OS_WIN) base::string16 ui_locale; LocalizeString(localize_func, "@@ui_locale", &ui_locale); - remoting::LoadResources(UTF16ToUTF8(ui_locale)); + remoting::LoadResources(base::UTF16ToUTF8(ui_locale)); #endif // !defined(OS_WIN) } @@ -973,7 +973,7 @@ bool HostNPScriptObject::LocalizeStringWithSubstitution( LOG(ERROR) << "Missing translation for " << tag; return false; } - *result = UTF8ToUTF16(translation); + *result = base::UTF8ToUTF16(translation); return true; } diff --git a/remoting/host/policy_hack/policy_watcher_win.cc b/remoting/host/policy_hack/policy_watcher_win.cc index 83f67430..89816d4 100644 --- a/remoting/host/policy_hack/policy_watcher_win.cc +++ b/remoting/host/policy_hack/policy_watcher_win.cc @@ -115,13 +115,13 @@ class PolicyWatcherWin : bool GetRegistryPolicyString(const std::string& value_name, std::string* result) const { // presubmit: allow wstring - std::wstring value_name_wide = UTF8ToWide(value_name); + std::wstring value_name_wide = base::UTF8ToWide(value_name); // presubmit: allow wstring std::wstring value; RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); if (policy_key.ReadValue(value_name_wide.c_str(), &value) == ERROR_SUCCESS) { - *result = WideToUTF8(value); + *result = base::WideToUTF8(value); return true; } @@ -129,7 +129,7 @@ class PolicyWatcherWin : ERROR_SUCCESS) { if (policy_key.ReadValue(value_name_wide.c_str(), &value) == ERROR_SUCCESS) { - *result = WideToUTF8(value); + *result = base::WideToUTF8(value); return true; } } @@ -139,7 +139,7 @@ class PolicyWatcherWin : bool GetRegistryPolicyInteger(const std::string& value_name, uint32* result) const { // presubmit: allow wstring - std::wstring value_name_wide = UTF8ToWide(value_name); + std::wstring value_name_wide = base::UTF8ToWide(value_name); DWORD value = 0; RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); if (policy_key.ReadValueDW(value_name_wide.c_str(), &value) == diff --git a/remoting/host/setup/daemon_controller_delegate_win.cc b/remoting/host/setup/daemon_controller_delegate_win.cc index 74f5846..2070c49 100644 --- a/remoting/host/setup/daemon_controller_delegate_win.cc +++ b/remoting/host/setup/daemon_controller_delegate_win.cc @@ -58,7 +58,7 @@ const int kUnprivilegedTimeoutSec = 60; void ConfigToString(const base::DictionaryValue& config, ScopedBstr* out) { std::string config_str; base::JSONWriter::Write(&config, &config_str); - ScopedBstr config_scoped_bstr(UTF8ToUTF16(config_str).c_str()); + ScopedBstr config_scoped_bstr(base::UTF8ToUTF16(config_str).c_str()); out->Swap(config_scoped_bstr); } @@ -183,7 +183,7 @@ scoped_ptr<base::DictionaryValue> DaemonControllerDelegateWin::GetConfig() { base::string16 file_content( static_cast<BSTR>(host_config), host_config.Length()); scoped_ptr<base::Value> config( - base::JSONReader::Read(UTF16ToUTF8(file_content), + base::JSONReader::Read(base::UTF16ToUTF8(file_content), base::JSON_ALLOW_TRAILING_COMMAS)); if (!config || config->GetType() != base::Value::TYPE_DICTIONARY) @@ -278,7 +278,7 @@ std::string DaemonControllerDelegateWin::GetVersion() { if (FAILED(hr)) return std::string(); - return UTF16ToUTF8( + return base::UTF16ToUTF8( base::string16(static_cast<BSTR>(version), version.Length())); } diff --git a/remoting/host/setup/daemon_installer_win.cc b/remoting/host/setup/daemon_installer_win.cc index f7b7d35..f54b6d7 100644 --- a/remoting/host/setup/daemon_installer_win.cc +++ b/remoting/host/setup/daemon_installer_win.cc @@ -293,7 +293,7 @@ void DaemonCommandLineInstallerWin::Install() { } // Launch the updater process and wait for its termination. - base::string16 command_line = WideToUTF16( + base::string16 command_line = base::WideToUTF16( base::StringPrintf(kGoogleUpdateCommandLineFormat, google_update.c_str(), kHostOmahaAppid, diff --git a/remoting/host/setup/win/auth_code_getter.cc b/remoting/host/setup/win/auth_code_getter.cc index c680191..2fbb68d 100644 --- a/remoting/host/setup/win/auth_code_getter.cc +++ b/remoting/host/setup/win/auth_code_getter.cc @@ -38,7 +38,7 @@ void AuthCodeGetter::GetAuthCode( on_auth_code_.Run(""); return; } - base::win::ScopedBstr url(UTF8ToWide( + base::win::ScopedBstr url(base::UTF8ToWide( GetOauthStartUrl(GetDefaultOauthRedirectUrl())).c_str()); base::win::ScopedVariant empty_variant; hr = browser_->Navigate(url, empty_variant.AsInput(), empty_variant.AsInput(), @@ -76,7 +76,7 @@ bool AuthCodeGetter::TestBrowserUrl(std::string* auth_code) { KillBrowser(); return true; } - *auth_code = GetOauthCodeInUrl(WideToUTF8(static_cast<BSTR>(url)), + *auth_code = GetOauthCodeInUrl(base::WideToUTF8(static_cast<BSTR>(url)), GetDefaultOauthRedirectUrl()); if (!auth_code->empty()) { KillBrowser(); diff --git a/remoting/host/verify_config_window_win.cc b/remoting/host/verify_config_window_win.cc index df7a590..849d384 100644 --- a/remoting/host/verify_config_window_win.cc +++ b/remoting/host/verify_config_window_win.cc @@ -43,7 +43,7 @@ LRESULT VerifyConfigWindowWin::OnInitDialog(HWND wparam, LPARAM lparam) { CenterWindow(); CWindow email_text(GetDlgItem(IDC_EMAIL)); - email_text.SetWindowText(UTF8ToUTF16(email_).c_str()); + email_text.SetWindowText(base::UTF8ToUTF16(email_).c_str()); return TRUE; } @@ -114,7 +114,8 @@ bool VerifyConfigWindowWin::VerifyHostSecretHash() { int result = pin_edit.GetWindowText(pin.get(), pin_length + 1); pin[std::min(result, pin_length)] = 0; - return VerifyHostPinHash(host_secret_hash_, host_id_, UTF16ToUTF8(pin.get())); + return VerifyHostPinHash(host_secret_hash_, + host_id_, base::UTF16ToUTF8(pin.get())); } } // namespace remoting diff --git a/remoting/host/win/chromoting_module.cc b/remoting/host/win/chromoting_module.cc index 0e9f6b6..1d7a37e 100644 --- a/remoting/host/win/chromoting_module.cc +++ b/remoting/host/win/chromoting_module.cc @@ -204,7 +204,7 @@ int ElevatedControllerMain() { ChromotingModule module(elevated_controller_entry, elevated_controller_entry + 1); - if (!InitializeComSecurity(WideToUTF8(kElevatedControllerSd), "", true)) + if (!InitializeComSecurity(base::WideToUTF8(kElevatedControllerSd), "", true)) return kInitializationFailed; if (!module.Run()) diff --git a/remoting/host/win/elevated_controller.cc b/remoting/host/win/elevated_controller.cc index d2eea5e..d826dc9 100644 --- a/remoting/host/win/elevated_controller.cc +++ b/remoting/host/win/elevated_controller.cc @@ -322,7 +322,7 @@ STDMETHODIMP ElevatedController::GetConfig(BSTR* config_out) { std::string file_content; base::JSONWriter::Write(config.get(), &file_content); - *config_out = ::SysAllocString(UTF8ToUTF16(file_content).c_str()); + *config_out = ::SysAllocString(base::UTF8ToUTF16(file_content).c_str()); if (config_out == NULL) { return E_OUTOFMEMORY; } @@ -358,7 +358,7 @@ STDMETHODIMP ElevatedController::SetConfig(BSTR config) { return HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED); } - std::string file_content = UTF16ToUTF8( + std::string file_content = base::UTF16ToUTF8( base::string16(static_cast<base::char16*>(config), ::SysStringLen(config))); return WriteConfig(file_content.c_str(), file_content.size(), owner_window_); @@ -451,7 +451,7 @@ STDMETHODIMP ElevatedController::StopDaemon() { STDMETHODIMP ElevatedController::UpdateConfig(BSTR config) { // Parse the config. - std::string config_str = UTF16ToUTF8( + std::string config_str = base::UTF16ToUTF8( base::string16(static_cast<base::char16*>(config), ::SysStringLen(config))); scoped_ptr<base::Value> config_value(base::JSONReader::Read(config_str)); if (!config_value.get()) { diff --git a/remoting/host/win/host_service.cc b/remoting/host/win/host_service.cc index 1c7e199..8a9ff9e 100644 --- a/remoting/host/win/host_service.cc +++ b/remoting/host/win/host_service.cc @@ -272,8 +272,9 @@ void HostService::RunAsServiceImpl() { if (!com_initializer.succeeded()) return; - if (!InitializeComSecurity(WideToUTF8(kComProcessSd), - WideToUTF8(kComProcessMandatoryLabel), false)) { + if (!InitializeComSecurity(base::WideToUTF8(kComProcessSd), + base::WideToUTF8(kComProcessMandatoryLabel), + false)) { return; } @@ -308,8 +309,9 @@ int HostService::RunInConsole() { if (!com_initializer.succeeded()) return result; - if (!InitializeComSecurity(WideToUTF8(kComProcessSd), - WideToUTF8(kComProcessMandatoryLabel), false)) { + if (!InitializeComSecurity(base::WideToUTF8(kComProcessSd), + base::WideToUTF8(kComProcessMandatoryLabel), + false)) { return result; } diff --git a/remoting/host/win/launch_process_with_token.cc b/remoting/host/win/launch_process_with_token.cc index 6cb7e31..f7ce845 100644 --- a/remoting/host/win/launch_process_with_token.cc +++ b/remoting/host/win/launch_process_with_token.cc @@ -58,7 +58,8 @@ bool ConnectToExecutionServer(uint32 session_id, // Use winsta!WinStationQueryInformationW() to determine the process creation // pipe name for the session. - base::FilePath winsta_path(base::GetNativeLibraryName(UTF8ToUTF16("winsta"))); + base::FilePath winsta_path( + base::GetNativeLibraryName(base::UTF8ToUTF16("winsta"))); base::ScopedNativeLibrary winsta(winsta_path); if (winsta.is_valid()) { PWINSTATIONQUERYINFORMATIONW win_station_query_information = @@ -80,7 +81,7 @@ bool ConnectToExecutionServer(uint32 session_id, // Use the default pipe name if we couldn't query its name. if (pipe_name.empty()) { - pipe_name = UTF8ToUTF16( + pipe_name = base::UTF8ToUTF16( base::StringPrintf(kCreateProcessDefaultPipeNameFormat, session_id)); } diff --git a/remoting/host/win/rdp_client_window.cc b/remoting/host/win/rdp_client_window.cc index 9a2d366..fe3da3c 100644 --- a/remoting/host/win/rdp_client_window.cc +++ b/remoting/host/win/rdp_client_window.cc @@ -240,8 +240,8 @@ LRESULT RdpClientWindow::OnCreate(CREATESTRUCT* create_struct) { base::win::ScopedComPtr<mstsc::IMsTscSecuredSettings> secured_settings; base::win::ScopedComPtr<mstsc::IMsRdpClientSecuredSettings> secured_settings2; base::win::ScopedBstr server_name( - UTF8ToUTF16(server_endpoint_.ToStringWithoutPort()).c_str()); - base::win::ScopedBstr terminal_id(UTF8ToUTF16(terminal_id_).c_str()); + base::UTF8ToUTF16(server_endpoint_.ToStringWithoutPort()).c_str()); + base::win::ScopedBstr terminal_id(base::UTF8ToUTF16(terminal_id_).c_str()); // Create the child window that actually hosts the ActiveX control. RECT rect = { 0, 0, screen_size_.width(), screen_size_.height() }; diff --git a/remoting/host/win/rdp_desktop_session.cc b/remoting/host/win/rdp_desktop_session.cc index 73c3338..6f6d397 100644 --- a/remoting/host/win/rdp_desktop_session.cc +++ b/remoting/host/win/rdp_desktop_session.cc @@ -27,7 +27,7 @@ STDMETHODIMP RdpDesktopSession::Connect( client_.reset(new RdpClient(task_runner, task_runner, webrtc::DesktopSize(width, height), - UTF16ToUTF8(terminal_id), this)); + base::UTF16ToUTF8(terminal_id), this)); return S_OK; } diff --git a/remoting/host/win/security_descriptor.cc b/remoting/host/win/security_descriptor.cc index d6c7af0..572df45 100644 --- a/remoting/host/win/security_descriptor.cc +++ b/remoting/host/win/security_descriptor.cc @@ -15,7 +15,7 @@ ScopedSd ConvertSddlToSd(const std::string& sddl) { PSECURITY_DESCRIPTOR raw_sd = NULL; ULONG length = 0; if (!ConvertStringSecurityDescriptorToSecurityDescriptor( - UTF8ToUTF16(sddl).c_str(), SDDL_REVISION_1, &raw_sd, &length)) { + base::UTF8ToUTF16(sddl).c_str(), SDDL_REVISION_1, &raw_sd, &length)) { return ScopedSd(); } @@ -34,7 +34,7 @@ std::string ConvertSidToString(SID* sid) { base::string16 sid_string(c_sid_string); LocalFree(c_sid_string); - return UTF16ToUTF8(sid_string); + return base::UTF16ToUTF8(sid_string); } // Returns the logon SID of a token. Returns NULL if the token does not specify diff --git a/remoting/host/win/unprivileged_process_delegate.cc b/remoting/host/win/unprivileged_process_delegate.cc index 006b9e5..1457bd7 100644 --- a/remoting/host/win/unprivileged_process_delegate.cc +++ b/remoting/host/win/unprivileged_process_delegate.cc @@ -166,7 +166,7 @@ bool CreateWindowStationAndDesktop(ScopedSid logon_sid, WindowStationAndDesktop handles; handles.SetWindowStation(CreateWindowStation( - UTF8ToUTF16(window_station_name).c_str(), window_station_flags, + base::UTF8ToUTF16(window_station_name).c_str(), window_station_flags, desired_access, &security_attributes)); if (!handles.window_station()) { LOG_GETLASTERROR(ERROR) << "CreateWindowStation() failed"; diff --git a/remoting/host/win/wts_session_process_delegate.cc b/remoting/host/win/wts_session_process_delegate.cc index 0781649..f19b37d 100644 --- a/remoting/host/win/wts_session_process_delegate.cc +++ b/remoting/host/win/wts_session_process_delegate.cc @@ -387,7 +387,7 @@ void WtsSessionProcessDelegate::Core::DoLaunchProcess() { // Pass the name of the IPC channel to use. command_line.AppendSwitchNative(kDaemonPipeSwitchName, - UTF8ToWide(channel_name)); + base::UTF8ToWide(channel_name)); // Try to launch the process. ScopedHandle worker_process; @@ -399,7 +399,7 @@ void WtsSessionProcessDelegate::Core::DoLaunchProcess() { NULL, false, CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB, - UTF8ToUTF16(kDefaultDesktopName).c_str(), + base::UTF8ToUTF16(kDefaultDesktopName).c_str(), &worker_process, &worker_thread)) { ReportFatalError(); diff --git a/remoting/host/win/wts_terminal_monitor.cc b/remoting/host/win/wts_terminal_monitor.cc index d9d3732..6c65479 100644 --- a/remoting/host/win/wts_terminal_monitor.cc +++ b/remoting/host/win/wts_terminal_monitor.cc @@ -42,8 +42,9 @@ bool WtsTerminalMonitor::LookupTerminalId(uint32 session_id, return false; } - bool result = WideToUTF8(working_directory, (bytes / sizeof(wchar_t)) - 1, - terminal_id); + bool result = base::WideToUTF8(working_directory, + (bytes / sizeof(wchar_t)) - 1, + terminal_id); WTSFreeMemory(working_directory); return result; } diff --git a/rlz/ios/lib/machine_id_ios.cc b/rlz/ios/lib/machine_id_ios.cc index b712dd9..f000ce5 100644 --- a/rlz/ios/lib/machine_id_ios.cc +++ b/rlz/ios/lib/machine_id_ios.cc @@ -9,7 +9,7 @@ namespace rlz_lib { bool GetRawMachineId(base::string16* data, int* more_data) { - *data = ASCIIToUTF16(ios::device_util::GetDeviceIdentifier(NULL)); + *data = base::ASCIIToUTF16(ios::device_util::GetDeviceIdentifier(NULL)); *more_data = 1; return true; } diff --git a/rlz/lib/machine_id_unittest.cc b/rlz/lib/machine_id_unittest.cc index bcae511..b3f3c61 100644 --- a/rlz/lib/machine_id_unittest.cc +++ b/rlz/lib/machine_id_unittest.cc @@ -11,7 +11,7 @@ // This test will fail if the behavior of GetMachineId changes. TEST(MachineDealCodeTestMachineId, MachineId) { - base::string16 computer_sid(UTF8ToUTF16( + base::string16 computer_sid(base::UTF8ToUTF16( "S-1-5-21-2345599882-2448789067-1921365677")); std::string id; rlz_lib::testing::GetMachineIdImpl(computer_sid, 2651229008, &id); diff --git a/rlz/mac/lib/machine_id_mac.cc b/rlz/mac/lib/machine_id_mac.cc index af39bb8..6dbb0d7 100644 --- a/rlz/mac/lib/machine_id_mac.cc +++ b/rlz/mac/lib/machine_id_mac.cc @@ -123,9 +123,10 @@ bool GetRawMachineId(base::string16* data, int* more_data) { data->clear(); if (GetMacAddress(mac_address, sizeof(mac_address))) { - *data += ASCIIToUTF16(base::StringPrintf("mac:%02x%02x%02x%02x%02x%02x", - mac_address[0], mac_address[1], mac_address[2], - mac_address[3], mac_address[4], mac_address[5])); + *data += base::ASCIIToUTF16( + base::StringPrintf("mac:%02x%02x%02x%02x%02x%02x", + mac_address[0], mac_address[1], mac_address[2], + mac_address[3], mac_address[4], mac_address[5])); } // A MAC address is enough to uniquely identify a machine, but it's only 6 @@ -134,8 +135,8 @@ bool GetRawMachineId(base::string16* data, int* more_data) { CFStringRef serial = CopySerialNumber(); if (serial) { if (!data->empty()) - *data += UTF8ToUTF16(" "); - *data += UTF8ToUTF16("serial:") + base::SysCFStringRefToUTF16(serial); + *data += base::UTF8ToUTF16(" "); + *data += base::UTF8ToUTF16("serial:") + base::SysCFStringRefToUTF16(serial); CFRelease(serial); } diff --git a/rlz/win/lib/registry_util.cc b/rlz/win/lib/registry_util.cc index cb4a686..e5b7298 100644 --- a/rlz/win/lib/registry_util.cc +++ b/rlz/win/lib/registry_util.cc @@ -31,14 +31,14 @@ bool RegKeyReadValue(base::win::RegKey& key, const wchar_t* name, } // Note that RLZ string are always ASCII by design. - strncpy(value, WideToUTF8(value_string).c_str(), *value_size); + strncpy(value, base::WideToUTF8(value_string).c_str(), *value_size); value[*value_size - 1] = 0; return true; } bool RegKeyWriteValue(base::win::RegKey& key, const wchar_t* name, const char* value) { - std::wstring value_string(ASCIIToWide(value)); + std::wstring value_string(base::ASCIIToWide(value)); return key.WriteValue(name, value_string.c_str()) == ERROR_SUCCESS; } diff --git a/rlz/win/lib/rlz_value_store_registry.cc b/rlz/win/lib/rlz_value_store_registry.cc index 0aa0023..2b50767 100644 --- a/rlz/win/lib/rlz_value_store_registry.cc +++ b/rlz/win/lib/rlz_value_store_registry.cc @@ -13,6 +13,8 @@ #include "rlz/lib/string_utils.h" #include "rlz/win/lib/registry_util.h" +using base::ASCIIToWide; + namespace rlz_lib { namespace { diff --git a/sandbox/win/wow_helper/wow_helper.cc b/sandbox/win/wow_helper/wow_helper.cc index 847190a..ea73e84 100644 --- a/sandbox/win/wow_helper/wow_helper.cc +++ b/sandbox/win/wow_helper/wow_helper.cc @@ -15,43 +15,6 @@ #include "sandbox/win/wow_helper/service64_resolver.h" #include "sandbox/win/wow_helper/target_code.h" -namespace { - -// Grabbed from base/strings/string_util.h -template <class string_type> -inline typename string_type::value_type* WriteInto(string_type* str, - size_t length_with_null) { - str->reserve(length_with_null); - str->resize(length_with_null - 1); - return &((*str)[0]); -} - -// Grabbed from base/string_util.cc -std::string WideToMultiByte(const base::string16& wide, UINT code_page) { - if (wide.length() == 0) - return std::string(); - - // compute the length of the buffer we'll need - int charcount = WideCharToMultiByte(code_page, 0, wide.c_str(), -1, - NULL, 0, NULL, NULL); - if (charcount == 0) - return std::string(); - - // convert - std::string mb; - WideCharToMultiByte(code_page, 0, wide.c_str(), -1, - WriteInto(&mb, charcount), charcount, NULL, NULL); - - return mb; -} - -// Grabbed from base/string_util.cc -std::string WideToUTF8(const base::string16& wide) { - return WideToMultiByte(wide, CP_UTF8); -} - -} // namespace - namespace sandbox { // Performs the interception of NtMapViewOfSection on the 64-bit version of diff --git a/skia/ext/image_operations_bench.cc b/skia/ext/image_operations_bench.cc index 11263f3..78e127d 100644 --- a/skia/ext/image_operations_bench.cc +++ b/skia/ext/image_operations_bench.cc @@ -186,7 +186,7 @@ bool Benchmark::ParseArgs(const CommandLine* command_line) { const std::string& s = iter->first; std::string value; #if defined(OS_WIN) - value = WideToUTF8(iter->second); + value = base::WideToUTF8(iter->second); #else value = iter->second; #endif diff --git a/sql/connection.cc b/sql/connection.cc index bfea605..f9f80c2 100644 --- a/sql/connection.cc +++ b/sql/connection.cc @@ -242,7 +242,7 @@ bool Connection::Open(const base::FilePath& path) { } #if defined(OS_WIN) - return OpenInternal(WideToUTF8(path.value()), RETRY_ON_POISON); + return OpenInternal(base::WideToUTF8(path.value()), RETRY_ON_POISON); #elif defined(OS_POSIX) return OpenInternal(path.value(), RETRY_ON_POISON); #endif diff --git a/sql/statement.cc b/sql/statement.cc index 985497e..7001d17 100644 --- a/sql/statement.cc +++ b/sql/statement.cc @@ -150,7 +150,7 @@ bool Statement::BindString(int col, const std::string& val) { } bool Statement::BindString16(int col, const base::string16& value) { - return BindString(col, UTF16ToUTF8(value)); + return BindString(col, base::UTF16ToUTF8(value)); } bool Statement::BindBlob(int col, const void* val, int val_len) { @@ -240,7 +240,7 @@ base::string16 Statement::ColumnString16(int col) const { return base::string16(); std::string s = ColumnString(col); - return !s.empty() ? UTF8ToUTF16(s) : base::string16(); + return !s.empty() ? base::UTF8ToUTF16(s) : base::string16(); } int Statement::ColumnByteLength(int col) const { diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index 91be3b8..c8d5817 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -353,7 +353,7 @@ TEST_F(SyncApiTest, TestDeleteBehavior) { wnode.InitUniqueByCreation(BOOKMARKS, root_node, "testtag"); EXPECT_EQ(WriteNode::INIT_SUCCESS, result); wnode.SetIsFolder(false); - wnode.SetTitle(UTF8ToWide(test_title)); + wnode.SetTitle(base::UTF8ToWide(test_title)); node_id = wnode.GetId(); } @@ -398,7 +398,7 @@ TEST_F(SyncApiTest, TestDeleteBehavior) { EXPECT_EQ(wnode.GetParentId(), folder_node.GetId()); EXPECT_EQ(wnode.GetId(), node_id); EXPECT_NE(wnode.GetTitle(), test_title); // Title should be cleared - wnode.SetTitle(UTF8ToWide(test_title)); + wnode.SetTitle(base::UTF8ToWide(test_title)); } // Now look up should work. @@ -463,13 +463,13 @@ TEST_F(SyncApiTest, WriteEncryptedTitle) { WriteNode bookmark_node(&trans); ASSERT_TRUE(bookmark_node.InitBookmarkByCreation(root_node, NULL)); bookmark_id = bookmark_node.GetId(); - bookmark_node.SetTitle(UTF8ToWide("foo")); + bookmark_node.SetTitle(base::UTF8ToWide("foo")); WriteNode pref_node(&trans); WriteNode::InitUniqueByCreationResult result = pref_node.InitUniqueByCreation(PREFERENCES, root_node, "bar"); ASSERT_EQ(WriteNode::INIT_SUCCESS, result); - pref_node.SetTitle(UTF8ToWide("bar")); + pref_node.SetTitle(base::UTF8ToWide("bar")); } { ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); @@ -2123,7 +2123,7 @@ TEST_F(SyncManagerTest, CreateLocalBookmark) { WriteNode node(&trans); ASSERT_TRUE(node.InitBookmarkByCreation(bookmark_root, NULL)); node.SetIsFolder(false); - node.SetTitle(UTF8ToWide(title)); + node.SetTitle(base::UTF8ToWide(title)); sync_pb::BookmarkSpecifics bookmark_specifics(node.GetBookmarkSpecifics()); bookmark_specifics.set_url(url); @@ -2462,7 +2462,7 @@ TEST_F(SyncManagerTest, SetBookmarkTitle) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(BOOKMARKS, client_tag)); - node.SetTitle(UTF8ToWide(client_tag)); + node.SetTitle(base::UTF8ToWide(client_tag)); } EXPECT_FALSE(ResetUnsyncedEntry(BOOKMARKS, client_tag)); @@ -2472,7 +2472,7 @@ TEST_F(SyncManagerTest, SetBookmarkTitle) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(BOOKMARKS, client_tag)); - node.SetTitle(UTF8ToWide("title2")); + node.SetTitle(base::UTF8ToWide("title2")); } EXPECT_TRUE(ResetUnsyncedEntry(BOOKMARKS, client_tag)); } @@ -2511,7 +2511,7 @@ TEST_F(SyncManagerTest, SetBookmarkTitleWithEncryption) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(BOOKMARKS, client_tag)); - node.SetTitle(UTF8ToWide(client_tag)); + node.SetTitle(base::UTF8ToWide(client_tag)); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->GetSpecifics(); EXPECT_TRUE(specifics.has_encrypted()); @@ -2526,7 +2526,7 @@ TEST_F(SyncManagerTest, SetBookmarkTitleWithEncryption) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(BOOKMARKS, client_tag)); - node.SetTitle(UTF8ToWide("title2")); + node.SetTitle(base::UTF8ToWide("title2")); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->GetSpecifics(); EXPECT_TRUE(specifics.has_encrypted()); @@ -2557,7 +2557,7 @@ TEST_F(SyncManagerTest, SetNonBookmarkTitle) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(PREFERENCES, client_tag)); - node.SetTitle(UTF8ToWide(client_tag)); + node.SetTitle(base::UTF8ToWide(client_tag)); } EXPECT_FALSE(ResetUnsyncedEntry(PREFERENCES, client_tag)); @@ -2567,7 +2567,7 @@ TEST_F(SyncManagerTest, SetNonBookmarkTitle) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(PREFERENCES, client_tag)); - node.SetTitle(UTF8ToWide("title2")); + node.SetTitle(base::UTF8ToWide("title2")); } EXPECT_TRUE(ResetUnsyncedEntry(PREFERENCES, client_tag)); } @@ -2608,7 +2608,7 @@ TEST_F(SyncManagerTest, SetNonBookmarkTitleWithEncryption) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(PREFERENCES, client_tag)); - node.SetTitle(UTF8ToWide(client_tag)); + node.SetTitle(base::UTF8ToWide(client_tag)); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->GetSpecifics(); EXPECT_TRUE(specifics.has_encrypted()); @@ -2623,7 +2623,7 @@ TEST_F(SyncManagerTest, SetNonBookmarkTitleWithEncryption) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(PREFERENCES, client_tag)); - node.SetTitle(UTF8ToWide("title2")); + node.SetTitle(base::UTF8ToWide("title2")); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->GetSpecifics(); EXPECT_TRUE(specifics.has_encrypted()); @@ -2656,7 +2656,7 @@ TEST_F(SyncManagerTest, SetLongTitle) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(PREFERENCES, kClientTag)); - node.SetTitle(UTF8ToWide(title)); + node.SetTitle(base::UTF8ToWide(title)); EXPECT_EQ(node.GetTitle(), title.substr(0, 255)); } EXPECT_TRUE(ResetUnsyncedEntry(PREFERENCES, kClientTag)); @@ -2667,7 +2667,7 @@ TEST_F(SyncManagerTest, SetLongTitle) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(PREFERENCES, kClientTag)); - node.SetTitle(UTF8ToWide(title)); + node.SetTitle(base::UTF8ToWide(title)); EXPECT_EQ(node.GetTitle(), title.substr(0, 255)); } EXPECT_FALSE(ResetUnsyncedEntry(PREFERENCES, kClientTag)); @@ -2678,7 +2678,7 @@ TEST_F(SyncManagerTest, SetLongTitle) { WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByClientTagLookup(PREFERENCES, kClientTag)); - node.SetTitle(UTF8ToWide("title2")); + node.SetTitle(base::UTF8ToWide("title2")); } EXPECT_TRUE(ResetUnsyncedEntry(PREFERENCES, kClientTag)); } diff --git a/sync/internal_api/write_node.cc b/sync/internal_api/write_node.cc index 55f56b7..3e61374 100644 --- a/sync/internal_api/write_node.cc +++ b/sync/internal_api/write_node.cc @@ -57,7 +57,7 @@ void WriteNode::SetTitle(const std::wstring& title) { if (type != BOOKMARKS && needs_encryption) { new_legal_title = kEncryptedString; } else { - SyncAPINameToServerName(WideToUTF8(title), &new_legal_title); + SyncAPINameToServerName(base::WideToUTF8(title), &new_legal_title); base::TruncateUTF8ToByteSize(new_legal_title, 255, &new_legal_title); } diff --git a/sync/util/time.cc b/sync/util/time.cc index 00ff1b2..5f878a2 100644 --- a/sync/util/time.cc +++ b/sync/util/time.cc @@ -18,7 +18,7 @@ base::Time ProtoTimeToTime(int64 proto_t) { } std::string GetTimeDebugString(const base::Time& t) { - return UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime(t)); + return base::UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime(t)); } } // namespace syncer diff --git a/tools/gn/filesystem_utils.cc b/tools/gn/filesystem_utils.cc index 5d9b5f1..5866e71 100644 --- a/tools/gn/filesystem_utils.cc +++ b/tools/gn/filesystem_utils.cc @@ -197,7 +197,7 @@ const char* GetExtensionForOutputType(Target::OutputType type, std::string FilePathToUTF8(const base::FilePath::StringType& str) { #if defined(OS_WIN) - return WideToUTF8(str); + return base::WideToUTF8(str); #else return str; #endif @@ -205,7 +205,7 @@ std::string FilePathToUTF8(const base::FilePath::StringType& str) { base::FilePath UTF8ToFilePath(const base::StringPiece& sp) { #if defined(OS_WIN) - return base::FilePath(UTF8ToWide(sp)); + return base::FilePath(base::UTF8ToWide(sp)); #else return base::FilePath(sp.as_string()); #endif diff --git a/tools/gn/function_exec_script.cc b/tools/gn/function_exec_script.cc index c4d2262..b0bc7fd 100644 --- a/tools/gn/function_exec_script.cc +++ b/tools/gn/function_exec_script.cc @@ -340,7 +340,8 @@ Value RunExecScript(Scope* scope, base::TimeTicks begin_exec; if (g_scheduler->verbose_logging()) { #if defined(OS_WIN) - g_scheduler->Log("Pythoning", UTF16ToUTF8(cmdline.GetCommandLineString())); + g_scheduler->Log("Pythoning", + base::UTF16ToUTF8(cmdline.GetCommandLineString())); #else g_scheduler->Log("Pythoning", cmdline.GetCommandLineString()); #endif diff --git a/tools/gn/generate_test_gn_data.cc b/tools/gn/generate_test_gn_data.cc index 730ae99..cebf3a0 100644 --- a/tools/gn/generate_test_gn_data.cc +++ b/tools/gn/generate_test_gn_data.cc @@ -18,7 +18,7 @@ int targets_written = 0; base::FilePath UTF8ToFilePath(const std::string& s) { #if defined(OS_WIN) - return base::FilePath(UTF8ToWide(s)); + return base::FilePath(base::UTF8ToWide(s)); #else return base::FilePath(s); #endif @@ -26,7 +26,7 @@ base::FilePath UTF8ToFilePath(const std::string& s) { std::string FilePathToUTF8(const base::FilePath& path) { #if defined(OS_WIN) - return WideToUTF8(path.value()); + return base::WideToUTF8(path.value()); #else return path.value(); #endif diff --git a/tools/gn/ninja_build_writer.cc b/tools/gn/ninja_build_writer.cc index a8938b5..ded584b 100644 --- a/tools/gn/ninja_build_writer.cc +++ b/tools/gn/ninja_build_writer.cc @@ -29,7 +29,7 @@ std::string GetSelfInvocationCommand(const BuildSettings* build_settings) { #if defined(OS_WIN) wchar_t module[MAX_PATH]; GetModuleFileName(NULL, module, MAX_PATH); - //result = "\"" + WideToUTF8(module) + "\""; + //result = "\"" + base::WideToUTF8(module) + "\""; base::FilePath executable(module); #elif defined(OS_MACOSX) // FIXME(brettw) write this on Mac! @@ -70,7 +70,7 @@ std::string GetSelfInvocationCommand(const BuildSettings* build_settings) { } #if defined(OS_WIN) - return WideToUTF8(cmdline.GetCommandLineString()); + return base::WideToUTF8(cmdline.GetCommandLineString()); #else return cmdline.GetCommandLineString(); #endif diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc index e074681c..b9b59c6 100644 --- a/tools/gn/setup.cc +++ b/tools/gn/setup.cc @@ -320,7 +320,8 @@ void Setup::FillPythonPath() { "just \"python.exe\""); python_path = "python.exe"; } - build_settings_.set_python_path(base::FilePath(UTF8ToUTF16(python_path))); + build_settings_.set_python_path( + base::FilePath(base::UTF8ToUTF16(python_path))); #else build_settings_.set_python_path(base::FilePath("python")); #endif diff --git a/tools/imagediff/image_diff.cc b/tools/imagediff/image_diff.cc index 604f27e..740a397 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(ASCIIToWide(str)); + return base::FilePath(base::ASCIIToWide(str)); #else return base::FilePath(str); #endif diff --git a/tools/ipc_fuzzer/mutate/mutate.cc b/tools/ipc_fuzzer/mutate/mutate.cc index 5cad5a1..9350931 100644 --- a/tools/ipc_fuzzer/mutate/mutate.cc +++ b/tools/ipc_fuzzer/mutate/mutate.cc @@ -149,8 +149,8 @@ class DefaultFuzzer : public Fuzzer { virtual void FuzzString16(base::string16* value) OVERRIDE { FuzzStringType<base::string16>(value, frequency_, - WideToUTF16(L"BORKED"), - WideToUTF16(L"")); + base::WideToUTF16(L"BORKED"), + base::WideToUTF16(L"")); } virtual void FuzzData(char* data, int length) OVERRIDE { diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py index 4193c03..68152b5 100644 --- a/tools/json_schema_compiler/cc_generator.py +++ b/tools/json_schema_compiler/cc_generator.py @@ -927,7 +927,7 @@ class _Generator(object): if not self._generate_error_messages: return c (c.Append('if (error)') - .Append(' *error = UTF8ToUTF16(' + body + ');')) + .Append(' *error = base::UTF8ToUTF16(' + body + ');')) return c def _GenerateParams(self, params): diff --git a/tools/json_schema_compiler/test/error_generation_unittest.cc b/tools/json_schema_compiler/test/error_generation_unittest.cc index f5a24fa..9515f07 100644 --- a/tools/json_schema_compiler/test/error_generation_unittest.cc +++ b/tools/json_schema_compiler/test/error_generation_unittest.cc @@ -24,7 +24,7 @@ base::string16 GetPopulateError(const base::Value& value) { testing::AssertionResult EqualsUtf16(const std::string& expected, const base::string16& actual) { - if (ASCIIToUTF16(expected) != actual) + if (base::ASCIIToUTF16(expected) != actual) return testing::AssertionFailure() << expected << " != " << actual; return testing::AssertionSuccess(); } diff --git a/tools/memory_watcher/memory_watcher.cc b/tools/memory_watcher/memory_watcher.cc index 4743a37..38e933c 100644 --- a/tools/memory_watcher/memory_watcher.cc +++ b/tools/memory_watcher/memory_watcher.cc @@ -80,10 +80,10 @@ void MemoryWatcher::CloseLogFile() { if (file_ != NULL) { fclose(file_); file_ = NULL; - std::wstring tmp_name = ASCIIToWide(file_name_); + std::wstring tmp_name = base::ASCIIToWide(file_name_); tmp_name += L".tmp"; base::Move(base::FilePath(tmp_name), - base::FilePath(ASCIIToWide(file_name_))); + base::FilePath(base::ASCIIToWide(file_name_))); } } diff --git a/webkit/browser/appcache/manifest_parser.cc b/webkit/browser/appcache/manifest_parser.cc index be44127..5735fe4 100644 --- a/webkit/browser/appcache/manifest_parser.cc +++ b/webkit/browser/appcache/manifest_parser.cc @@ -187,7 +187,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, ++line_p; base::string16 url16; - WideToUTF16(line.c_str(), line_p - line.c_str(), &url16); + base::WideToUTF16(line.c_str(), line_p - line.c_str(), &url16); GURL url = manifest_url.Resolve(url16); if (!url.is_valid()) continue; @@ -232,7 +232,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, continue; // There was no whitespace separating the URLs. base::string16 namespace_url16; - WideToUTF16(line.c_str(), line_p - line.c_str(), &namespace_url16); + base::WideToUTF16(line.c_str(), line_p - line.c_str(), &namespace_url16); GURL namespace_url = manifest_url.Resolve(namespace_url16); if (!namespace_url.is_valid()) continue; @@ -279,7 +279,8 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, ++line_p; base::string16 target_url16; - WideToUTF16(target_url_start, line_p - target_url_start, &target_url16); + base::WideToUTF16(target_url_start, line_p - target_url_start, + &target_url16); GURL target_url = manifest_url.Resolve(target_url16); if (!target_url.is_valid()) continue; @@ -310,7 +311,7 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, } base::string16 namespace_url16; - WideToUTF16(line.c_str(), line_p - line.c_str(), &namespace_url16); + base::WideToUTF16(line.c_str(), line_p - line.c_str(), &namespace_url16); GURL namespace_url = manifest_url.Resolve(namespace_url16); if (!namespace_url.is_valid()) continue; @@ -336,7 +337,8 @@ bool ParseManifest(const GURL& manifest_url, const char* data, int length, ++line_p; base::string16 fallback_url16; - WideToUTF16(fallback_start, line_p - fallback_start, &fallback_url16); + base::WideToUTF16(fallback_start, line_p - fallback_start, + &fallback_url16); GURL fallback_url = manifest_url.Resolve(fallback_url16); if (!fallback_url.is_valid()) continue; diff --git a/webkit/browser/appcache/view_appcache_internals_job.cc b/webkit/browser/appcache/view_appcache_internals_job.cc index 8867b75..7225882 100644 --- a/webkit/browser/appcache/view_appcache_internals_job.cc +++ b/webkit/browser/appcache/view_appcache_internals_job.cc @@ -128,19 +128,19 @@ void EmitAppCacheInfo(const GURL& base_url, out->append("<ul>"); EmitListItem( kSize, - UTF16ToUTF8(FormatBytesUnlocalized(info->size)), + base::UTF16ToUTF8(FormatBytesUnlocalized(info->size)), out); EmitListItem( kCreationTime, - UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->creation_time)), + base::UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->creation_time)), out); EmitListItem( kLastUpdateTime, - UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->last_update_time)), + base::UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->last_update_time)), out); EmitListItem( kLastAccessTime, - UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->last_access_time)), + base::UTF16ToUTF8(TimeFormatFriendlyDateAndTime(info->last_access_time)), out); out->append("</ul></p></br>\n"); } @@ -242,7 +242,7 @@ void EmitAppCacheResourceInfoVector( iter->url, iter->response_id, group_id), false, false, out); - EmitTableData(UTF16ToUTF8(FormatBytesUnlocalized(iter->size)), + EmitTableData(base::UTF16ToUTF8(FormatBytesUnlocalized(iter->size)), true, false, out); out->append("</tr>\n"); } diff --git a/webkit/browser/blob/view_blob_internals_job.cc b/webkit/browser/blob/view_blob_internals_job.cc index fa9e82a..86a3a87 100644 --- a/webkit/browser/blob/view_blob_internals_job.cc +++ b/webkit/browser/blob/view_blob_internals_job.cc @@ -182,12 +182,12 @@ void ViewBlobInternalsJob::GenerateHTMLForBlobData(const BlobData& blob_data, bool has_multi_items = blob_data.items().size() > 1; if (has_multi_items) { AddHTMLListItem(kCount, - UTF16ToUTF8(base::FormatNumber(blob_data.items().size())), out); + base::UTF16ToUTF8(base::FormatNumber(blob_data.items().size())), out); } for (size_t i = 0; i < blob_data.items().size(); ++i) { if (has_multi_items) { - AddHTMLListItem(kIndex, UTF16ToUTF8(base::FormatNumber(i)), out); + AddHTMLListItem(kIndex, base::UTF16ToUTF8(base::FormatNumber(i)), out); StartHTMLList(out); } const BlobData::Item& item = blob_data.items().at(i); @@ -202,7 +202,7 @@ void ViewBlobInternalsJob::GenerateHTMLForBlobData(const BlobData& blob_data, net::EscapeForHTML(item.path().AsUTF8Unsafe()), out); if (!item.expected_modification_time().is_null()) { - AddHTMLListItem(kModificationTime, UTF16ToUTF8( + AddHTMLListItem(kModificationTime, base::UTF16ToUTF8( TimeFormatFriendlyDateAndTime(item.expected_modification_time())), out); } @@ -214,7 +214,7 @@ void ViewBlobInternalsJob::GenerateHTMLForBlobData(const BlobData& blob_data, AddHTMLListItem(kType, "filesystem", out); AddHTMLListItem(kURL, item.filesystem_url().spec(), out); if (!item.expected_modification_time().is_null()) { - AddHTMLListItem(kModificationTime, UTF16ToUTF8( + AddHTMLListItem(kModificationTime, base::UTF16ToUTF8( TimeFormatFriendlyDateAndTime(item.expected_modification_time())), out); } @@ -224,11 +224,11 @@ void ViewBlobInternalsJob::GenerateHTMLForBlobData(const BlobData& blob_data, break; } if (item.offset()) { - AddHTMLListItem(kOffset, UTF16ToUTF8(base::FormatNumber( + AddHTMLListItem(kOffset, base::UTF16ToUTF8(base::FormatNumber( static_cast<int64>(item.offset()))), out); } if (static_cast<int64>(item.length()) != -1) { - AddHTMLListItem(kLength, UTF16ToUTF8(base::FormatNumber( + AddHTMLListItem(kLength, base::UTF16ToUTF8(base::FormatNumber( static_cast<int64>(item.length()))), out); } diff --git a/webkit/browser/database/database_quota_client_unittest.cc b/webkit/browser/database/database_quota_client_unittest.cc index 3d4f71a..ffdcda0 100644 --- a/webkit/browser/database/database_quota_client_unittest.cc +++ b/webkit/browser/database/database_quota_client_unittest.cc @@ -87,7 +87,7 @@ class MockDatabaseTracker : public DatabaseTracker { void AddMockDatabase(const GURL& origin, const char* name, int size) { MockOriginInfo& info = mock_origin_infos_[origin]; info.set_origin(webkit_database::GetIdentifierFromOrigin(origin)); - info.AddMockDatabase(ASCIIToUTF16(name), size); + info.AddMockDatabase(base::ASCIIToUTF16(name), size); } int delete_called_count() { return delete_called_count_; } diff --git a/webkit/browser/database/database_tracker_unittest.cc b/webkit/browser/database/database_tracker_unittest.cc index bb931d4..bdb5b0c 100644 --- a/webkit/browser/database/database_tracker_unittest.cc +++ b/webkit/browser/database/database_tracker_unittest.cc @@ -20,6 +20,8 @@ #include "webkit/browser/quota/quota_manager.h" #include "webkit/common/database/database_identifier.h" +using base::ASCIIToWide; + namespace { const char kOrigin1Url[] = "http://origin1"; diff --git a/webkit/browser/database/database_util_unittest.cc b/webkit/browser/database/database_util_unittest.cc index e776b79..f7c5d5f 100644 --- a/webkit/browser/database/database_util_unittest.cc +++ b/webkit/browser/database/database_util_unittest.cc @@ -8,6 +8,7 @@ #include "webkit/browser/database/database_util.h" #include "webkit/common/database/database_identifier.h" +using base::ASCIIToWide; using webkit_database::DatabaseUtil; static void TestVfsFilePath(bool expected_result, diff --git a/webkit/browser/database/databases_table_unittest.cc b/webkit/browser/database/databases_table_unittest.cc index 09023f9..cca7506 100644 --- a/webkit/browser/database/databases_table_unittest.cc +++ b/webkit/browser/database/databases_table_unittest.cc @@ -12,6 +12,8 @@ #include "third_party/sqlite/sqlite3.h" #include "webkit/browser/database/databases_table.h" +using base::ASCIIToWide; + namespace webkit_database { static void CheckDetailsAreEqual(const DatabaseDetails& d1, diff --git a/webkit/child/ftp_directory_listing_response_delegate.cc b/webkit/child/ftp_directory_listing_response_delegate.cc index bad606e..4b35b58 100644 --- a/webkit/child/ftp_directory_listing_response_delegate.cc +++ b/webkit/child/ftp_directory_listing_response_delegate.cc @@ -33,7 +33,7 @@ base::string16 ConvertPathToUTF16(const std::string& path) { // Per RFC 2640, FTP servers should use UTF-8 or its proper subset ASCII, // but many old FTP servers use legacy encodings. Try UTF-8 first. if (IsStringUTF8(path)) - return UTF8ToUTF16(path); + return base::UTF8ToUTF16(path); // Try detecting the encoding. The sample is rather small though, so it may // fail. @@ -111,7 +111,7 @@ void FtpDirectoryListingResponseDelegate::Init(const GURL& response_url) { // add a link to the parent directory. if (response_url.path().length() > 1) { SendDataToClient(net::GetDirectoryListingEntry( - ASCIIToUTF16(".."), std::string(), false, 0, base::Time())); + base::ASCIIToUTF16(".."), std::string(), false, 0, base::Time())); } } diff --git a/webkit/common/database/database_connections_unittest.cc b/webkit/common/database/database_connections_unittest.cc index 94b293e..4f9f780 100644 --- a/webkit/common/database/database_connections_unittest.cc +++ b/webkit/common/database/database_connections_unittest.cc @@ -9,6 +9,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/common/database/database_connections.h" +using base::ASCIIToWide; + namespace webkit_database { namespace { diff --git a/webkit/common/fileapi/file_system_util.cc b/webkit/common/fileapi/file_system_util.cc index 4d5c352..ef685fe 100644 --- a/webkit/common/fileapi/file_system_util.cc +++ b/webkit/common/fileapi/file_system_util.cc @@ -268,7 +268,7 @@ std::string GetFileSystemTypeString(FileSystemType type) { std::string FilePathToString(const base::FilePath& file_path) { #if defined(OS_WIN) - return UTF16ToUTF8(file_path.value()); + return base::UTF16ToUTF8(file_path.value()); #elif defined(OS_POSIX) return file_path.value(); #endif @@ -276,7 +276,7 @@ std::string FilePathToString(const base::FilePath& file_path) { base::FilePath StringToFilePath(const std::string& file_path_string) { #if defined(OS_WIN) - return base::FilePath(UTF8ToUTF16(file_path_string)); + return base::FilePath(base::UTF8ToUTF16(file_path_string)); #elif defined(OS_POSIX) return base::FilePath(file_path_string); #endif diff --git a/webkit/common/webpreferences.cc b/webkit/common/webpreferences.cc index 4096932..59f2c61 100644 --- a/webkit/common/webpreferences.cc +++ b/webkit/common/webpreferences.cc @@ -10,6 +10,7 @@ #include "third_party/WebKit/public/web/WebSettings.h" #include "third_party/icu/source/common/unicode/uchar.h" +using base::ASCIIToWide; using blink::WebSettings; WebPreferences::WebPreferences() diff --git a/webkit/renderer/cpp_bound_class.cc b/webkit/renderer/cpp_bound_class.cc index 6a652f48..a0bce49 100644 --- a/webkit/renderer/cpp_bound_class.cc +++ b/webkit/renderer/cpp_bound_class.cc @@ -321,7 +321,7 @@ void CppBoundClass::BindToJavascript(WebFrame* frame, // up after itself. It will also (indirectly) register the object with V8, // against an owner pointer we supply, so we must register that as an owner, // and unregister when we teardown. - frame->bindToWindowObject(ASCIIToUTF16(classname), + frame->bindToWindowObject(base::ASCIIToUTF16(classname), NPVARIANT_TO_OBJECT(*GetAsCppVariant())); bound_to_frame_ = true; } diff --git a/win8/delegate_execute/delegate_execute_util_unittest.cc b/win8/delegate_execute/delegate_execute_util_unittest.cc index ca444b8..40a2e71 100644 --- a/win8/delegate_execute/delegate_execute_util_unittest.cc +++ b/win8/delegate_execute/delegate_execute_util_unittest.cc @@ -28,7 +28,8 @@ TEST(DelegateExecuteUtil, CommandLineFromParametersTest) { // Parameters with a switch are parsed properly. cl = delegate_execute::CommandLineFromParameters( - base::StringPrintf(L"--%ls", ASCIIToWide(kSomeSwitch).c_str()).c_str()); + base::StringPrintf(L"--%ls", + base::ASCIIToWide(kSomeSwitch).c_str()).c_str()); EXPECT_EQ(std::wstring(), cl.GetProgram().value()); EXPECT_TRUE(cl.HasSwitch(kSomeSwitch)); } @@ -60,7 +61,8 @@ TEST(DelegateExecuteUtil, MakeChromeCommandLineTest) { // Params with switchs and args plus arg contains the arg. cl = delegate_execute::MakeChromeCommandLine( this_exe, delegate_execute::CommandLineFromParameters( - base::StringPrintf(L"--%ls -- %ls", ASCIIToWide(kSomeSwitch).c_str(), + base::StringPrintf(L"--%ls -- %ls", + base::ASCIIToWide(kSomeSwitch).c_str(), kOtherArgument).c_str()), base::string16(kSomeArgument)); EXPECT_EQ(5, cl.argv().size()); diff --git a/win8/metro_driver/secondary_tile.cc b/win8/metro_driver/secondary_tile.cc index d892199..f04aacc 100644 --- a/win8/metro_driver/secondary_tile.cc +++ b/win8/metro_driver/secondary_tile.cc @@ -147,7 +147,7 @@ void CreateTileOnStartScreen(const base::string16& tile_id, // chrome will see the arguments as command line parameters. // A GURL is used to ensure any spaces are properly escaped. GURL url(url_str); - args.Attach(MakeHString(UTF8ToUTF16(url.spec()))); + args.Attach(MakeHString(base::UTF8ToUTF16(url.spec()))); mswr::ComPtr<winfoundtn::IUriRuntimeClassFactory> uri_factory; hr = winrt_utils::CreateActivationFactory( |