Index: chrome/browser/net/net_pref_observer.cc |
diff --git a/chrome/browser/net/net_pref_observer.cc b/chrome/browser/net/net_pref_observer.cc |
index 8a0d08e72032152cd7c1d5923063ba71e0b261d0..68a22ccedfd645fedd519cdcada114252372a0ff 100644 |
--- a/chrome/browser/net/net_pref_observer.cc |
+++ b/chrome/browser/net/net_pref_observer.cc |
@@ -15,6 +15,7 @@ |
#include "content/common/notification_type.h" |
#include "content/common/notification_details.h" |
#include "net/http/http_stream_factory.h" |
+#include "net/socket/client_socket_pool_manager.h" |
#include "net/url_request/url_request_throttler_manager.h" |
namespace { |
@@ -37,6 +38,7 @@ NetPrefObserver::NetPrefObserver(PrefService* prefs, |
this); |
spdy_disabled_.Init(prefs::kDisableSpdy, prefs, this); |
http_throttling_enabled_.Init(prefs::kHttpThrottlingEnabled, prefs, this); |
+ max_connections_per_proxy_.Init(prefs::kMaxConnectionsPerProxy, prefs, this); |
ApplySettings(NULL); |
} |
@@ -68,6 +70,14 @@ void NetPrefObserver::ApplySettings(const std::string* pref_name) { |
NewRunnableFunction(SetEnforceThrottlingOnThrottlerManager, |
*http_throttling_enabled_)); |
} |
+ |
+ if (!pref_name || *pref_name == prefs::kMaxConnectionsPerProxy) { |
willchan no longer on Chromium
2011/06/29 22:54:55
There are a few issues here. First, this is only s
pastarmovj
2011/07/01 18:52:44
Ok i removed the dynamic marking from the policy a
|
+ // Make sure the value is not greater than 100 and nor smaller than the |
+ // maximal number of connections allowed per group. |
+ net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( |
+ std::max(std::min(*max_connections_per_proxy_, 100), |
+ net::ClientSocketPoolManager::max_sockets_per_group())); |
+ } |
} |
// static |
@@ -84,7 +94,9 @@ void NetPrefObserver::RegisterPrefs(PrefService* prefs) { |
prefs->RegisterBooleanPref(prefs::kHttpThrottlingMayExperiment, |
true, |
PrefService::UNSYNCABLE_PREF); |
- |
+ prefs->RegisterIntegerPref(prefs::kMaxConnectionsPerProxy, |
+ 32, |
willchan no longer on Chromium
2011/06/29 22:54:55
This should probably use a default that is read fr
pastarmovj
2011/07/01 18:52:44
Done.
|
+ PrefService::UNSYNCABLE_PREF); |
// This is the earliest point at which we can set up the trial, as |
// it relies on prefs for parameterization. |
CreateHttpThrottlingTrial(prefs); |