| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <cmath> | 8 #include <cmath> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <sstream> | 10 #include <sstream> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/net/preconnect.h" | 17 #include "chrome/browser/net/preconnect.h" |
| 18 #include "content/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
| 19 #include "net/base/address_list.h" | 19 #include "net/base/address_list.h" |
| 20 #include "net/base/completion_callback.h" | 20 #include "net/base/completion_callback.h" |
| 21 #include "net/base/host_port_pair.h" | 21 #include "net/base/host_port_pair.h" |
| 22 #include "net/base/host_resolver.h" | 22 #include "net/base/host_resolver.h" |
| 23 #include "net/base/net_errors.h" | 23 #include "net/base/net_errors.h" |
| 24 #include "net/base/net_log.h" | 24 #include "net/base/net_log.h" |
| 25 #include "net/base/single_request_host_resolver.h" |
| 25 | 26 |
| 26 using base::TimeDelta; | 27 using base::TimeDelta; |
| 27 | 28 |
| 28 namespace chrome_browser_net { | 29 namespace chrome_browser_net { |
| 29 | 30 |
| 30 // static | 31 // static |
| 31 const double Predictor::kPreconnectWorthyExpectedValue = 0.8; | 32 const double Predictor::kPreconnectWorthyExpectedValue = 0.8; |
| 32 // static | 33 // static |
| 33 const double Predictor::kDNSPreresolutionWorthyExpectedValue = 0.1; | 34 const double Predictor::kDNSPreresolutionWorthyExpectedValue = 0.1; |
| 34 // static | 35 // static |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 // If we omit a port, it will default to 80 or 443 as appropriate. | 768 // If we omit a port, it will default to 80 or 443 as appropriate. |
| 768 std::string colon_plus_port; | 769 std::string colon_plus_port; |
| 769 if (url.has_port()) | 770 if (url.has_port()) |
| 770 colon_plus_port = ":" + url.port(); | 771 colon_plus_port = ":" + url.port(); |
| 771 | 772 |
| 772 return GURL(scheme + "://" + url.host() + colon_plus_port); | 773 return GURL(scheme + "://" + url.host() + colon_plus_port); |
| 773 } | 774 } |
| 774 | 775 |
| 775 | 776 |
| 776 } // namespace chrome_browser_net | 777 } // namespace chrome_browser_net |
| OLD | NEW |