| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 // static | 152 // static |
| 153 Predictor* Predictor::CreatePredictor(bool preconnect_enabled, | 153 Predictor* Predictor::CreatePredictor(bool preconnect_enabled, |
| 154 bool simple_shutdown) { | 154 bool simple_shutdown) { |
| 155 if (simple_shutdown) | 155 if (simple_shutdown) |
| 156 return new SimplePredictor(preconnect_enabled); | 156 return new SimplePredictor(preconnect_enabled); |
| 157 return new Predictor(preconnect_enabled); | 157 return new Predictor(preconnect_enabled); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void Predictor::RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry) { | 160 void Predictor::RegisterProfilePrefs( |
| 161 user_prefs::PrefRegistrySyncable* registry) { |
| 161 registry->RegisterListPref(prefs::kDnsPrefetchingStartupList, | 162 registry->RegisterListPref(prefs::kDnsPrefetchingStartupList, |
| 162 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 163 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 163 registry->RegisterListPref(prefs::kDnsPrefetchingHostReferralList, | 164 registry->RegisterListPref(prefs::kDnsPrefetchingHostReferralList, |
| 164 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 165 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 165 } | 166 } |
| 166 | 167 |
| 167 // --------------------- Start UI methods. ------------------------------------ | 168 // --------------------- Start UI methods. ------------------------------------ |
| 168 | 169 |
| 169 void Predictor::InitNetworkPredictor(PrefService* user_prefs, | 170 void Predictor::InitNetworkPredictor(PrefService* user_prefs, |
| 170 PrefService* local_state, | 171 PrefService* local_state, |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 IOThread* io_thread, | 1227 IOThread* io_thread, |
| 1227 net::URLRequestContextGetter* getter) { | 1228 net::URLRequestContextGetter* getter) { |
| 1228 // Empty function for unittests. | 1229 // Empty function for unittests. |
| 1229 } | 1230 } |
| 1230 | 1231 |
| 1231 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { | 1232 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { |
| 1232 SetShutdown(true); | 1233 SetShutdown(true); |
| 1233 } | 1234 } |
| 1234 | 1235 |
| 1235 } // namespace chrome_browser_net | 1236 } // namespace chrome_browser_net |
| OLD | NEW |