| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <iterator> | 9 #include <iterator> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 shutdown_(false), | 108 shutdown_(false), |
| 109 max_concurrent_dns_lookups_(g_max_parallel_resolves), | 109 max_concurrent_dns_lookups_(g_max_parallel_resolves), |
| 110 max_dns_queue_delay_( | 110 max_dns_queue_delay_( |
| 111 TimeDelta::FromMilliseconds(g_max_queueing_delay_ms)), | 111 TimeDelta::FromMilliseconds(g_max_queueing_delay_ms)), |
| 112 transport_security_state_(nullptr), | 112 transport_security_state_(nullptr), |
| 113 ssl_config_service_(nullptr), | 113 ssl_config_service_(nullptr), |
| 114 proxy_service_(nullptr), | 114 proxy_service_(nullptr), |
| 115 consecutive_omnibox_preconnect_count_(0), | 115 consecutive_omnibox_preconnect_count_(0), |
| 116 referrers_(kMaxReferrers), | 116 referrers_(kMaxReferrers), |
| 117 observer_(nullptr), | 117 observer_(nullptr), |
| 118 timed_cache_(new TimedCache(base::TimeDelta::FromSeconds( | |
| 119 kMaxUnusedSocketLifetimeSecondsWithoutAGet))), | |
| 120 ui_weak_factory_(new base::WeakPtrFactory<Predictor>(this)) { | 118 ui_weak_factory_(new base::WeakPtrFactory<Predictor>(this)) { |
| 121 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 119 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 122 } | 120 } |
| 123 | 121 |
| 124 Predictor::~Predictor() { | 122 Predictor::~Predictor() { |
| 125 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 123 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 126 DCHECK(shutdown_); | 124 DCHECK(shutdown_); |
| 127 } | 125 } |
| 128 | 126 |
| 129 // static | 127 // static |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 } | 1197 } |
| 1200 | 1198 |
| 1201 void SimplePredictor::ShutdownOnUIThread() { | 1199 void SimplePredictor::ShutdownOnUIThread() { |
| 1202 SetShutdown(true); | 1200 SetShutdown(true); |
| 1203 } | 1201 } |
| 1204 | 1202 |
| 1205 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } | 1203 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } |
| 1206 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } | 1204 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } |
| 1207 | 1205 |
| 1208 } // namespace chrome_browser_net | 1206 } // namespace chrome_browser_net |
| OLD | NEW |