| 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/net_pref_observer.h" | 5 #include "chrome/browser/net/net_pref_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/net/predictor.h" | 8 #include "chrome/browser/net/predictor.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/prerender/prerender_manager.h" | 10 #include "chrome/browser/prerender/prerender_manager.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void NetPrefObserver::RegisterPrefs(PrefService* prefs) { | 79 void NetPrefObserver::RegisterPrefs(PrefService* prefs) { |
| 80 prefs->RegisterBooleanPref(prefs::kNetworkPredictionEnabled, | 80 prefs->RegisterBooleanPref(prefs::kNetworkPredictionEnabled, |
| 81 true, | 81 true, |
| 82 PrefService::SYNCABLE_PREF); | 82 PrefService::SYNCABLE_PREF); |
| 83 prefs->RegisterBooleanPref(prefs::kDisableSpdy, | 83 prefs->RegisterBooleanPref(prefs::kDisableSpdy, |
| 84 false, | 84 false, |
| 85 PrefService::UNSYNCABLE_PREF); | 85 PrefService::UNSYNCABLE_PREF); |
| 86 prefs->RegisterBooleanPref(prefs::kHttpThrottlingEnabled, | 86 prefs->RegisterBooleanPref(prefs::kHttpThrottlingEnabled, |
| 87 true, | 87 true, |
| 88 PrefService::UNSYNCABLE_PREF); | 88 PrefService::UNSYNCABLE_PREF); |
| 89 // TODO(joi): This pref really means "user has not explicitly turned | |
| 90 // anti-DDoS throttling on or off". Rename it soon (2011/8/26) or | |
| 91 // remove it altogether (more likely). | |
| 92 prefs->RegisterBooleanPref(prefs::kHttpThrottlingMayExperiment, | |
| 93 true, | |
| 94 PrefService::UNSYNCABLE_PREF); | |
| 95 | |
| 96 // For users who created their profile while throttling was off by | |
| 97 // default, but have never explicitly turned it on or off, we turn | |
| 98 // it on which is the new default. | |
| 99 if (prefs->GetBoolean(prefs::kHttpThrottlingMayExperiment)) { | |
| 100 prefs->SetBoolean(prefs::kHttpThrottlingEnabled, true); | |
| 101 } | |
| 102 } | 89 } |
| OLD | NEW |