| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 | 149 |
| 150 // static | 150 // static |
| 151 Predictor* Predictor::CreatePredictor(bool preconnect_enabled, | 151 Predictor* Predictor::CreatePredictor(bool preconnect_enabled, |
| 152 bool simple_shutdown) { | 152 bool simple_shutdown) { |
| 153 if (simple_shutdown) | 153 if (simple_shutdown) |
| 154 return new SimplePredictor(preconnect_enabled); | 154 return new SimplePredictor(preconnect_enabled); |
| 155 return new Predictor(preconnect_enabled); | 155 return new Predictor(preconnect_enabled); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void Predictor::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 158 void Predictor::RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 159 registry->RegisterListPref(prefs::kDnsPrefetchingStartupList, | 159 registry->RegisterListPref(prefs::kDnsPrefetchingStartupList, |
| 160 PrefRegistrySyncable::UNSYNCABLE_PREF); | 160 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 161 registry->RegisterListPref(prefs::kDnsPrefetchingHostReferralList, | 161 registry->RegisterListPref(prefs::kDnsPrefetchingHostReferralList, |
| 162 PrefRegistrySyncable::UNSYNCABLE_PREF); | 162 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 163 } | 163 } |
| 164 | 164 |
| 165 // --------------------- Start UI methods. ------------------------------------ | 165 // --------------------- Start UI methods. ------------------------------------ |
| 166 | 166 |
| 167 void Predictor::InitNetworkPredictor(PrefService* user_prefs, | 167 void Predictor::InitNetworkPredictor(PrefService* user_prefs, |
| 168 PrefService* local_state, | 168 PrefService* local_state, |
| 169 IOThread* io_thread, | 169 IOThread* io_thread, |
| 170 net::URLRequestContextGetter* getter) { | 170 net::URLRequestContextGetter* getter) { |
| 171 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 171 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 172 | 172 |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 IOThread* io_thread, | 1186 IOThread* io_thread, |
| 1187 net::URLRequestContextGetter* getter) { | 1187 net::URLRequestContextGetter* getter) { |
| 1188 // Empty function for unittests. | 1188 // Empty function for unittests. |
| 1189 } | 1189 } |
| 1190 | 1190 |
| 1191 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { | 1191 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { |
| 1192 SetShutdown(true); | 1192 SetShutdown(true); |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 } // namespace chrome_browser_net | 1195 } // namespace chrome_browser_net |
| OLD | NEW |