summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-15 12:11:11 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-15 12:11:11 +0000
commita77fa2dc9cb9a10a31688a1bb24a9101194d51af (patch)
tree9be37414818cd5be282ec26ee0d0f9b8c186ea29
parent055d7f268366be957e83bff0dfb2a7f5fcf3f3a7 (diff)
downloadchromium_src-a77fa2dc9cb9a10a31688a1bb24a9101194d51af.zip
chromium_src-a77fa2dc9cb9a10a31688a1bb24a9101194d51af.tar.gz
chromium_src-a77fa2dc9cb9a10a31688a1bb24a9101194d51af.tar.bz2
base: Get rid of 'using' declaration of StringAppendF.
Update the callers to append base:: in the calls to StringAppendF. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/4974001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66116 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/stringprintf.h2
-rw-r--r--chrome/browser/crash_handler_host_linux.cc4
-rw-r--r--chrome/browser/history/text_database.cc4
-rw-r--r--chrome/browser/metrics/metrics_log_unittest.cc4
-rw-r--r--chrome/browser/net/predictor.cc16
-rw-r--r--chrome/browser/net/url_info.cc29
-rw-r--r--chrome/browser/ui/views/select_file_dialog.cc7
-rw-r--r--chrome/common/sandbox_mac.mm2
-rw-r--r--chrome/service/cloud_print/cloud_print_url_fetcher.cc2
-rw-r--r--chrome/service/net/service_url_request_context.cc14
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc5
-rw-r--r--chrome/test/startup/feature_startup_test.cc2
-rw-r--r--chrome/test/startup/shutdown_test.cc2
-rw-r--r--chrome/test/startup/startup_test.cc15
-rw-r--r--chrome/test/tab_switching/tab_switching_test.cc2
-rw-r--r--chrome_frame/test/perf/chrome_frame_perftest.cc7
-rw-r--r--courgette/adjustment_method.cc6
-rw-r--r--courgette/adjustment_method_2.cc41
-rw-r--r--courgette/memory_monitor.cc10
-rw-r--r--net/http/http_cache_unittest.cc6
-rw-r--r--net/http/http_request_headers.cc10
-rw-r--r--net/http/http_util.cc4
-rw-r--r--net/proxy/proxy_bypass_rules.cc4
-rw-r--r--net/tools/flip_server/balsa_headers.cc17
-rw-r--r--net/tools/hresolv/hresolv.cc11
-rw-r--r--net/url_request/url_request_job_metrics.cc2
-rw-r--r--net/url_request/view_cache_helper.cc4
-rw-r--r--webkit/appcache/view_appcache_internals_job.cc8
-rw-r--r--webkit/blob/view_blob_internals_job.cc10
-rw-r--r--webkit/glue/plugins/plugin_list_posix.cc2
-rw-r--r--webkit/glue/user_agent.cc4
-rw-r--r--webkit/glue/webkit_glue.cc6
32 files changed, 139 insertions, 123 deletions
diff --git a/base/stringprintf.h b/base/stringprintf.h
index 3608f9d..f3ca6e7 100644
--- a/base/stringprintf.h
+++ b/base/stringprintf.h
@@ -50,7 +50,5 @@ void StringAppendV(std::wstring* dst, const wchar_t* format, va_list ap)
// TODO(brettw) remove these when calling code is converted.
using base::StringPrintf;
using base::StringAppendV;
-using base::StringAppendF;
-using base::StringAppendV;
#endif // BASE_STRINGPRINTF_H_
diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linux.cc
index 7c0c11b..a941cdd 100644
--- a/chrome/browser/crash_handler_host_linux.cc
+++ b/chrome/browser/crash_handler_host_linux.cc
@@ -256,8 +256,8 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) {
// /proc/[pid]/syscall is formatted as follows:
// syscall_number arg1 ... arg6 sp pc
// but we just check syscall_number through arg3.
- StringAppendF(&expected_syscall_data, "%d 0x%x %p 0x1 ",
- SYS_read, tid_fd, tid_buf_addr);
+ base::StringAppendF(&expected_syscall_data, "%d 0x%x %p 0x1 ",
+ SYS_read, tid_fd, tid_buf_addr);
pid_t crashing_tid =
base::FindThreadIDWithSyscall(crashing_pid, expected_syscall_data);
if (crashing_tid == -1) {
diff --git a/chrome/browser/history/text_database.cc b/chrome/browser/history/text_database.cc
index 60aa7fd..6bf3270 100644
--- a/chrome/browser/history/text_database.cc
+++ b/chrome/browser/history/text_database.cc
@@ -88,8 +88,8 @@ FilePath TextDatabase::IDToFileName(DBIdent id) {
// scheme: the caller should assign IDs as it feels fit with the knowledge
// that they will apppear on disk in this form.
FilePath::StringType filename(file_base());
- StringAppendF(&filename, FILE_PATH_LITERAL("%d-%02d"),
- id / 100, id % 100);
+ base::StringAppendF(&filename, FILE_PATH_LITERAL("%d-%02d"),
+ id / 100, id % 100);
return FilePath(filename);
}
diff --git a/chrome/browser/metrics/metrics_log_unittest.cc b/chrome/browser/metrics/metrics_log_unittest.cc
index 27c84c6..184500d 100644
--- a/chrome/browser/metrics/metrics_log_unittest.cc
+++ b/chrome/browser/metrics/metrics_log_unittest.cc
@@ -213,8 +213,8 @@ TEST(MetricsLogTest, CreateHash) {
// the metrics server uses.
std::string hash_hex = "0x";
for (size_t j = 0; j < 8; j++) {
- StringAppendF(&hash_hex, "%02x",
- static_cast<uint8>(hash_string.data()[j]));
+ base::StringAppendF(&hash_hex, "%02x",
+ static_cast<uint8>(hash_string.data()[j]));
}
EXPECT_EQ(cases[i].output, hash_hex);
}
diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
index fd55d2f..2c8ce5f 100644
--- a/chrome/browser/net/predictor.cc
+++ b/chrome/browser/net/predictor.cc
@@ -361,14 +361,16 @@ void Predictor::GetHtmlReferrerLists(std::string* output) {
for (Referrer::iterator future_url = referrer->begin();
future_url != referrer->end(); ++future_url) {
output->append("<tr align=right>");
- if (first_set_of_futures)
- StringAppendF(output, "<td rowspan=%d>%s</td><td rowspan=%d>%d</td>",
- static_cast<int>(referrer->size()),
- it->spec().c_str(),
- static_cast<int>(referrer->size()),
- static_cast<int>(referrer->use_count()));
+ if (first_set_of_futures) {
+ base::StringAppendF(output,
+ "<td rowspan=%d>%s</td><td rowspan=%d>%d</td>",
+ static_cast<int>(referrer->size()),
+ it->spec().c_str(),
+ static_cast<int>(referrer->size()),
+ static_cast<int>(referrer->use_count()));
+ }
first_set_of_futures = false;
- StringAppendF(output,
+ base::StringAppendF(output,
"<td>%d</td><td>%d</td><td>%d</td><td>%2.3f</td><td>%s</td></tr>",
static_cast<int>(future_url->second.navigation_count()),
static_cast<int>(future_url->second.preconnection_count()),
diff --git a/chrome/browser/net/url_info.cc b/chrome/browser/net/url_info.cc
index 505425a..8418b12 100644
--- a/chrome/browser/net/url_info.cc
+++ b/chrome/browser/net/url_info.cc
@@ -251,10 +251,10 @@ static std::string HoursMinutesSeconds(int seconds) {
int print_minutes = minutes % 60;
int print_hours = minutes/60;
if (print_hours)
- StringAppendF(&result, "%.2d:", print_hours);
+ base::StringAppendF(&result, "%.2d:", print_hours);
if (print_hours || print_minutes)
- StringAppendF(&result, "%2.2d:", print_minutes);
- StringAppendF(&result, "%2.2d", print_seconds);
+ base::StringAppendF(&result, "%2.2d:", print_minutes);
+ base::StringAppendF(&result, "%2.2d", print_seconds);
return result;
}
@@ -266,8 +266,8 @@ void UrlInfo::GetHtmlTable(const UrlInfoTable host_infos,
if (0 == host_infos.size())
return;
output->append(description);
- StringAppendF(output, "%" PRIuS " %s", host_infos.size(),
- (1 == host_infos.size()) ? "hostname" : "hostnames");
+ base::StringAppendF(output, "%" PRIuS " %s", host_infos.size(),
+ (1 == host_infos.size()) ? "hostname" : "hostnames");
if (brief) {
output->append("<br><br>");
@@ -291,18 +291,21 @@ void UrlInfo::GetHtmlTable(const UrlInfoTable host_infos,
for (UrlInfoTable::const_iterator it(host_infos.begin());
it != host_infos.end(); it++) {
queue.sample((it->queue_duration_.InMilliseconds()));
- StringAppendF(output, row_format,
- RemoveJs(it->url_.spec()).c_str(),
- HoursMinutesSeconds(when.sample(
- (current_time - it->time_).InSeconds())).c_str(),
- it->GetAsciiMotivation().c_str());
+ base::StringAppendF(
+ output,
+ row_format,
+ RemoveJs(it->url_.spec()).c_str(),
+ HoursMinutesSeconds(when.sample(
+ (current_time - it->time_).InSeconds())).c_str(),
+ it->GetAsciiMotivation().c_str());
}
output->append("</table>");
#ifndef NDEBUG
- StringAppendF(output,
- "Prefetch Queue Durations: min=%d, avg=%d, max=%d<br><br>",
- queue.minimum(), queue.average(), queue.maximum());
+ base::StringAppendF(
+ output,
+ "Prefetch Queue Durations: min=%d, avg=%d, max=%d<br><br>",
+ queue.minimum(), queue.average(), queue.maximum());
#endif
output->append("<br>");
diff --git a/chrome/browser/ui/views/select_file_dialog.cc b/chrome/browser/ui/views/select_file_dialog.cc
index da8427c..d19de9e 100644
--- a/chrome/browser/ui/views/select_file_dialog.cc
+++ b/chrome/browser/ui/views/select_file_dialog.cc
@@ -401,12 +401,13 @@ std::string SelectFileDialogImpl::FileBrowseDelegate::GetDialogArgs() const {
for (size_t j = 0; j < file_types_.extensions[i].size(); ++j) {
if (!exts.empty())
exts.append(",");
- StringAppendF(&exts, "\"%s\"", file_types_.extensions[i][j].c_str());
+ base::StringAppendF(&exts, "\"%s\"",
+ file_types_.extensions[i][j].c_str());
}
if (!exts_list.empty())
exts_list.append(",");
- StringAppendF(&exts_list, "[%s]", exts.c_str());
+ base::StringAppendF(&exts_list, "[%s]", exts.c_str());
std::string desc;
if (i < file_types_.extension_description_overrides.size()) {
@@ -423,7 +424,7 @@ std::string SelectFileDialogImpl::FileBrowseDelegate::GetDialogArgs() const {
if (!desc_list.empty())
desc_list.append(",");
- StringAppendF(&desc_list, "\"%s\"", desc.c_str());
+ base::StringAppendF(&desc_list, "\"%s\"", desc.c_str());
}
std::string filename = default_path_.BaseName().value();
diff --git a/chrome/common/sandbox_mac.mm b/chrome/common/sandbox_mac.mm
index 42cec0c..81defc7 100644
--- a/chrome/common/sandbox_mac.mm
+++ b/chrome/common/sandbox_mac.mm
@@ -94,7 +94,7 @@ bool Sandbox::QuotePlainString(const std::string& src_utf8, std::string* dst) {
if (c < 32 || c > 126) {
// Any characters that aren't printable ASCII get the \u treatment.
unsigned int as_uint = static_cast<unsigned int>(c);
- StringAppendF(dst, "\\u%04X", as_uint);
+ base::StringAppendF(dst, "\\u%04X", as_uint);
continue;
}
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.cc b/chrome/service/cloud_print/cloud_print_url_fetcher.cc
index 3c1e859..8996a0a 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher.cc
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher.cc
@@ -148,7 +148,7 @@ URLRequestContextGetter* CloudPrintURLFetcher::GetRequestContextGetter() {
new ServiceURLRequestContextGetter();
// Now set up the user agent for cloudprint.
std::string user_agent = getter->user_agent();
- StringAppendF(&user_agent, " %s", kCloudPrintUserAgent);
+ base::StringAppendF(&user_agent, " %s", kCloudPrintUserAgent);
getter->set_user_agent(user_agent);
return getter;
}
diff --git a/chrome/service/net/service_url_request_context.cc b/chrome/service/net/service_url_request_context.cc
index 1df288d..c7268f5 100644
--- a/chrome/service/net/service_url_request_context.cc
+++ b/chrome/service/net/service_url_request_context.cc
@@ -55,7 +55,7 @@ std::string BuildOSCpuInfo() {
}
#endif
- StringAppendF(
+ base::StringAppendF(
&os_cpu,
#if defined(OS_WIN)
"Windows NT %d.%d",
@@ -91,12 +91,12 @@ std::string MakeUserAgentForServiceProcess() {
std::string extra_version_info;
if (!version_info.IsOfficialBuild())
extra_version_info = "-devel";
- StringAppendF(&user_agent,
- "Chrome Service %s(%s)%s %s ",
- version_info.Version().c_str(),
- version_info.LastChange().c_str(),
- extra_version_info.c_str(),
- BuildOSCpuInfo().c_str());
+ base::StringAppendF(&user_agent,
+ "Chrome Service %s(%s)%s %s ",
+ version_info.Version().c_str(),
+ version_info.LastChange().c_str(),
+ extra_version_info.c_str(),
+ BuildOSCpuInfo().c_str());
return user_agent;
}
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index f329aed..28903ca 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -576,8 +576,9 @@ class AutomationProxyTest3 : public UITest {
std::wstring CreateJSStringForDOMQuery(const std::wstring& id) {
std::wstring jscript(L"window.domAutomationController");
- StringAppendF(&jscript, L".send(document.getElementById('%ls').nodeName);",
- id.c_str());
+ base::StringAppendF(&jscript,
+ L".send(document.getElementById('%ls').nodeName);",
+ id.c_str());
return jscript;
}
diff --git a/chrome/test/startup/feature_startup_test.cc b/chrome/test/startup/feature_startup_test.cc
index aec3eab..a9480eb 100644
--- a/chrome/test/startup/feature_startup_test.cc
+++ b/chrome/test/startup/feature_startup_test.cc
@@ -35,7 +35,7 @@ class NewTabUIStartupTest : public UIPerfTest {
bool important) {
std::string times;
for (int i = 0; i < kNumCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
+ base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
PrintResultList("new_tab", "", label, times, "ms", important);
}
diff --git a/chrome/test/startup/shutdown_test.cc b/chrome/test/startup/shutdown_test.cc
index c92cc2f..6093305 100644
--- a/chrome/test/startup/shutdown_test.cc
+++ b/chrome/test/startup/shutdown_test.cc
@@ -107,7 +107,7 @@ class ShutdownTest : public UIPerfTest {
std::string times;
for (int i = 0; i < numCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
+ base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
PrintResultList(graph, "", trace, times, "ms", important);
}
};
diff --git a/chrome/test/startup/startup_test.cc b/chrome/test/startup/startup_test.cc
index df381ab..1b36dcb2 100644
--- a/chrome/test/startup/startup_test.cc
+++ b/chrome/test/startup/startup_test.cc
@@ -202,8 +202,11 @@ class StartupTest : public UIPerfTest {
}
std::string times;
- for (int i = 0; i < numCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].end_to_end.InMillisecondsF());
+ for (int i = 0; i < numCycles; ++i) {
+ base::StringAppendF(&times,
+ "%.2f,",
+ timings[i].end_to_end.InMillisecondsF());
+ }
PrintResultList(graph, "", trace, times, "ms", important);
if (num_tabs > 0) {
@@ -213,13 +216,13 @@ class StartupTest : public UIPerfTest {
times.clear();
name = name_base + "-start";
for (int i = 0; i < numCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].first_start_ms);
+ base::StringAppendF(&times, "%.2f,", timings[i].first_start_ms);
PrintResultList(graph, "", name.c_str(), times, "ms", important);
times.clear();
name = name_base + "-first";
for (int i = 0; i < numCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].first_stop_ms);
+ base::StringAppendF(&times, "%.2f,", timings[i].first_stop_ms);
PrintResultList(graph, "", name.c_str(), times, "ms", important);
if (nth_timed_tab > 0) {
@@ -227,7 +230,7 @@ class StartupTest : public UIPerfTest {
times.clear();
name = name_base + "-" + base::IntToString(nth_timed_tab);
for (int i = 0; i < numCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].nth_tab_stop_ms);
+ base::StringAppendF(&times, "%.2f,", timings[i].nth_tab_stop_ms);
PrintResultList(graph, "", name.c_str(), times, "ms", important);
}
@@ -236,7 +239,7 @@ class StartupTest : public UIPerfTest {
times.clear();
name = name_base + "-all";
for (int i = 0; i < numCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].last_stop_ms);
+ base::StringAppendF(&times, "%.2f,", timings[i].last_stop_ms);
PrintResultList(graph, "", name.c_str(), times, "ms", important);
}
}
diff --git a/chrome/test/tab_switching/tab_switching_test.cc b/chrome/test/tab_switching/tab_switching_test.cc
index 028642f..29776fd 100644
--- a/chrome/test/tab_switching/tab_switching_test.cc
+++ b/chrome/test/tab_switching/tab_switching_test.cc
@@ -66,7 +66,7 @@ class TabSwitchingUITest : public UIPerfTest {
bool important) {
std::string times;
for (int i = 0; i < kNumCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
+ base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
PrintResultList("times", "", label, times, "ms", important);
}
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index 8d845b5..67220aa 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -348,7 +348,7 @@ class ChromeFrameStartupTest : public ChromeFramePerfTestBase {
std::string times;
for (int i = 0; i < kNumCycles; ++i)
- StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
+ base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
PrintResultList(graph, "", trace, times, "ms", important);
}
@@ -1382,8 +1382,9 @@ void PrintPerfTestResults(const Monitor* monitor,
for (int i = 0; i < num_cycles; ++i) {
ASSERT_TRUE(monitor[i].is_valid());
- StringAppendF(&times, "%.2f,",
- monitor[i].duration().InMillisecondsF());
+ base::StringAppendF(&times,
+ "%.2f,",
+ monitor[i].duration().InMillisecondsF());
}
PrintResultList(result_name, "", "t", times, "ms", false);
diff --git a/courgette/adjustment_method.cc b/courgette/adjustment_method.cc
index 435e44a..eabb684 100644
--- a/courgette/adjustment_method.cc
+++ b/courgette/adjustment_method.cc
@@ -81,11 +81,11 @@ struct OrderLabelInfoByAddressAscending {
static std::string ToString(LabelInfo* info) {
std::string s;
- StringAppendF(&s, "%c%d", "pm"[info->is_model_], info->debug_index_);
+ base::StringAppendF(&s, "%c%d", "pm"[info->is_model_], info->debug_index_);
if (info->label_->index_ != Label::kNoIndex)
- StringAppendF(&s, " (%d)", info->label_->index_);
+ base::StringAppendF(&s, " (%d)", info->label_->index_);
- StringAppendF(&s, " #%u", info->refs_);
+ base::StringAppendF(&s, " #%u", info->refs_);
return s;
}
diff --git a/courgette/adjustment_method_2.cc b/courgette/adjustment_method_2.cc
index cdc5b97..b487320 100644
--- a/courgette/adjustment_method_2.cc
+++ b/courgette/adjustment_method_2.cc
@@ -202,11 +202,11 @@ typedef std::vector<LabelInfo*> Trace;
std::string ToString(const LabelInfo* info) {
std::string s;
- StringAppendF(&s, "%c%d", "pm"[info->is_model_], info->debug_index_);
+ base::StringAppendF(&s, "%c%d", "pm"[info->is_model_], info->debug_index_);
if (info->label_->index_ != Label::kNoIndex)
- StringAppendF(&s, " (%d)", info->label_->index_);
+ base::StringAppendF(&s, " (%d)", info->label_->index_);
- StringAppendF(&s, " #%u", info->refs_);
+ base::StringAppendF(&s, " #%u", info->refs_);
return s;
}
@@ -431,13 +431,14 @@ std::string ToString(const Shingle* instance) {
std::string s;
const char* sep = "<";
for (size_t i = 0; i < Shingle::kWidth; ++i) {
- // StringAppendF(&s, "%s%x ", sep, instance.at(i)->label_->rva_);
+ // base::StringAppendF(&s, "%s%x ", sep, instance.at(i)->label_->rva_);
s += sep;
s += ToString(instance->at(i));
sep = ", ";
}
- StringAppendF(&s, ">(%" PRIuS ")@{%" PRIuS "}", instance->exemplar_position_,
- instance->position_count());
+ base::StringAppendF(&s, ">(%" PRIuS ")@{%" PRIuS "}",
+ instance->exemplar_position_,
+ instance->position_count());
return s;
}
@@ -523,7 +524,7 @@ std::string ToString(const ShinglePattern::Index* index) {
if (index == NULL) {
s = "<null>";
} else {
- StringAppendF(&s, "<%d: ", index->variables_);
+ base::StringAppendF(&s, "<%d: ", index->variables_);
const char* sep = "";
for (size_t i = 0; i < Shingle::kWidth; ++i) {
s += sep;
@@ -531,11 +532,11 @@ std::string ToString(const ShinglePattern::Index* index) {
uint32 kind = index->kinds_[i];
int offset = kind & ShinglePattern::kOffsetMask;
if (kind & ShinglePattern::kVariable)
- StringAppendF(&s, "V%d", offset);
+ base::StringAppendF(&s, "V%d", offset);
else
- StringAppendF(&s, "%d", index->assigned_indexes_[offset]);
+ base::StringAppendF(&s, "%d", index->assigned_indexes_[offset]);
}
- StringAppendF(&s, " %x", index->hash_);
+ base::StringAppendF(&s, " %x", index->hash_);
s += ">";
}
return s;
@@ -553,7 +554,7 @@ std::string HistogramToString(const ShinglePattern::Histogram& histogram,
s += " ...";
break;
}
- StringAppendF(&s, " %" PRIuS, p->count());
+ base::StringAppendF(&s, " %" PRIuS, p->count());
}
return s;
}
@@ -573,7 +574,7 @@ std::string HistogramToStringFull(const ShinglePattern::Histogram& histogram,
s += "...\n";
break;
}
- StringAppendF(&s, "(%" PRIuS ") ", p->count());
+ base::StringAppendF(&s, "(%" PRIuS ") ", p->count());
s += ToString(&(*p->instance()));
s += "\n";
}
@@ -587,14 +588,14 @@ std::string ToString(const ShinglePattern* pattern, size_t snippet_max = 3) {
} else {
s = "{";
s += ToString(pattern->index_);
- StringAppendF(&s, "; %d(%d):",
- static_cast<int>(pattern->model_histogram_.size()),
- pattern->model_coverage_);
+ base::StringAppendF(&s, "; %d(%d):",
+ static_cast<int>(pattern->model_histogram_.size()),
+ pattern->model_coverage_);
s += HistogramToString(pattern->model_histogram_, snippet_max);
- StringAppendF(&s, "; %d(%d):",
- static_cast<int>(pattern->program_histogram_.size()),
- pattern->program_coverage_);
+ base::StringAppendF(&s, "; %d(%d):",
+ static_cast<int>(pattern->program_histogram_.size()),
+ pattern->program_coverage_);
s += HistogramToString(pattern->program_histogram_, snippet_max);
s += "}";
}
@@ -608,9 +609,9 @@ std::string ShinglePatternToStringFull(const ShinglePattern* pattern,
s += "\n";
size_t model_size = pattern->model_histogram_.size();
size_t program_size = pattern->program_histogram_.size();
- StringAppendF(&s, " model shingles %" PRIuS "\n", model_size);
+ base::StringAppendF(&s, " model shingles %" PRIuS "\n", model_size);
s += HistogramToStringFull(pattern->model_histogram_, " ", max);
- StringAppendF(&s, " program shingles %" PRIuS "\n", program_size);
+ base::StringAppendF(&s, " program shingles %" PRIuS "\n", program_size);
s += HistogramToStringFull(pattern->program_histogram_, " ", max);
return s;
}
diff --git a/courgette/memory_monitor.cc b/courgette/memory_monitor.cc
index 26ce81f..dba8a88 100644
--- a/courgette/memory_monitor.cc
+++ b/courgette/memory_monitor.cc
@@ -47,8 +47,8 @@ struct H {
}
if (!print) return;
std::string o;
- StringAppendF(&o, "%u:", tick_ + d_tick_);
- StringAppendF(&o, " (%c%s)", sign, fmt(w).c_str());
+ base::StringAppendF(&o, "%u:", tick_ + d_tick_);
+ base::StringAppendF(&o, " (%c%s)", sign, fmt(w).c_str());
size_t sum = 0;
for (M::iterator p = c_.begin(); p != c_.end(); ++p) {
size_t s = p->first;
@@ -56,13 +56,13 @@ struct H {
if (n) {
if (s*n >= 64*1024)
if (n == 1)
- StringAppendF(&o, " %s", fmt(s).c_str());
+ base::StringAppendF(&o, " %s", fmt(s).c_str());
else
- StringAppendF(&o, " %s*%u", fmt(s).c_str(), n);
+ base::StringAppendF(&o, " %s*%u", fmt(s).c_str(), n);
sum += s*n;
}
}
- StringAppendF(&o, " = %s", fmt(sum).c_str());
+ base::StringAppendF(&o, " = %s", fmt(sum).c_str());
LOG(INFO) << o;
//printf("%s\n", o.c_str());
if (sum > 200*1024*1024) {
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index f71cec9..6ca1da1 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -904,8 +904,10 @@ void RangeTransactionServer::RangeHandler(const net::HttpRequestInfo* request,
if (!request->extra_headers.HasHeader("If-None-Match") || modified_) {
EXPECT_EQ(9, (end - start) % 10);
std::string data;
- for (int block_start = start; block_start < end; block_start += 10)
- StringAppendF(&data, "rg: %02d-%02d ", block_start, block_start + 9);
+ for (int block_start = start; block_start < end; block_start += 10) {
+ base::StringAppendF(&data, "rg: %02d-%02d ",
+ block_start, block_start + 9);
+ }
*response_data = data;
if (end - start != 9) {
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc
index 9f2eb90..fc2ebcd 100644
--- a/net/http/http_request_headers.cc
+++ b/net/http/http_request_headers.cc
@@ -160,10 +160,12 @@ std::string HttpRequestHeaders::ToString() const {
std::string output;
for (HeaderVector::const_iterator it = headers_.begin();
it != headers_.end(); ++it) {
- if (!it->value.empty())
- StringAppendF(&output, "%s: %s\r\n", it->key.c_str(), it->value.c_str());
- else
- StringAppendF(&output, "%s:\r\n", it->key.c_str());
+ if (!it->value.empty()) {
+ base::StringAppendF(&output, "%s: %s\r\n",
+ it->key.c_str(), it->value.c_str());
+ } else {
+ base::StringAppendF(&output, "%s:\r\n", it->key.c_str());
+ }
}
output.append("\r\n");
return output;
diff --git a/net/http/http_util.cc b/net/http/http_util.cc
index a3d1ec5..1f57d70 100644
--- a/net/http/http_util.cc
+++ b/net/http/http_util.cc
@@ -590,8 +590,8 @@ std::string HttpUtil::GenerateAcceptLanguageHeader(
lang_list_with_q = language;
} else {
DCHECK_LT(qvalue10, 10U);
- StringAppendF(&lang_list_with_q, ",%s;q=0.%d", language.c_str(),
- qvalue10);
+ base::StringAppendF(&lang_list_with_q, ",%s;q=0.%d", language.c_str(),
+ qvalue10);
}
// It does not make sense to have 'q=0'.
if (qvalue10 > kQvalueDecrement10)
diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
index d80e6f1..ce018bf 100644
--- a/net/proxy/proxy_bypass_rules.cc
+++ b/net/proxy/proxy_bypass_rules.cc
@@ -38,10 +38,10 @@ class HostnamePatternRule : public ProxyBypassRules::Rule {
virtual std::string ToString() const {
std::string str;
if (!optional_scheme_.empty())
- StringAppendF(&str, "%s://", optional_scheme_.c_str());
+ base::StringAppendF(&str, "%s://", optional_scheme_.c_str());
str += hostname_pattern_;
if (optional_port_ != -1)
- StringAppendF(&str, ":%d", optional_port_);
+ base::StringAppendF(&str, ":%d", optional_port_);
return str;
}
diff --git a/net/tools/flip_server/balsa_headers.cc b/net/tools/flip_server/balsa_headers.cc
index dfdbb61..2196cd4 100644
--- a/net/tools/flip_server/balsa_headers.cc
+++ b/net/tools/flip_server/balsa_headers.cc
@@ -555,22 +555,23 @@ void BalsaHeaders::DumpToString(std::string* str) const {
// Then check whether the header is in a partially parsed state. If so, just
// dump the raw data.
if (balsa_buffer_.can_write_to_contiguous_buffer()) {
- StringAppendF(str, "\n<incomplete header len: %d>\n%.*s\n",
- buffer_length, buffer_length, OriginalHeaderStreamBegin());
+ base::StringAppendF(str, "\n<incomplete header len: %d>\n%.*s\n",
+ buffer_length, buffer_length,
+ OriginalHeaderStreamBegin());
return;
}
// If the header is complete, then just dump them with the logical key value
// pair.
str->reserve(str->size() + GetSizeForWriteBuffer());
- StringAppendF(str, "\n %.*s\n",
- static_cast<int>(firstline.size()),
- firstline.data());
+ base::StringAppendF(str, "\n %.*s\n",
+ static_cast<int>(firstline.size()),
+ firstline.data());
BalsaHeaders::const_header_lines_iterator i = header_lines_begin();
for (; i != header_lines_end(); ++i) {
- StringAppendF(str, " %.*s: %.*s\n",
- static_cast<int>(i->first.size()), i->first.data(),
- static_cast<int>(i->second.size()), i->second.data());
+ base::StringAppendF(str, " %.*s: %.*s\n",
+ static_cast<int>(i->first.size()), i->first.data(),
+ static_cast<int>(i->second.size()), i->second.data());
}
}
diff --git a/net/tools/hresolv/hresolv.cc b/net/tools/hresolv/hresolv.cc
index b5af4ae..da5c4b0 100644
--- a/net/tools/hresolv/hresolv.cc
+++ b/net/tools/hresolv/hresolv.cc
@@ -73,7 +73,7 @@ std::string FormatAddrinfoFlags(int ai_flags) {
if (!flag_names.empty()) {
flag_names += "|";
}
- StringAppendF(&flag_names, "0x%x", ai_flags);
+ base::StringAppendF(&flag_names, "0x%x", ai_flags);
}
return flag_names;
}
@@ -161,14 +161,15 @@ std::string FormatAddrinfoDetails(const struct addrinfo& ai,
std::string FormatAddressList(const net::AddressList& address_list,
const std::string& host) {
std::string ret_string;
- StringAppendF(&ret_string, "AddressList {\n");
- StringAppendF(&ret_string, " Host: %s\n", host.c_str());
+ base::StringAppendF(&ret_string, "AddressList {\n");
+ base::StringAppendF(&ret_string, " Host: %s\n", host.c_str());
for (const struct addrinfo* it = address_list.head();
it != NULL;
it = it->ai_next) {
- StringAppendF(&ret_string, "%s", FormatAddrinfoDetails(*it, " ").c_str());
+ base::StringAppendF(&ret_string, "%s",
+ FormatAddrinfoDetails(*it, " ").c_str());
}
- StringAppendF(&ret_string, "}\n");
+ base::StringAppendF(&ret_string, "}\n");
return ret_string;
}
diff --git a/net/url_request/url_request_job_metrics.cc b/net/url_request/url_request_job_metrics.cc
index 8e7b70b..fcaac74 100644
--- a/net/url_request/url_request_job_metrics.cc
+++ b/net/url_request/url_request_job_metrics.cc
@@ -31,7 +31,7 @@ void URLRequestJobMetrics::AppendText(std::wstring* text) {
}
TimeDelta elapsed = end_time_ - start_time_;
- StringAppendF(text,
+ base::StringAppendF(text,
L"; total bytes read = %ld; read calls = %d; time = %lld ms;",
static_cast<long>(total_bytes_read_),
number_of_read_IO_, elapsed.InMilliseconds());
diff --git a/net/url_request/view_cache_helper.cc b/net/url_request/view_cache_helper.cc
index 4a3ad02..531b055 100644
--- a/net/url_request/view_cache_helper.cc
+++ b/net/url_request/view_cache_helper.cc
@@ -28,7 +28,7 @@ void HexDump(const char *buf, size_t buf_len, std::string* result) {
const unsigned char *p;
while (buf_len) {
- StringAppendF(result, "%08x: ", offset);
+ base::StringAppendF(result, "%08x: ", offset);
offset += kMaxRows;
p = (const unsigned char *) buf;
@@ -38,7 +38,7 @@ void HexDump(const char *buf, size_t buf_len, std::string* result) {
// print hex codes:
for (i = 0; i < row_max; ++i)
- StringAppendF(result, "%02x ", *p++);
+ base::StringAppendF(result, "%02x ", *p++);
for (i = row_max; i < kMaxRows; ++i)
result->append(" ");
diff --git a/webkit/appcache/view_appcache_internals_job.cc b/webkit/appcache/view_appcache_internals_job.cc
index 93390cc..0819cd7 100644
--- a/webkit/appcache/view_appcache_internals_job.cc
+++ b/webkit/appcache/view_appcache_internals_job.cc
@@ -66,10 +66,10 @@ void EndHTML(std::string* out) {
void DrawCommandButton(const std::string& title,
const std::string& command,
std::string* data) {
- StringAppendF(data, "<input type=\"button\" value=\"%s\" "
- "onclick=\"RemoveCommand('%s')\" />",
- title.c_str(),
- command.c_str());
+ base::StringAppendF(data, "<input type=\"button\" value=\"%s\" "
+ "onclick=\"RemoveCommand('%s')\" />",
+ title.c_str(),
+ command.c_str());
}
void AddLiTag(const std::string& element_title,
diff --git a/webkit/blob/view_blob_internals_job.cc b/webkit/blob/view_blob_internals_job.cc
index 36463b9..00c3eb3 100644
--- a/webkit/blob/view_blob_internals_job.cc
+++ b/webkit/blob/view_blob_internals_job.cc
@@ -88,11 +88,11 @@ void AddHTMLListItem(const std::string& element_title,
void AddHTMLButton(const std::string& title,
const std::string& command,
std::string* out) {
- StringAppendF(out,
- "<input type=\"button\" value=\"%s\" "
- "onclick=\"SubmitCommand('%s')\" />",
- title.c_str(),
- command.c_str());
+ base::StringAppendF(out,
+ "<input type=\"button\" value=\"%s\" "
+ "onclick=\"SubmitCommand('%s')\" />",
+ title.c_str(),
+ command.c_str());
}
} // namespace
diff --git a/webkit/glue/plugins/plugin_list_posix.cc b/webkit/glue/plugins/plugin_list_posix.cc
index 682381c..654c0c5 100644
--- a/webkit/glue/plugins/plugin_list_posix.cc
+++ b/webkit/glue/plugins/plugin_list_posix.cc
@@ -55,7 +55,7 @@ bool IsBlacklistedBySha1sum(const FilePath& path) {
std::string sha1 = base::SHA1HashString(file_content);
std::string sha1_readable;
for (size_t j = 0; j < sha1.size(); j++)
- StringAppendF(&sha1_readable, "%02x", sha1[j] & 0xFF);
+ base::StringAppendF(&sha1_readable, "%02x", sha1[j] & 0xFF);
if (bad_entries[i].sha1 == sha1_readable)
return true;
}
diff --git a/webkit/glue/user_agent.cc b/webkit/glue/user_agent.cc
index 2babb49..4867c27 100644
--- a/webkit/glue/user_agent.cc
+++ b/webkit/glue/user_agent.cc
@@ -52,7 +52,7 @@ std::string BuildOSCpuInfo() {
}
#endif
- StringAppendF(
+ base::StringAppendF(
&os_cpu,
#if defined(OS_WIN)
"Windows NT %d.%d",
@@ -102,7 +102,7 @@ void BuildUserAgent(bool mimic_windows, std::string* result) {
std::string product = GetProductVersion();
// Derived from Safari's UA string.
- StringAppendF(
+ base::StringAppendF(
result,
"Mozilla/5.0 (%s; %c; %s; %s) AppleWebKit/%d.%d"
" (KHTML, like Gecko) %s Safari/%d.%d",
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc
index c7a7d10..67b61ba 100644
--- a/webkit/glue/webkit_glue.cc
+++ b/webkit/glue/webkit_glue.cc
@@ -157,11 +157,11 @@ std::wstring DumpFrameScrollPosition(WebFrame* web_frame, bool recursive) {
if (offset.width() > 0 || offset.height() > 0) {
if (web_frame->parent()) {
- StringAppendF(&result, L"frame '%ls' ", UTF16ToWide(
+ base::StringAppendF(&result, L"frame '%ls' ", UTF16ToWide(
web_frame->name()).c_str());
}
- StringAppendF(&result, L"scrolled to %d,%d\n",
- offset.width(), offset.height());
+ base::StringAppendF(&result, L"scrolled to %d,%d\n",
+ offset.width(), offset.height());
}
if (recursive) {