| 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/task.h" | 7 #include "base/task.h" |
| 8 #include "chrome/browser/net/predictor_api.h" | 8 #include "chrome/browser/net/predictor_api.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" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/trials/http_throttling_trial.h" |
| 12 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 13 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
| 14 #include "content/common/notification_type.h" | 15 #include "content/common/notification_type.h" |
| 15 #include "content/common/notification_details.h" | 16 #include "content/common/notification_details.h" |
| 16 #include "net/http/http_stream_factory.h" | 17 #include "net/http/http_stream_factory.h" |
| 17 #include "net/url_request/url_request_throttler_manager.h" | 18 #include "net/url_request/url_request_throttler_manager.h" |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| 21 // Function (for NewRunnableFunction) to call the set_enforce_throttling | 22 // Function (for NewRunnableFunction) to call the set_enforce_throttling |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void NetPrefObserver::RegisterPrefs(PrefService* prefs) { | 74 void NetPrefObserver::RegisterPrefs(PrefService* prefs) { |
| 74 prefs->RegisterBooleanPref(prefs::kNetworkPredictionEnabled, | 75 prefs->RegisterBooleanPref(prefs::kNetworkPredictionEnabled, |
| 75 true, | 76 true, |
| 76 PrefService::SYNCABLE_PREF); | 77 PrefService::SYNCABLE_PREF); |
| 77 prefs->RegisterBooleanPref(prefs::kDisableSpdy, | 78 prefs->RegisterBooleanPref(prefs::kDisableSpdy, |
| 78 false, | 79 false, |
| 79 PrefService::UNSYNCABLE_PREF); | 80 PrefService::UNSYNCABLE_PREF); |
| 80 prefs->RegisterBooleanPref(prefs::kHttpThrottlingEnabled, | 81 prefs->RegisterBooleanPref(prefs::kHttpThrottlingEnabled, |
| 81 false, | 82 false, |
| 82 PrefService::UNSYNCABLE_PREF); | 83 PrefService::UNSYNCABLE_PREF); |
| 84 prefs->RegisterBooleanPref(prefs::kHttpThrottlingMayExperiment, |
| 85 true, |
| 86 PrefService::UNSYNCABLE_PREF); |
| 87 |
| 88 // This is the earliest point at which we can set up the trial, as |
| 89 // it relies on prefs for parameterization. |
| 90 CreateHttpThrottlingTrial(prefs); |
| 83 } | 91 } |
| OLD | NEW |