| 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // Get copies of all useful data. | 385 // Get copies of all useful data. |
| 386 typedef std::map<GURL, UrlInfo, RightToLeftStringSorter> SortedUrlInfo; | 386 typedef std::map<GURL, UrlInfo, RightToLeftStringSorter> SortedUrlInfo; |
| 387 SortedUrlInfo snapshot; | 387 SortedUrlInfo snapshot; |
| 388 // UrlInfo supports value semantics, so we can do a shallow copy. | 388 // UrlInfo supports value semantics, so we can do a shallow copy. |
| 389 for (Results::iterator it(results_.begin()); it != results_.end(); it++) | 389 for (Results::iterator it(results_.begin()); it != results_.end(); it++) |
| 390 snapshot[it->first] = it->second; | 390 snapshot[it->first] = it->second; |
| 391 | 391 |
| 392 // Partition the UrlInfo's into categories. | 392 // Partition the UrlInfo's into categories. |
| 393 for (SortedUrlInfo::iterator it(snapshot.begin()); | 393 for (SortedUrlInfo::iterator it(snapshot.begin()); |
| 394 it != snapshot.end(); it++) { | 394 it != snapshot.end(); it++) { |
| 395 if (it->second.was_nonexistant()) { | 395 if (it->second.was_nonexistent()) { |
| 396 name_not_found.push_back(it->second); | 396 name_not_found.push_back(it->second); |
| 397 continue; | 397 continue; |
| 398 } | 398 } |
| 399 if (!it->second.was_found()) | 399 if (!it->second.was_found()) |
| 400 continue; // Still being processed. | 400 continue; // Still being processed. |
| 401 name_preresolved.push_back(it->second); | 401 name_preresolved.push_back(it->second); |
| 402 } | 402 } |
| 403 | 403 |
| 404 bool brief = false; | 404 bool brief = false; |
| 405 #ifdef NDEBUG | 405 #ifdef NDEBUG |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 // If we omit a port, it will default to 80 or 443 as appropriate. | 679 // If we omit a port, it will default to 80 or 443 as appropriate. |
| 680 std::string colon_plus_port; | 680 std::string colon_plus_port; |
| 681 if (url.has_port()) | 681 if (url.has_port()) |
| 682 colon_plus_port = ":" + url.port(); | 682 colon_plus_port = ":" + url.port(); |
| 683 | 683 |
| 684 return GURL(scheme + "://" + url.host() + colon_plus_port); | 684 return GURL(scheme + "://" + url.host() + colon_plus_port); |
| 685 } | 685 } |
| 686 | 686 |
| 687 | 687 |
| 688 } // namespace chrome_browser_net | 688 } // namespace chrome_browser_net |
| OLD | NEW |