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> |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
30 #include "net/base/address_list.h" | 30 #include "net/base/address_list.h" |
31 #include "net/base/completion_callback.h" | 31 #include "net/base/completion_callback.h" |
32 #include "net/base/host_port_pair.h" | 32 #include "net/base/host_port_pair.h" |
33 #include "net/base/host_resolver.h" | 33 #include "net/base/host_resolver.h" |
34 #include "net/base/net_errors.h" | 34 #include "net/base/net_errors.h" |
35 #include "net/base/net_log.h" | 35 #include "net/base/net_log.h" |
36 #include "net/base/single_request_host_resolver.h" | 36 #include "net/base/single_request_host_resolver.h" |
37 | 37 |
38 using base::TimeDelta; | 38 using base::TimeDelta; |
| 39 using content::BrowserThread; |
39 | 40 |
40 namespace chrome_browser_net { | 41 namespace chrome_browser_net { |
41 | 42 |
42 // static | 43 // static |
43 const int Predictor::kPredictorReferrerVersion = 2; | 44 const int Predictor::kPredictorReferrerVersion = 2; |
44 const double Predictor::kPreconnectWorthyExpectedValue = 0.8; | 45 const double Predictor::kPreconnectWorthyExpectedValue = 0.8; |
45 const double Predictor::kDNSPreresolutionWorthyExpectedValue = 0.1; | 46 const double Predictor::kDNSPreresolutionWorthyExpectedValue = 0.1; |
46 const double Predictor::kDiscardableExpectedValue = 0.05; | 47 const double Predictor::kDiscardableExpectedValue = 0.05; |
47 // The goal is of trimming is to to reduce the importance (number of expected | 48 // The goal is of trimming is to to reduce the importance (number of expected |
48 // subresources needed) by a factor of 2 after about 24 hours of uptime. We will | 49 // subresources needed) by a factor of 2 after about 24 hours of uptime. We will |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 PrefService* local_state, | 1207 PrefService* local_state, |
1207 IOThread* io_thread) { | 1208 IOThread* io_thread) { |
1208 // Empty function for unittests. | 1209 // Empty function for unittests. |
1209 } | 1210 } |
1210 | 1211 |
1211 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { | 1212 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { |
1212 SetShutdown(true); | 1213 SetShutdown(true); |
1213 } | 1214 } |
1214 | 1215 |
1215 } // namespace chrome_browser_net | 1216 } // namespace chrome_browser_net |
OLD | NEW |