| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/url_request/url_request_view_net_internals_job.h" | 5 #include "net/url_request/url_request_view_net_internals_job.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <ws2tcpip.h> | 8 #include <ws2tcpip.h> |
| 9 #else | 9 #else |
| 10 #include <netdb.h> | 10 #include <netdb.h> |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 210 } |
| 211 | 211 |
| 212 virtual void OutputBody(URLRequestContext* context, std::string* out) { | 212 virtual void OutputBody(URLRequestContext* context, std::string* out) { |
| 213 const net::HostCache* host_cache = context->host_resolver()->GetHostCache(); | 213 const net::HostCache* host_cache = context->host_resolver()->GetHostCache(); |
| 214 | 214 |
| 215 if (!host_cache || host_cache->caching_is_disabled()) { | 215 if (!host_cache || host_cache->caching_is_disabled()) { |
| 216 out->append("<i>Caching is disabled.</i>"); | 216 out->append("<i>Caching is disabled.</i>"); |
| 217 return; | 217 return; |
| 218 } | 218 } |
| 219 | 219 |
| 220 out->append(StringPrintf("<ul><li>Size: %" PRIuS "</li>" | 220 out->append(StringPrintf( |
| 221 "<li>Capacity: %" PRIuS "</li>" | 221 "<ul><li>Size: %" PRIuS "</li>" |
| 222 "<li>Time to live (ms): %" PRIuS "</li></ul>", | 222 "<li>Capacity: %" PRIuS "</li>" |
| 223 host_cache->size(), | 223 "<li>Time to live (ms) for success entries: %" PRId64"</li>" |
| 224 host_cache->max_entries(), | 224 "<li>Time to live (ms) for failure entries: %" PRId64"</li></ul>", |
| 225 host_cache->cache_duration_ms())); | 225 host_cache->size(), |
| 226 host_cache->max_entries(), |
| 227 host_cache->success_entry_ttl().InMilliseconds(), |
| 228 host_cache->failure_entry_ttl().InMilliseconds())); |
| 226 | 229 |
| 227 out->append("<table border=1>" | 230 out->append("<table border=1>" |
| 228 "<tr>" | 231 "<tr>" |
| 229 "<th>Host</th>" | 232 "<th>Host</th>" |
| 230 "<th>Address family</th>" | 233 "<th>Address family</th>" |
| 231 "<th>Address list</th>" | 234 "<th>Address list</th>" |
| 232 "<th>Time to live (ms)</th>" | 235 "<th>Time to live (ms)</th>" |
| 233 "</tr>"); | 236 "</tr>"); |
| 234 | 237 |
| 235 for (net::HostCache::EntryMap::const_iterator it = | 238 for (net::HostCache::EntryMap::const_iterator it = |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 } else { | 531 } else { |
| 529 data->append("<i>Nothing found for \""); | 532 data->append("<i>Nothing found for \""); |
| 530 data->append(EscapeForHTML(details)); | 533 data->append(EscapeForHTML(details)); |
| 531 data->append("\"</i>"); | 534 data->append("\"</i>"); |
| 532 } | 535 } |
| 533 | 536 |
| 534 data->append("</body></html>"); | 537 data->append("</body></html>"); |
| 535 | 538 |
| 536 return true; | 539 return true; |
| 537 } | 540 } |
| OLD | NEW |