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

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 7283018: Introduce a policy to control the maximal number of connections per proxy server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make the bots happy with the policy template. Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index f99f38b5eaef1119f822485a8aa59905f638ec83..b616348055ffd335cf8d83b3865094f2a8288ecb 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -77,6 +77,7 @@
#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/common/notification_service.h"
#include "ipc/ipc_logging.h"
+#include "net/socket/client_socket_pool_manager.h"
#include "net/url_request/url_request_context_getter.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/l10n/l10n_util.h"
@@ -849,6 +850,15 @@ void BrowserProcessImpl::CreateLocalState() {
// able so we need to have it when initializing the profiles.
local_state_->RegisterFilePathPref(prefs::kDiskCacheDir, FilePath());
+ // Another policy that needs to be defined before the net subsystem is
+ // initialized is MaxConnectionsPerProxy so we do it here.
+ local_state_->RegisterIntegerPref(prefs::kMaxConnectionsPerProxy,
+ net::kDefaultMaxSocketsPerProxyServer);
+ int max_per_proxy = local_state_->GetInteger(prefs::kMaxConnectionsPerProxy);
+ net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(
+ std::max(std::min(max_per_proxy, 99),
+ net::ClientSocketPoolManager::max_sockets_per_group()));
+
// This is observed by ChildProcessSecurityPolicy, which lives in content/
// though, so it can't register itself.
local_state_->RegisterListPref(prefs::kDisabledSchemes);
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/policy/configuration_policy_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698