OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // See header file for description of class | |
6 | |
7 #include "chrome/browser/net/dns_host_info.h" | 5 #include "chrome/browser/net/dns_host_info.h" |
8 | 6 |
9 #include <math.h> | 7 #include <math.h> |
10 | 8 |
11 #include <algorithm> | 9 #include <algorithm> |
12 #include <string> | 10 #include <string> |
13 | 11 |
| 12 #include "base/format_macros.h" |
14 #include "base/histogram.h" | 13 #include "base/histogram.h" |
15 #include "base/logging.h" | 14 #include "base/logging.h" |
16 #include "base/string_util.h" | 15 #include "base/string_util.h" |
17 | 16 |
18 using base::Time; | 17 using base::Time; |
19 using base::TimeDelta; | 18 using base::TimeDelta; |
20 using base::TimeTicks; | 19 using base::TimeTicks; |
21 | 20 |
22 namespace chrome_browser_net { | 21 namespace chrome_browser_net { |
23 | 22 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 } | 318 } |
320 | 319 |
321 // static | 320 // static |
322 void DnsHostInfo::GetHtmlTable(const DnsInfoTable host_infos, | 321 void DnsHostInfo::GetHtmlTable(const DnsInfoTable host_infos, |
323 const char* description, | 322 const char* description, |
324 const bool brief, | 323 const bool brief, |
325 std::string* output) { | 324 std::string* output) { |
326 if (0 == host_infos.size()) | 325 if (0 == host_infos.size()) |
327 return; | 326 return; |
328 output->append(description); | 327 output->append(description); |
329 StringAppendF(output, "%d %s", host_infos.size(), | 328 StringAppendF(output, "%" PRIuS " %s", host_infos.size(), |
330 (1 == host_infos.size()) ? "hostname" : "hostnames"); | 329 (1 == host_infos.size()) ? "hostname" : "hostnames"); |
331 | 330 |
332 if (brief) { | 331 if (brief) { |
333 output->append("<br><br>"); | 332 output->append("<br><br>"); |
334 return; | 333 return; |
335 } | 334 } |
336 | 335 |
337 const char* row_format = "<tr align=right><td>%s</td>" | 336 const char* row_format = "<tr align=right><td>%s</td>" |
338 "<td>%d</td><td>%d</td><td>%s</td><td>%s</td></tr>"; | 337 "<td>%d</td><td>%d</td><td>%s</td><td>%s</td></tr>"; |
339 | 338 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 419 |
421 case LEARNED_REFERAL_MOTIVATED: | 420 case LEARNED_REFERAL_MOTIVATED: |
422 return RemoveJs(referring_hostname_); | 421 return RemoveJs(referring_hostname_); |
423 | 422 |
424 default: | 423 default: |
425 return ""; | 424 return ""; |
426 } | 425 } |
427 } | 426 } |
428 | 427 |
429 } // namespace chrome_browser_net | 428 } // namespace chrome_browser_net |
OLD | NEW |