diff options
31 files changed, 107 insertions, 97 deletions
diff --git a/base/command_line.cc b/base/command_line.cc index 21c7470..4346268 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -308,7 +308,7 @@ void CommandLine::AppendSwitchWithValue(wstring* command_line_string, (value_string[0] != L'"') && (value_string[value_string.length() - 1] != L'"')) { // need to provide quotes - StringAppendF(command_line_string, L"\"%s\"", value_string.c_str()); + StringAppendF(command_line_string, L"\"%ls\"", value_string.c_str()); } else { command_line_string->append(value_string); } diff --git a/base/file_version_info.cc b/base/file_version_info.cc index 90aedd2..fbe90a1 100644 --- a/base/file_version_info.cc +++ b/base/file_version_info.cc @@ -183,7 +183,7 @@ bool FileVersionInfo::GetValue(const wchar_t* name, std::wstring* value_str) { WORD language = lang_codepage[i++]; WORD code_page = lang_codepage[i++]; _snwprintf_s(sub_block, MAX_PATH, MAX_PATH, - L"\\StringFileInfo\\%04x%04x\\%s", language, code_page, name); + L"\\StringFileInfo\\%04x%04x\\%ls", language, code_page, name); LPVOID value = NULL; uint32 size; BOOL r = ::VerQueryValue(data_.get(), sub_block, &value, &size); diff --git a/base/gfx/font_utils.cc b/base/gfx/font_utils.cc index 9ca1852..cf8fce4 100644 --- a/base/gfx/font_utils.cc +++ b/base/gfx/font_utils.cc @@ -295,7 +295,7 @@ bool GetDerivedFontData(const wchar_t *family, // TODO(jungshik) : This comes up pretty high in the profile so that // we need to measure whether using SHA256 (after coercing all the // fields to char*) is faster than StringPrintf. - std::wstring font_key = StringPrintf(L"%1d:%d:%s", style, logfont->lfHeight, + std::wstring font_key = StringPrintf(L"%1d:%d:%ls", style, logfont->lfHeight, family); FontDataCache::const_iterator iter = font_data_cache->find(font_key); FontData *derived; diff --git a/base/win_util.cc b/base/win_util.cc index a5b46f5..74aed14 100644 --- a/base/win_util.cc +++ b/base/win_util.cc @@ -220,7 +220,7 @@ bool GetLogonSessionOnlyDACL(SECURITY_DESCRIPTOR** security_descriptor) { if (!ConvertSidToStringSid(logon_sid, &sid_string)) return false; - static const wchar_t dacl_format[] = L"D:(A;OICI;GA;;;%s)"; + static const wchar_t dacl_format[] = L"D:(A;OICI;GA;;;%ls)"; wchar_t dacl[SECURITY_MAX_SID_SIZE + arraysize(dacl_format) + 1] = {0}; wsprintf(dacl, dacl_format, sid_string); diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index f710c33..0461b6a 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -177,8 +177,8 @@ void ReadLastShutdownInfo() { prefs->SetInteger(prefs::kShutdownNumProcessesSlow, 0); if (type > NOT_VALID && shutdown_ms > 0 && num_procs > 0) { - const wchar_t *time_fmt = L"Shutdown.%s.time"; - const wchar_t *time_per_fmt = L"Shutdown.%s.time_per_process"; + const wchar_t *time_fmt = L"Shutdown.%ls.time"; + const wchar_t *time_per_fmt = L"Shutdown.%ls.time_per_process"; std::wstring time; std::wstring time_per; if (type == WINDOW_CLOSE) { diff --git a/chrome/browser/history/text_database.cc b/chrome/browser/history/text_database.cc index 0c1242f..0eab85a 100644 --- a/chrome/browser/history/text_database.cc +++ b/chrome/browser/history/text_database.cc @@ -130,7 +130,7 @@ std::wstring TextDatabase::IDToFileName(DBIdent id) { // "History Index 2008-01". However, we don't make assumptions about this // scheme: the caller should assign IDs as it feels fit with the knowledge // that they will apppear on disk in this form. - return StringPrintf(L"%s%d-%02d", file_base(), id / 100, id % 100); + return StringPrintf(L"%ls%d-%02d", file_base(), id / 100, id % 100); } // static diff --git a/chrome/browser/printing/page_overlays_unittest.cc b/chrome/browser/printing/page_overlays_unittest.cc index d1b3bc6..d15453a 100644 --- a/chrome/browser/printing/page_overlays_unittest.cc +++ b/chrome/browser/printing/page_overlays_unittest.cc @@ -88,7 +88,7 @@ TEST(PageOverlaysTest, StringConversion) { std::wstring input; std::wstring out; for (int i = 0; i < arraysize(kOverlayKeys); ++i) { - input = StringPrintf(L"foo%sbar", kOverlayKeys[i].key); + input = StringPrintf(L"foo%lsbar", kOverlayKeys[i].key); out = printing::PageOverlays::ReplaceVariables(input, *doc.get(), *page.get()); EXPECT_FALSE(out.empty()); diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc index d8ade00..00116b4 100644 --- a/chrome/browser/render_view_host.cc +++ b/chrome/browser/render_view_host.cc @@ -1071,7 +1071,7 @@ void RenderViewHost::DidPrintPage( void RenderViewHost::OnAddMessageToConsole(const std::wstring& message, int32 line_no, const std::wstring& source_id) { - std::wstring msg = StringPrintf(L"\"%s,\" source: %s (%d)", message.c_str(), + std::wstring msg = StringPrintf(L"\"%ls,\" source: %ls (%d)", message.c_str(), source_id.c_str(), line_no); logging::LogMessage("CONSOLE", 0).stream() << msg; if (debugger_attached_) diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index ec6f671..bb817df 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -51,13 +51,13 @@ // diagnostic page. // TODO(paulg): Change 'googleclient' to a proper client name before launch. static const char* const kSbDiagnosticUrl = - "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=%s&client=googleclient"; + "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=%ls&client=googleclient"; static const char* const kSbReportPhishingUrl = "http://www.google.com/safebrowsing/report_error/"; static const wchar_t* const kSbDiagnosticHtml = - L"<a href=\"\" onClick=\"sendCommand(4); return false;\">%s</a>"; + L"<a href=\"\" onClick=\"sendCommand(4); return false;\">%ls</a>"; // Created on the io_thread. SafeBrowsingBlockingPage::SafeBrowsingBlockingPage( diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc index b4a05952..41adebc 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc @@ -477,7 +477,7 @@ TEST(SafeBrowsing, HashCaching) { void PrintStat(const wchar_t* name) { int value = StatsTable::current()->GetCounterValue(name); - std::wstring out = StringPrintf(L"%s %d\r\n", name, value); + std::wstring out = StringPrintf(L"%ls %d\r\n", name, value); OutputDebugStringW(out.c_str()); } @@ -650,4 +650,4 @@ TEST(SafeBrowsing, DISABLED_DatabaseOldLotsofDeletesIO) { del.chunk_del.push_back(ChunkRange(3539, 3579)); deletes->push_back(del); PeformUpdate(L"old\\SafeBrowsing", chunks, deletes); -}
\ No newline at end of file +} diff --git a/chrome/browser/save_package.cc b/chrome/browser/save_package.cc index 3aac7a8..d615e32 100644 --- a/chrome/browser/save_package.cc +++ b/chrome/browser/save_package.cc @@ -303,7 +303,7 @@ bool SavePackage::GenerateFilename(const std::string& disposition, uint32 i; for (i = ordinal_number; i < kMaxFileOrdinalNumber; ++i) { std::wstring new_name = - StringPrintf(L"%s(%d)", base_file_name.c_str(), i) + file_name_ext; + StringPrintf(L"%ls(%d)", base_file_name.c_str(), i) + file_name_ext; if (file_name_set_.find(new_name) == file_name_set_.end()) { // Resolved name conflict. file_name = new_name; diff --git a/chrome/browser/views/options/language_combobox_model.cc b/chrome/browser/views/options/language_combobox_model.cc index 7743a8c..29a6659 100644 --- a/chrome/browser/views/options/language_combobox_model.cc +++ b/chrome/browser/views/options/language_combobox_model.cc @@ -137,7 +137,7 @@ std::wstring LanguageComboboxModel::GetItemAt(ChromeViews::ComboBox* source, // changed the format. We also want to switch the order of locale_name // and native_name without going back to translators. std::wstring formatted_item; - SStringPrintf(&formatted_item, L"%s - %s", locale_name.c_str(), + SStringPrintf(&formatted_item, L"%ls - %ls", locale_name.c_str(), native_name.c_str()); if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) // Somehow combo box (even with LAYOUTRTL flag) doesn't get this diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc index 81796aa..4519bfc 100644 --- a/chrome/browser/visitedlink_master.cc +++ b/chrome/browser/visitedlink_master.cc @@ -287,7 +287,7 @@ std::wstring VisitedLinkMaster::GetSharedMemoryName() const { if (profile_) profile_id = profile_->GetID().c_str(); - return StringPrintf(L"GVisitedLinks_%lu_%lu_%s", + return StringPrintf(L"GVisitedLinks_%lu_%lu_%ls", GetCurrentProcessId(), shared_memory_serial_, profile_id.c_str()); } diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index 3361467..7939147 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -243,7 +243,7 @@ struct ParamTraits<wchar_t> { return result; } static void Log(const param_type& p, std::wstring* l) { - l->append(StringPrintf(L"%c", p)); + l->append(StringPrintf(L"%lc", p)); } }; diff --git a/chrome/test/automation/autocomplete_edit_proxy.h b/chrome/test/automation/autocomplete_edit_proxy.h index 608d1f1..01fab33 100644 --- a/chrome/test/automation/autocomplete_edit_proxy.h +++ b/chrome/test/automation/autocomplete_edit_proxy.h @@ -121,11 +121,19 @@ struct ParamTraits<AutocompleteMatchData> { } static void Log(const param_type& p, std::wstring* l) { - l->append(StringPrintf(L"[%S %s %S %S %S %d %s %s %d %s %S]", - p.contents, p.deletable ? "true" : "false", p.description, - p.destination_url, p.fill_into_edit, p.inline_autocomplete_offset, - p.is_history_what_you_typed_match ? "true" : "false", p.provider_name, - p.relevance, p.starred ? "true" : "false", p.str_type)); + std::wstring provider_name_wide = UTF8ToWide(p.provider_name); + l->append(StringPrintf(L"[%ls %ls %ls %ls %ls %d %ls %ls %d %ls %ls]", + p.contents, + p.deletable ? L"true" : L"false", + p.description, + p.destination_url, + p.fill_into_edit, + p.inline_autocomplete_offset, + p.is_history_what_you_typed_match ? L"true" : L"false", + provider_name_wide, + p.relevance, + p.starred ? L"true" : L"false", + p.str_type)); } }; } // namespace IPC diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index c1bd5b8..0d75389e 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -522,7 +522,8 @@ class AutomationProxyTest4 : public UITest { std::wstring SynthesizeJSURL(const std::wstring& value) { std::wstring jscript; SStringPrintf(&jscript, - L"javascript:void(window.domAutomationController.send(%s));", value.c_str()); + L"javascript:void(window.domAutomationController.send(%ls));", + value.c_str()); return jscript; } @@ -599,8 +600,8 @@ std::wstring SynthesizeJSURLForDOMQuery(const std::wstring& id) { std::wstring jscript; SStringPrintf(&jscript, L"javascript:void(window.domAutomationController)"); - StringAppendF(&jscript, L".send(document.getElementById('%s').nodeName);", - id.c_str()); + StringAppendF(&jscript, L".send(document.getElementById('%ls').nodeName);", + id.c_str()); return jscript; } diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc index 9e233de..6b9754b 100644 --- a/chrome/test/memory_test/memory_test.cc +++ b/chrome/test/memory_test/memory_test.cc @@ -250,7 +250,7 @@ class MemoryTest : public UITest { void PrintResults(const wchar_t* test_name, size_t commit_size) { PrintMemoryUsageInfo(test_name); - wprintf(L"%s_commit_charge_kb = %d\n", test_name, commit_size / 1024); + wprintf(L"%ls_commit_charge_kb = %d\n", test_name, commit_size / 1024); } void PrintIOPerfInfo(const wchar_t* test_name) { @@ -288,17 +288,17 @@ class MemoryTest : public UITest { } // print out IO performance - wprintf(L"%s_%s_read_op = %d\n", + wprintf(L"%ls_%ls_read_op = %d\n", test_name, chrome_name, io_counters.ReadOperationCount); - wprintf(L"%s_%s_write_op = %d\n", + wprintf(L"%ls_%ls_write_op = %d\n", test_name, chrome_name, io_counters.WriteOperationCount); - wprintf(L"%s_%s_other_op = %d\n", + wprintf(L"%ls_%ls_other_op = %d\n", test_name, chrome_name, io_counters.OtherOperationCount); - wprintf(L"%s_%s_read_byte = %d K\n", + wprintf(L"%ls_%ls_read_byte = %d K\n", test_name, chrome_name, io_counters.ReadTransferCount / 1024); - wprintf(L"%s_%s_write_byte = %d K\n", + wprintf(L"%ls_%ls_write_byte = %d K\n", test_name, chrome_name, io_counters.WriteTransferCount / 1024); - wprintf(L"%s_%s_other_byte = %d K\n", + wprintf(L"%ls_%ls_other_byte = %d K\n", test_name, chrome_name, io_counters.OtherTransferCount / 1024); } } @@ -334,15 +334,15 @@ class MemoryTest : public UITest { num_chrome_processes++; } } - wprintf(L"%s_browser_vm_final_kb = %d\n", test_name, + wprintf(L"%ls_browser_vm_final_kb = %d\n", test_name, browser_virtual_size / 1024); - wprintf(L"%s_browser_ws_final_kb = %d\n", test_name, + wprintf(L"%ls_browser_ws_final_kb = %d\n", test_name, browser_working_set_size / 1024); - wprintf(L"%s_memory_vm_final_kb = %d\n", test_name, + wprintf(L"%ls_memory_vm_final_kb = %d\n", test_name, virtual_size / 1024); - wprintf(L"%s_memory_ws_final_kb = %d\n", test_name, + wprintf(L"%ls_memory_ws_final_kb = %d\n", test_name, working_set_size / 1024); - wprintf(L"%s_processes = %d\n", test_name, num_chrome_processes); + wprintf(L"%ls_processes = %d\n", test_name, num_chrome_processes); } private: diff --git a/chrome/test/page_cycler/page_cycler_test.cc b/chrome/test/page_cycler/page_cycler_test.cc index 39b10b5..921d9e8 100644 --- a/chrome/test/page_cycler/page_cycler_test.cc +++ b/chrome/test/page_cycler/page_cycler_test.cc @@ -144,17 +144,17 @@ class PageCyclerTest : public UITest { } // print out IO performance - wprintf(L"%s_%s_read_op = %d\n", + wprintf(L"%ls_%ls_read_op = %d\n", test_name, chrome_name, io_counters.ReadOperationCount); - wprintf(L"%s_%s_write_op = %d\n", + wprintf(L"%ls_%ls_write_op = %d\n", test_name, chrome_name, io_counters.WriteOperationCount); - wprintf(L"%s_%s_other_op = %d\n", + wprintf(L"%ls_%ls_other_op = %d\n", test_name, chrome_name, io_counters.OtherOperationCount); - wprintf(L"%s_%s_read_byte = %d K\n", + wprintf(L"%ls_%ls_read_byte = %d K\n", test_name, chrome_name, io_counters.ReadTransferCount / 1024); - wprintf(L"%s_%s_write_byte = %d K\n", + wprintf(L"%ls_%ls_write_byte = %d K\n", test_name, chrome_name, io_counters.WriteTransferCount / 1024); - wprintf(L"%s_%s_other_byte = %d K\n", + wprintf(L"%ls_%ls_other_byte = %d K\n", test_name, chrome_name, io_counters.OtherTransferCount / 1024); } } @@ -177,21 +177,21 @@ class PageCyclerTest : public UITest { if (GetMemoryInfo(pid, &peak_virtual_size, ¤t_virtual_size, &peak_working_set_size, ¤t_working_set_size)) { if (pid == chrome_filter.browser_process_id()) { - wprintf(L"%s_browser_vm_peak = %d\n", test_name, peak_virtual_size); - wprintf(L"%s_browser_vm_final = %d\n", test_name, - current_virtual_size); - wprintf(L"%s_browser_ws_peak = %d\n", test_name, - peak_working_set_size); - wprintf(L"%s_browser_ws_final = %d\n", test_name, - current_working_set_size); + wprintf(L"%ls_browser_vm_peak = %d\n", test_name, peak_virtual_size); + wprintf(L"%ls_browser_vm_final = %d\n", test_name, + current_virtual_size); + wprintf(L"%ls_browser_ws_peak = %d\n", test_name, + peak_working_set_size); + wprintf(L"%ls_browser_ws_final = %d\n", test_name, + current_working_set_size); } else { - wprintf(L"%s_render_vm_peak = %d\n", test_name, peak_virtual_size); - wprintf(L"%s_render_vm_final = %d\n", test_name, - current_virtual_size); - wprintf(L"%s_render_ws_peak = %d\n", test_name, + wprintf(L"%ls_render_vm_peak = %d\n", test_name, peak_virtual_size); + wprintf(L"%ls_render_vm_final = %d\n", test_name, + current_virtual_size); + wprintf(L"%ls_render_ws_peak = %d\n", test_name, peak_working_set_size); - wprintf(L"%s_render_ws_final = %d\n", test_name, - current_working_set_size); + wprintf(L"%ls_render_ws_final = %d\n", test_name, + current_working_set_size); } } }; @@ -211,8 +211,8 @@ class PageCyclerTest : public UITest { PrintIOPerfInfo(L"__pc"); printf("\n"); - wprintf(L"__pc_pages = [%s]\n", pages.c_str()); - wprintf(L"__pc_timings = [%s]\n", timings.c_str()); + wprintf(L"__pc_pages = [%ls]\n", pages.c_str()); + wprintf(L"__pc_timings = [%ls]\n", timings.c_str()); } }; @@ -239,7 +239,7 @@ class PageCyclerReferenceTest : public PageCyclerTest { PrintIOPerfInfo(L"__pc_reference"); printf("\n"); - wprintf(L"__pc_reference_timings = [%s]\n", timings.c_str()); + wprintf(L"__pc_reference_timings = [%ls]\n", timings.c_str()); } }; diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index ee59ad6..bdb805b 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -273,7 +273,7 @@ class PageLoadTest : public UITest { // For usage 2 for (int i = start_page; i <= end_page; ++i) { std::wstring test_page_url( - StringPrintf(L"%s/page?id=%d", server_url.c_str(), i)); + StringPrintf(L"%ls/page?id=%d", server_url.c_str(), i)); NavigateToURLLogResult(GURL(test_page_url), log_file, NULL); } } else { diff --git a/chrome/test/security_tests/ipc_security_tests.cc b/chrome/test/security_tests/ipc_security_tests.cc index e85e09b..9ac9b3c 100644 --- a/chrome/test/security_tests/ipc_security_tests.cc +++ b/chrome/test/security_tests/ipc_security_tests.cc @@ -38,7 +38,7 @@ namespace { // Debug output messages prefix. const char kODSMgPrefix[] = "[security] "; // Format of the Chrome browser pipe for plugins. -const wchar_t kChromePluginPipeFmt[] = L"\\\\.\\pipe\\chrome.%s.p%d"; +const wchar_t kChromePluginPipeFmt[] = L"\\\\.\\pipe\\chrome.%ls.p%d"; // Size for the in/out pipe buffers. const int kBufferSize = 1024; diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 38d17d6..1845870 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -90,7 +90,7 @@ int LowWaterAdjust(int high_water) { std::wstring GetPrefixedName(const std::wstring& path, const std::wstring& name, int index) { std::wstring prefixed(path); - std::wstring tmp = StringPrintf(L"%s%s_%03d", L"old_", name.c_str(), index); + std::wstring tmp = StringPrintf(L"%ls%ls_%03d", L"old_", name.c_str(), index); file_util::AppendToPath(&prefixed, tmp); return prefixed; } @@ -560,7 +560,7 @@ std::wstring BackendImpl::GetFileName(Addr address) const { return std::wstring(); } - std::wstring name = StringPrintf(L"%s\\f_%06x", path_.c_str(), + std::wstring name = StringPrintf(L"%ls\\f_%06x", path_.c_str(), address.FileNumber()); return name; } diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index 79be295..db49e3a 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -210,7 +210,8 @@ void BlockFiles::CloseFiles() { std::wstring BlockFiles::Name(int index) { // The file format allows for 256 files. DCHECK(index < 256 || index >= 0); - std::wstring name = StringPrintf(L"%s%s%d", path_.c_str(), kBlockName, index); + std::wstring name = StringPrintf(L"%ls%ls%d", + path_.c_str(), kBlockName, index); return name; } diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc index 74f257a..3e8714b 100644 --- a/net/disk_cache/stress_cache.cc +++ b/net/disk_cache/stress_cache.cc @@ -54,7 +54,7 @@ int RunSlave(int iteration) { std::wstring exe; PathService::Get(base::FILE_EXE, &exe); - std::wstring command = StringPrintf(L"%s %d", exe.c_str(), iteration); + std::wstring command = StringPrintf(L"%ls %d", exe.c_str(), iteration); STARTUPINFO startup_info = {0}; startup_info.cb = sizeof(startup_info); diff --git a/net/tools/crash_cache/crash_cache.cc b/net/tools/crash_cache/crash_cache.cc index 859cf94..f007feb 100644 --- a/net/tools/crash_cache/crash_cache.cc +++ b/net/tools/crash_cache/crash_cache.cc @@ -61,7 +61,7 @@ int RunSlave(RankCrashes action) { std::wstring exe; PathService::Get(base::FILE_EXE, &exe); - std::wstring command = StringPrintf(L"%s %d", exe.c_str(), action); + std::wstring command = StringPrintf(L"%ls %d", exe.c_str(), action); STARTUPINFO startup_info = {0}; startup_info.cb = sizeof(startup_info); diff --git a/net/tools/tld_cleanup/tld_cleanup.cc b/net/tools/tld_cleanup/tld_cleanup.cc index 1dc5391..cbd1b5b 100644 --- a/net/tools/tld_cleanup/tld_cleanup.cc +++ b/net/tools/tld_cleanup/tld_cleanup.cc @@ -161,7 +161,7 @@ NormalizeResult NormalizeFile(const std::wstring& in_filename, const std::wstring& out_filename) { std::string data; if (!file_util::ReadFileToString(in_filename, &data)) { - fwprintf(stderr, L"Unable to read file %s\n", in_filename.c_str()); + fwprintf(stderr, L"Unable to read file %ls\n", in_filename.c_str()); // We return success since we've already reported the error. return kSuccess; } @@ -174,7 +174,7 @@ NormalizeResult NormalizeFile(const std::wstring& in_filename, FILE_ATTRIBUTE_NORMAL, NULL)); if (outfile == INVALID_HANDLE_VALUE) { - fwprintf(stderr, L"Unable to write file %s\n", out_filename.c_str()); + fwprintf(stderr, L"Unable to write file %ls\n", out_filename.c_str()); // We return success since we've already reported the error. return kSuccess; } @@ -260,7 +260,7 @@ int main(int argc, const char* argv[]) { NormalizeResult result = NormalizeFile(UTF8ToWide(argv[1]), UTF8ToWide(argv[2])); if (result != kSuccess) { - fwprintf(stderr, L"Errors or warnings processing file. See log in %s.", + fwprintf(stderr, L"Errors or warnings processing file. See log in %ls.", kLogFileName); } diff --git a/sandbox/sandbox_poc/main_ui_window.cc b/sandbox/sandbox_poc/main_ui_window.cc index fdef50d..be68cdb 100644 --- a/sandbox/sandbox_poc/main_ui_window.cc +++ b/sandbox/sandbox_poc/main_ui_window.cc @@ -426,7 +426,7 @@ DWORD MainUIWindow::ListenPipe() { FILE_ATTRIBUTE_NORMAL, NULL); // No template if (INVALID_HANDLE_VALUE == logfile_handle) { - AddDebugMessage(L"Failed to open \"%s\" for logging. Error %d", + AddDebugMessage(L"Failed to open \"%ls\" for logging. Error %d", file_to_open.GetBuffer(), ::GetLastError()); logfile_handle = NULL; } @@ -524,7 +524,7 @@ bool MainUIWindow::SpawnTarget() { } wchar_t * arguments = new wchar_t[size_call]; - wnsprintf(arguments, static_cast<int>(size_call), L"%s %s \"%s\" %s", + wnsprintf(arguments, static_cast<int>(size_call), L"%ls %ls \"%ls\" %ls", spawn_target_.c_str(), entry_point_.c_str(), dll_path_.c_str(), log_pipe); @@ -553,7 +553,7 @@ bool MainUIWindow::SpawnTarget() { bool return_value = false; if (sandbox::SBOX_ALL_OK != result) { AddDebugMessage( - L"Failed to spawn target %s w/args (%s), sandbox error code: %d", + L"Failed to spawn target %ls w/args (%ls), sandbox error code: %d", spawn_target_.c_str(), arguments, result); return_value = false; } else { @@ -592,7 +592,7 @@ bool MainUIWindow::SpawnTarget() { ::ResumeThread(target_.hThread); - AddDebugMessage(L"Successfully spawned target w/args (%s)", arguments); + AddDebugMessage(L"Successfully spawned target w/args (%ls)", arguments); return_value = true; } diff --git a/sandbox/src/file_policy_test.cc b/sandbox/src/file_policy_test.cc index cb66fa4..54fe56e 100644 --- a/sandbox/src/file_policy_test.cc +++ b/sandbox/src/file_policy_test.cc @@ -359,9 +359,9 @@ TEST(FilePolicyTest, AllowReadOnly) { temp_file_name)); wchar_t command_read[MAX_PATH + 20] = {0}; - wsprintf(command_read, L"File_Create Read \"%s\"", temp_file_name); + wsprintf(command_read, L"File_Create Read \"%ls\"", temp_file_name); wchar_t command_write[MAX_PATH + 20] = {0}; - wsprintf(command_write, L"File_Create Write \"%s\"", temp_file_name); + wsprintf(command_write, L"File_Create Write \"%ls\"", temp_file_name); // Verify that we have read access after revert. EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(command_read)); @@ -389,7 +389,7 @@ TEST(FilePolicyTest, AllowWildcard) { EXPECT_TRUE(runner.AddFsRule(TargetPolicy::FILES_ALLOW_ANY, temp_directory)); wchar_t command_write[MAX_PATH + 20] = {0}; - wsprintf(command_write, L"File_Create Write \"%s\"", temp_file_name); + wsprintf(command_write, L"File_Create Write \"%ls\"", temp_file_name); // Verify that we have write access after revert. EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(command_write)); @@ -481,19 +481,19 @@ TEST(FilePolicyTest, TestRename) { wchar_t command[MAX_PATH*2 + 20] = {0}; - wsprintf(command, L"File_Rename \"%s\" \"%s\"", temp_file_name1, + wsprintf(command, L"File_Rename \"%ls\" \"%ls\"", temp_file_name1, temp_file_name2); EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(command)); - wsprintf(command, L"File_Rename \"%s\" \"%s\"", temp_file_name3, + wsprintf(command, L"File_Rename \"%ls\" \"%ls\"", temp_file_name3, temp_file_name4); EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(command)); - wsprintf(command, L"File_Rename \"%s\" \"%s\"", temp_file_name5, + wsprintf(command, L"File_Rename \"%ls\" \"%ls\"", temp_file_name5, temp_file_name6); EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(command)); - wsprintf(command, L"File_Rename \"%s\" \"%s\"", temp_file_name7, + wsprintf(command, L"File_Rename \"%ls\" \"%ls\"", temp_file_name7, temp_file_name8); EXPECT_EQ(SBOX_TEST_DENIED, runner.RunTest(command)); diff --git a/sandbox/tools/finder/main.cc b/sandbox/tools/finder/main.cc index 7037bfa..75e081d 100644 --- a/sandbox/tools/finder/main.cc +++ b/sandbox/tools/finder/main.cc @@ -33,13 +33,13 @@ #define PARAM_IS(y) (argc > i) && (_wcsicmp(argv[i], y) == 0) void PrintUsage(wchar_t *application_name) { - wprintf(L"\n\nUsage: \n %s --token type --object ob1 [ob2 ob3] " + wprintf(L"\n\nUsage: \n %ls --token type --object ob1 [ob2 ob3] " L"--access ac1 [ac2 ac3] [--log filename]", application_name); wprintf(L"\n\n Token Types : \n\tLOCKDOWN \n\tRESTRICTED " L"\n\tLIMITED_USER \n\tINTERACTIVE_USER \n\tNON_ADMIN \n\tUNPROTECTED"); wprintf(L"\n Object Types: \n\tREG \n\tFILE \n\tKERNEL"); wprintf(L"\n Access Types: \n\tR \n\tW \n\tALL"); - wprintf(L"\n\nSample: \n %s --token LOCKDOWN --object REG FILE KERNEL " + wprintf(L"\n\nSample: \n %ls --token LOCKDOWN --object REG FILE KERNEL " L"--access R W ALL", application_name); } @@ -84,7 +84,7 @@ int wmain(int argc, wchar_t* argv[]) { } else if (PARAM_IS(L"UNPROTECTED")) { token_type = sandbox::USER_UNPROTECTED; } else { - wprintf(L"\nAbord. Invalid token type \"%s\"", argv[i]); + wprintf(L"\nAbord. Invalid token type \"%ls\"", argv[i]); PrintUsage(app_name); return -1; } @@ -130,7 +130,7 @@ int wmain(int argc, wchar_t* argv[]) { return -1; } } else { - wprintf(L"\nAbord. Unrecognized parameter \"%s\"", argv[i]); + wprintf(L"\nAbord. Unrecognized parameter \"%ls\"", argv[i]); PrintUsage(app_name); return -1; } @@ -155,7 +155,7 @@ int wmain(int argc, wchar_t* argv[]) { if (log_file.GetLength()) { errno_t err = _wfopen_s(&file_output, log_file, L"w"); if (err) { - wprintf(L"\nAbord, Cannot open file \"%s\"", log_file.GetBuffer()); + wprintf(L"\nAbord, Cannot open file \"%ls\"", log_file.GetBuffer()); return -1; } } else { diff --git a/sandbox/tools/launcher/launcher.cc b/sandbox/tools/launcher/launcher.cc index 3e7dd3d..fd8d272 100644 --- a/sandbox/tools/launcher/launcher.cc +++ b/sandbox/tools/launcher/launcher.cc @@ -39,7 +39,7 @@ #define PARAM_IS(y) (argc > i) && (_wcsicmp(argv[i], y) == 0) void PrintUsage(const wchar_t *application_name) { - wprintf(L"\n\nUsage: \n %s --main level --init level --job level cmd_line ", + wprintf(L"\n\nUsage: \n %ls --main level --init level --job level cmd_line ", application_name); wprintf(L"\n\n Levels : \n\tLOCKDOWN \n\tRESTRICTED " L"\n\tLIMITED_USER \n\tINTERACTIVE_USER \n\tNON_ADMIN \n\tUNPROTECTED"); @@ -119,7 +119,7 @@ int wmain(int argc, wchar_t *argv[]) { i++; if (argc > i) { if (!GetTokenLevelFromString(argv[i], &primary_level)) { - wprintf(L"\nAbord, Unrecognized main token level \"%s\"", argv[i]); + wprintf(L"\nAbord, Unrecognized main token level \"%ls\"", argv[i]); PrintUsage(app_name); return -1; } @@ -128,7 +128,7 @@ int wmain(int argc, wchar_t *argv[]) { i++; if (argc > i) { if (!GetTokenLevelFromString(argv[i], &impersonation_level)) { - wprintf(L"\nAbord, Unrecognized init token level \"%s\"", argv[i]); + wprintf(L"\nAbord, Unrecognized init token level \"%ls\"", argv[i]); PrintUsage(app_name); return -1; } @@ -137,7 +137,7 @@ int wmain(int argc, wchar_t *argv[]) { i++; if (argc > i) { if (!GetJobLevelFromString(argv[i], &job_level)) { - wprintf(L"\nAbord, Unrecognized job security level \"%s\"", argv[i]); + wprintf(L"\nAbord, Unrecognized job security level \"%ls\"", argv[i]); PrintUsage(app_name); return -1; } @@ -156,7 +156,7 @@ int wmain(int argc, wchar_t *argv[]) { return -1; } - wprintf(L"\nLaunching command line: \"%s\"\n", command_line.GetBuffer()); + wprintf(L"\nLaunching command line: \"%ls\"\n", command_line.GetBuffer()); HANDLE job_handle; DWORD err_code = sandbox::StartRestrictedProcessInJob( @@ -178,4 +178,4 @@ int wmain(int argc, wchar_t *argv[]) { ::CloseHandle(job_handle); return 0; -}
\ No newline at end of file +} diff --git a/webkit/glue/dom_serializer.cc b/webkit/glue/dom_serializer.cc index 3f75d27..efc5c4b 100644 --- a/webkit/glue/dom_serializer.cc +++ b/webkit/glue/dom_serializer.cc @@ -105,11 +105,11 @@ namespace { // Default "mark of the web" declaration static const wchar_t* const kDefaultMarkOfTheWeb = - L"\n<!-- saved from url=(%04d)%s -->\n"; + L"\n<!-- saved from url=(%04d)%ls -->\n"; // Default meat content for writing correct charset declaration. static const wchar_t* const kDefaultMetaContent = - L"<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">"; + L"<META http-equiv=\"Content-Type\" content=\"text/html; charset=%ls\">"; // Notation of start comment. static const wchar_t* const kStartCommentNotation = L"<!-- "; @@ -119,14 +119,14 @@ static const wchar_t* const kEndCommentNotation = L" -->"; // Default XML declaration. static const wchar_t* const kXMLDeclaration = - L"<?xml version=\"%s\" encoding=\"%s\"%s?>\n"; + L"<?xml version=\"%ls\" encoding=\"%ls\"%ls?>\n"; // Default base tag declaration static const wchar_t* const kBaseTagDeclaration = - L"<BASE href=\".\"%s>"; + L"<BASE href=\".\"%ls>"; static const wchar_t* const kBaseTargetDeclaration = - L" target=\"%s\""; + L" target=\"%ls\""; // Maximum length of data buffer which is used to temporary save generated // html content data. diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index ada0bdb..f60eae2 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -186,7 +186,7 @@ std::wstring DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) { if (offset.width() > 0 || offset.height() > 0) { if (webFrameImpl->GetParent()) { - StringAppendF(&result, L"frame '%s' ", StringToStdWString( + StringAppendF(&result, L"frame '%ls' ", StringToStdWString( webFrameImpl->frame()->tree()->name()).c_str()); } StringAppendF(&result, L"scrolled to %d,%d\n", |