Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(825)

Unified Diff: net/url_request/url_request_view_net_internals_job.cc

Issue 302010: Add a mechanism to disable IPv6.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address darin's comments Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/base/host_resolver_impl.h ('K') | « net/net.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_view_net_internals_job.cc
===================================================================
--- net/url_request/url_request_view_net_internals_job.cc (revision 29420)
+++ net/url_request/url_request_view_net_internals_job.cc (working copy)
@@ -225,6 +225,7 @@
out->append("<table border=1>"
"<tr>"
"<th>Host</th>"
+ "<th>Address family</th>"
"<th>Address list</th>"
"<th>Time to live (ms)</th>"
"</tr>");
@@ -233,9 +234,12 @@
host_cache->entries().begin();
it != host_cache->entries().end();
++it) {
- const std::string& host = it->first;
+ const net::HostCache::Key& key = it->first;
const net::HostCache::Entry* entry = it->second.get();
+ std::string address_family_str =
+ AddressFamilyToString(key.address_family);
+
if (entry->error == net::OK) {
// Note that ttl_ms may be negative, for the cases where entries have
// expired but not been garbage collected yet.
@@ -261,23 +265,35 @@
current_address = current_address->ai_next;
}
- out->append(StringPrintf("<td>%s</td><td>%s</td><td>%d</td></tr>",
- EscapeForHTML(host).c_str(),
+ 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));
} else {
// This was an entry that failed to be resolved.
// Color negative entries red.
out->append(StringPrintf(
- "<tr style='color:red'><td>%s</td>"
+ "<tr style='color:red'><td>%s</td><td>%s</td>"
"<td colspan=2>%s</td></tr>",
- EscapeForHTML(host).c_str(),
+ EscapeForHTML(key.hostname).c_str(),
+ EscapeForHTML(address_family_str).c_str(),
EscapeForHTML(net::ErrorToString(entry->error)).c_str()));
}
}
out->append("</table>");
}
+
+ static std::string AddressFamilyToString(net::AddressFamily address_family) {
+ switch (address_family) {
+ case net::ADDRESS_FAMILY_IPV4_ONLY:
+ return "IPV4_ONLY";
+ default:
+ return "UNSPECIFIED";
+ }
+ }
};
class HostResolverSubSection : public SubSection {
« net/base/host_resolver_impl.h ('K') | « net/net.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698