summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-14 00:41:45 +0000
committermmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-14 00:41:45 +0000
commit5115474e2e2c773b53fc1e111426e8924deeadb7 (patch)
tree6bdd56cdd544a3b331db7612781ae347739c4e82 /chrome
parent609990b5b4254601504935427483e3fc22cfde80 (diff)
downloadchromium_src-5115474e2e2c773b53fc1e111426e8924deeadb7.zip
chromium_src-5115474e2e2c773b53fc1e111426e8924deeadb7.tar.gz
chromium_src-5115474e2e2c773b53fc1e111426e8924deeadb7.tar.bz2
Use %ls instead of %s in wprintf format strings for wchar_t fields.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@846 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_shutdown.cc4
-rw-r--r--chrome/browser/history/text_database.cc2
-rw-r--r--chrome/browser/printing/page_overlays_unittest.cc2
-rw-r--r--chrome/browser/render_view_host.cc2
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc4
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_database_unittest.cc4
-rw-r--r--chrome/browser/save_package.cc2
-rw-r--r--chrome/browser/views/options/language_combobox_model.cc2
-rw-r--r--chrome/browser/visitedlink_master.cc2
-rw-r--r--chrome/common/ipc_message_utils.h2
-rw-r--r--chrome/test/automation/autocomplete_edit_proxy.h18
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc7
-rw-r--r--chrome/test/memory_test/memory_test.cc24
-rw-r--r--chrome/test/page_cycler/page_cycler_test.cc44
-rw-r--r--chrome/test/reliability/page_load_test.cc2
-rw-r--r--chrome/test/security_tests/ipc_security_tests.cc2
16 files changed, 66 insertions, 57 deletions
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, &current_virtual_size,
&peak_working_set_size, &current_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;