Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: chrome/browser/net/net_pref_observer.cc

Issue 10911198: SPDY - disable SPDY based on command line and policy (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/net_pref_observer.h" 5 #include "chrome/browser/net/net_pref_observer.h"
6 6
7 #include "chrome/browser/net/predictor.h" 7 #include "chrome/browser/net/predictor.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/browser/prerender/prerender_manager.h" 9 #include "chrome/browser/prerender/prerender_manager.h"
10 #include "chrome/common/chrome_notification_types.h" 10 #include "chrome/common/chrome_notification_types.h"
(...skipping 29 matching lines...) Expand all
40 DCHECK_EQ(type, chrome::NOTIFICATION_PREF_CHANGED); 40 DCHECK_EQ(type, chrome::NOTIFICATION_PREF_CHANGED);
41 ApplySettings(); 41 ApplySettings();
42 } 42 }
43 43
44 void NetPrefObserver::ApplySettings() { 44 void NetPrefObserver::ApplySettings() {
45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
46 46
47 predictor_->EnablePredictor(*network_prediction_enabled_); 47 predictor_->EnablePredictor(*network_prediction_enabled_);
48 if (prerender_manager_) 48 if (prerender_manager_)
49 prerender_manager_->set_enabled(*network_prediction_enabled_); 49 prerender_manager_->set_enabled(*network_prediction_enabled_);
50 net::HttpStreamFactory::set_spdy_enabled(!*spdy_disabled_); 50 if (spdy_disabled_.IsManaged())
51 net::HttpStreamFactory::set_spdy_enabled(!*spdy_disabled_);
51 } 52 }
52 53
53 // static 54 // static
54 void NetPrefObserver::RegisterPrefs(PrefService* prefs) { 55 void NetPrefObserver::RegisterPrefs(PrefService* prefs) {
55 prefs->RegisterBooleanPref(prefs::kNetworkPredictionEnabled, 56 prefs->RegisterBooleanPref(prefs::kNetworkPredictionEnabled,
56 true, 57 true,
57 PrefService::SYNCABLE_PREF); 58 PrefService::SYNCABLE_PREF);
58 prefs->RegisterBooleanPref(prefs::kDisableSpdy, 59 prefs->RegisterBooleanPref(prefs::kDisableSpdy,
59 false, 60 false,
60 PrefService::UNSYNCABLE_PREF); 61 PrefService::UNSYNCABLE_PREF);
61 } 62 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698