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

Side by Side 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: Moved setting that policy to a really early point in the initialization of the system. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "content/browser/debugger/browser_list_tabcontents_provider.h" 70 #include "content/browser/debugger/browser_list_tabcontents_provider.h"
71 #include "content/browser/debugger/devtools_http_protocol_handler.h" 71 #include "content/browser/debugger/devtools_http_protocol_handler.h"
72 #include "content/browser/debugger/devtools_manager.h" 72 #include "content/browser/debugger/devtools_manager.h"
73 #include "content/browser/debugger/devtools_protocol_handler.h" 73 #include "content/browser/debugger/devtools_protocol_handler.h"
74 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 74 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
75 #include "content/browser/plugin_service.h" 75 #include "content/browser/plugin_service.h"
76 #include "content/browser/renderer_host/render_process_host.h" 76 #include "content/browser/renderer_host/render_process_host.h"
77 #include "content/browser/renderer_host/resource_dispatcher_host.h" 77 #include "content/browser/renderer_host/resource_dispatcher_host.h"
78 #include "content/common/notification_service.h" 78 #include "content/common/notification_service.h"
79 #include "ipc/ipc_logging.h" 79 #include "ipc/ipc_logging.h"
80 #include "net/socket/client_socket_pool_manager.h"
80 #include "net/url_request/url_request_context_getter.h" 81 #include "net/url_request/url_request_context_getter.h"
81 #include "ui/base/clipboard/clipboard.h" 82 #include "ui/base/clipboard/clipboard.h"
82 #include "ui/base/l10n/l10n_util.h" 83 #include "ui/base/l10n/l10n_util.h"
83 #include "webkit/database/database_tracker.h" 84 #include "webkit/database/database_tracker.h"
84 #include "webkit/plugins/npapi/plugin_list.h" 85 #include "webkit/plugins/npapi/plugin_list.h"
85 86
86 #if defined(OS_WIN) 87 #if defined(OS_WIN)
87 #include "views/focus/view_storage.h" 88 #include "views/focus/view_storage.h"
88 #endif 89 #endif
89 90
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 // This preference is only needed on the IO thread so make it available there. 883 // This preference is only needed on the IO thread so make it available there.
883 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder, false); 884 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder, false);
884 plugin_finder_disabled_pref_.Init(prefs::kDisablePluginFinder, 885 plugin_finder_disabled_pref_.Init(prefs::kDisablePluginFinder,
885 local_state_.get(), NULL); 886 local_state_.get(), NULL);
886 plugin_finder_disabled_pref_.MoveToThread(BrowserThread::IO); 887 plugin_finder_disabled_pref_.MoveToThread(BrowserThread::IO);
887 888
888 // Initialize the disk cache location policy. This policy is not hot update- 889 // Initialize the disk cache location policy. This policy is not hot update-
889 // able so we need to have it when initializing the profiles. 890 // able so we need to have it when initializing the profiles.
890 local_state_->RegisterFilePathPref(prefs::kDiskCacheDir, FilePath()); 891 local_state_->RegisterFilePathPref(prefs::kDiskCacheDir, FilePath());
891 892
893 // Another policy that needs to be defined before the net subsystem is
894 // initialized is MaxConnectionsPerProxy so we do it here.
895 local_state_->RegisterIntegerPref(prefs::kMaxConnectionsPerProxy,
896 net::kDefaultMaxSocketsPerProxyServer);
897 int max_per_proxy = local_state_->GetInteger(prefs::kMaxConnectionsPerProxy);
898 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(
899 std::max(std::min(max_per_proxy, 100),
pastarmovj 2011/07/08 10:49:39 Made the max 99 because the docu says lower than 1
900 net::ClientSocketPoolManager::max_sockets_per_group()));
901
892 // This is observed by ChildProcessSecurityPolicy, which lives in content/ 902 // This is observed by ChildProcessSecurityPolicy, which lives in content/
893 // though, so it can't register itself. 903 // though, so it can't register itself.
894 local_state_->RegisterListPref(prefs::kDisabledSchemes); 904 local_state_->RegisterListPref(prefs::kDisabledSchemes);
895 pref_change_registrar_.Add(prefs::kDisabledSchemes, this); 905 pref_change_registrar_.Add(prefs::kDisabledSchemes, this);
896 ApplyDisabledSchemesPolicy(); 906 ApplyDisabledSchemesPolicy();
897 } 907 }
898 908
899 void BrowserProcessImpl::CreateIconManager() { 909 void BrowserProcessImpl::CreateIconManager() {
900 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); 910 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL);
901 created_icon_manager_ = true; 911 created_icon_manager_ = true;
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1118 }
1109 1119
1110 void BrowserProcessImpl::OnAutoupdateTimer() { 1120 void BrowserProcessImpl::OnAutoupdateTimer() {
1111 if (CanAutorestartForUpdate()) { 1121 if (CanAutorestartForUpdate()) {
1112 DLOG(WARNING) << "Detected update. Restarting browser."; 1122 DLOG(WARNING) << "Detected update. Restarting browser.";
1113 RestartPersistentInstance(); 1123 RestartPersistentInstance();
1114 } 1124 }
1115 } 1125 }
1116 1126
1117 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1127 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698