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 <set> | 9 #include <set> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 Predictor* Predictor::CreatePredictor(bool preconnect_enabled, | 169 Predictor* Predictor::CreatePredictor(bool preconnect_enabled, |
170 bool predictor_enabled, | 170 bool predictor_enabled, |
171 bool simple_shutdown) { | 171 bool simple_shutdown) { |
172 if (simple_shutdown) | 172 if (simple_shutdown) |
173 return new SimplePredictor(preconnect_enabled, predictor_enabled); | 173 return new SimplePredictor(preconnect_enabled, predictor_enabled); |
174 return new Predictor(preconnect_enabled, predictor_enabled); | 174 return new Predictor(preconnect_enabled, predictor_enabled); |
175 } | 175 } |
176 | 176 |
177 void Predictor::RegisterProfilePrefs( | 177 void Predictor::RegisterProfilePrefs( |
178 user_prefs::PrefRegistrySyncable* registry) { | 178 user_prefs::PrefRegistrySyncable* registry) { |
179 registry->RegisterListPref(prefs::kDnsPrefetchingStartupList, | 179 registry->RegisterListPref(prefs::kDnsPrefetchingStartupList); |
180 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 180 registry->RegisterListPref(prefs::kDnsPrefetchingHostReferralList); |
181 registry->RegisterListPref(prefs::kDnsPrefetchingHostReferralList, | |
182 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
183 } | 181 } |
184 | 182 |
185 // --------------------- Start UI methods. ------------------------------------ | 183 // --------------------- Start UI methods. ------------------------------------ |
186 | 184 |
187 void Predictor::InitNetworkPredictor(PrefService* user_prefs, | 185 void Predictor::InitNetworkPredictor(PrefService* user_prefs, |
188 PrefService* local_state, | 186 PrefService* local_state, |
189 IOThread* io_thread, | 187 IOThread* io_thread, |
190 net::URLRequestContextGetter* getter, | 188 net::URLRequestContextGetter* getter, |
191 ProfileIOData* profile_io_data) { | 189 ProfileIOData* profile_io_data) { |
192 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 } | 1317 } |
1320 | 1318 |
1321 void SimplePredictor::ShutdownOnUIThread() { | 1319 void SimplePredictor::ShutdownOnUIThread() { |
1322 SetShutdown(true); | 1320 SetShutdown(true); |
1323 } | 1321 } |
1324 | 1322 |
1325 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } | 1323 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } |
1326 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } | 1324 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } |
1327 | 1325 |
1328 } // namespace chrome_browser_net | 1326 } // namespace chrome_browser_net |
OLD | NEW |