diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 22:14:34 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 22:14:34 +0000 |
commit | 71ed91106ec950734360353775b8579862ff6524 (patch) | |
tree | aa7ca3b450184a39e2d71a9e07847634e075762e /net | |
parent | 421e6141a78f759837e9caa7a5310fb4aa4465d5 (diff) | |
download | chromium_src-71ed91106ec950734360353775b8579862ff6524.zip chromium_src-71ed91106ec950734360353775b8579862ff6524.tar.gz chromium_src-71ed91106ec950734360353775b8579862ff6524.tar.bz2 |
Cleanup: change some |str += StringPrintf(...)| --> |StringAppendF(&str, ...)|.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/550030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/load_log_util.cc | 18 | ||||
-rw-r--r-- | net/tools/hresolv/hresolv.cc | 8 | ||||
-rw-r--r-- | net/url_request/url_request_view_net_internals_job.cc | 47 |
3 files changed, 38 insertions, 35 deletions
diff --git a/net/base/load_log_util.cc b/net/base/load_log_util.cc index 9410eb0..cad20a5 100644 --- a/net/base/load_log_util.cc +++ b/net/base/load_log_util.cc @@ -33,8 +33,8 @@ class FormatHelper { for (size_t i = 0; i < entries_.size(); ++i) { if (log->num_entries_truncated() > 0 && i + 1 == entries_.size()) { - result += StringPrintf(" ... Truncated %" PRIuS " entries ...\n", - log->num_entries_truncated()); + StringAppendF(&result, " ... Truncated %" PRIuS " entries ...\n", + log->num_entries_truncated()); } if (entries_[i].block_index != -1 && @@ -48,18 +48,18 @@ class FormatHelper { int indentation_spaces = entries_[i].indentation * kSpacesPerIndentation; std::string entry_str = GetEntryString(i); - result += StringPrintf("t=%s: %s%s", - PadStringLeft(GetTimeString(i), max_time_width).c_str(), - PadStringLeft("", indentation_spaces).c_str(), - entry_str.c_str()); + StringAppendF(&result, "t=%s: %s%s", + PadStringLeft(GetTimeString(i), max_time_width).c_str(), + PadStringLeft("", indentation_spaces).c_str(), + entry_str.c_str()); if (entries_[i].IsBeginEvent()) { // Summarize how long this block lasted. int padding = ((max_indentation - entries_[i].indentation) * kSpacesPerIndentation) + (max_type_width - entry_str.size()); - result += StringPrintf("%s [dt=%s]", - PadStringLeft("", padding).c_str(), - PadStringLeft(GetBlockDtString(i), max_dt_width).c_str()); + StringAppendF(&result, "%s [dt=%s]", + PadStringLeft("", padding).c_str(), + PadStringLeft(GetBlockDtString(i), max_dt_width).c_str()); } if (i + 1 != entries_.size()) diff --git a/net/tools/hresolv/hresolv.cc b/net/tools/hresolv/hresolv.cc index 6581bdc..f865a53 100644 --- a/net/tools/hresolv/hresolv.cc +++ b/net/tools/hresolv/hresolv.cc @@ -68,10 +68,10 @@ std::string FormatAddrinfoFlags(int ai_flags) { } } if (ai_flags) { - if (!flag_names.empty()) { - flag_names += "|"; - } - flag_names += StringPrintf("0x%x", ai_flags); + if (!flag_names.empty()) { + flag_names += "|"; + } + StringAppendF(&flag_names, "0x%x", ai_flags); } return flag_names; } diff --git a/net/url_request/url_request_view_net_internals_job.cc b/net/url_request/url_request_view_net_internals_job.cc index 365c92c..39f7d15 100644 --- a/net/url_request/url_request_view_net_internals_job.cc +++ b/net/url_request/url_request_view_net_internals_job.cc @@ -40,11 +40,10 @@ void OutputTextInPre(const std::string& text, std::string* out) { void DrawCommandButton(const std::string& title, const std::string& command, std::string* data) { - data->append( - StringPrintf("<input type=\"button\" value=\"%s\" " - "onclick=\"DoCommand('%s')\" />", - title.c_str(), - command.c_str())); + StringAppendF(data, "<input type=\"button\" value=\"%s\" " + "onclick=\"DoCommand('%s')\" />", + title.c_str(), + command.c_str()); } @@ -79,13 +78,15 @@ class SubSection { url_format->MakeURL(GetFullyQualifiedName()).spec(); // Print the heading. - out->append(StringPrintf("<div>" + StringAppendF( + out, + "<div>" "<span class=subsection_title>%s</span> " "<span class=subsection_name>(<a href='%s'>%s</a>)<span>" "</div>", EscapeForHTML(title_).c_str(), section_url.c_str(), - EscapeForHTML(section_url).c_str())); + EscapeForHTML(section_url).c_str()); out->append("<div class=subsection_body>"); } @@ -261,15 +262,16 @@ class HostResolverCacheSubSection : public SubSection { DrawCommandButton("Clear", "clear-hostcache", out); - out->append(StringPrintf( - "<ul><li>Size: %" PRIuS "</li>" - "<li>Capacity: %" PRIuS "</li>" - "<li>Time to live (ms) for success entries: %" PRId64"</li>" - "<li>Time to live (ms) for failure entries: %" PRId64"</li></ul>", - host_cache->size(), - host_cache->max_entries(), - host_cache->success_entry_ttl().InMilliseconds(), - host_cache->failure_entry_ttl().InMilliseconds())); + StringAppendF( + out, + "<ul><li>Size: %" PRIuS "</li>" + "<li>Capacity: %" PRIuS "</li>" + "<li>Time to live (ms) for success entries: %" PRId64"</li>" + "<li>Time to live (ms) for failure entries: %" PRId64"</li></ul>", + host_cache->size(), + host_cache->max_entries(), + host_cache->success_entry_ttl().InMilliseconds(), + host_cache->failure_entry_ttl().InMilliseconds()); out->append("<table border=1>" "<tr>" @@ -320,12 +322,13 @@ class HostResolverCacheSubSection : public SubSection { } } - out->append(StringPrintf("<td>%s</td><td>%s</td><td>%s</td>" - "<td>%d</td></tr>", - EscapeForHTML(key.hostname).c_str(), - EscapeForHTML(address_family_str).c_str(), - address_list_html.c_str(), - ttl_ms)); + StringAppendF(out, + "<td>%s</td><td>%s</td><td>%s</td>" + "<td>%d</td></tr>", + EscapeForHTML(key.hostname).c_str(), + EscapeForHTML(address_family_str).c_str(), + address_list_html.c_str(), + ttl_ms); } out->append("</table>"); |