OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/net/predictor.h" | 5 #include "chrome/browser/net/predictor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 "<th>Expected<br>Connects</th>" | 354 "<th>Expected<br>Connects</th>" |
355 "<th>Subresource Spec</th></tr>"); | 355 "<th>Subresource Spec</th></tr>"); |
356 | 356 |
357 for (SortedNames::iterator it = sorted_names.begin(); | 357 for (SortedNames::iterator it = sorted_names.begin(); |
358 sorted_names.end() != it; ++it) { | 358 sorted_names.end() != it; ++it) { |
359 Referrer* referrer = &(referrers_[*it]); | 359 Referrer* referrer = &(referrers_[*it]); |
360 bool first_set_of_futures = true; | 360 bool first_set_of_futures = true; |
361 for (Referrer::iterator future_url = referrer->begin(); | 361 for (Referrer::iterator future_url = referrer->begin(); |
362 future_url != referrer->end(); ++future_url) { | 362 future_url != referrer->end(); ++future_url) { |
363 output->append("<tr align=right>"); | 363 output->append("<tr align=right>"); |
364 if (first_set_of_futures) | 364 if (first_set_of_futures) { |
365 StringAppendF(output, "<td rowspan=%d>%s</td><td rowspan=%d>%d</td>", | 365 base::StringAppendF(output, |
366 static_cast<int>(referrer->size()), | 366 "<td rowspan=%d>%s</td><td rowspan=%d>%d</td>", |
367 it->spec().c_str(), | 367 static_cast<int>(referrer->size()), |
368 static_cast<int>(referrer->size()), | 368 it->spec().c_str(), |
369 static_cast<int>(referrer->use_count())); | 369 static_cast<int>(referrer->size()), |
| 370 static_cast<int>(referrer->use_count())); |
| 371 } |
370 first_set_of_futures = false; | 372 first_set_of_futures = false; |
371 StringAppendF(output, | 373 base::StringAppendF(output, |
372 "<td>%d</td><td>%d</td><td>%d</td><td>%2.3f</td><td>%s</td></tr>", | 374 "<td>%d</td><td>%d</td><td>%d</td><td>%2.3f</td><td>%s</td></tr>", |
373 static_cast<int>(future_url->second.navigation_count()), | 375 static_cast<int>(future_url->second.navigation_count()), |
374 static_cast<int>(future_url->second.preconnection_count()), | 376 static_cast<int>(future_url->second.preconnection_count()), |
375 static_cast<int>(future_url->second.preresolution_count()), | 377 static_cast<int>(future_url->second.preresolution_count()), |
376 static_cast<double>(future_url->second.subresource_use_rate()), | 378 static_cast<double>(future_url->second.subresource_use_rate()), |
377 future_url->first.spec().c_str()); | 379 future_url->first.spec().c_str()); |
378 } | 380 } |
379 } | 381 } |
380 output->append("</table>"); | 382 output->append("</table>"); |
381 } | 383 } |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 // If we omit a port, it will default to 80 or 443 as appropriate. | 685 // If we omit a port, it will default to 80 or 443 as appropriate. |
684 std::string colon_plus_port; | 686 std::string colon_plus_port; |
685 if (url.has_port()) | 687 if (url.has_port()) |
686 colon_plus_port = ":" + url.port(); | 688 colon_plus_port = ":" + url.port(); |
687 | 689 |
688 return GURL(scheme + "://" + url.host() + colon_plus_port); | 690 return GURL(scheme + "://" + url.host() + colon_plus_port); |
689 } | 691 } |
690 | 692 |
691 | 693 |
692 } // namespace chrome_browser_net | 694 } // namespace chrome_browser_net |
OLD | NEW |