diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 07:10:24 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 07:10:24 +0000 |
commit | 9008c86f2a99b112300ef7833d35f2ff1696a88a (patch) | |
tree | 9ba3e6a50b61f76612f3db42b18e5f10ae6f364a /chrome/browser/browser_main.cc | |
parent | 6a054ffaae82f5ac8d6b876d7c85f0d87d892e42 (diff) | |
download | chromium_src-9008c86f2a99b112300ef7833d35f2ff1696a88a.zip chromium_src-9008c86f2a99b112300ef7833d35f2ff1696a88a.tar.gz chromium_src-9008c86f2a99b112300ef7833d35f2ff1696a88a.tar.bz2 |
Reland 54771 (and 54795) To enable TCP Preconnection by default
I pulled out the code to update the socket connectivity stats.
I added defensive code which should preclude the crash that
was reported on the stability bot.
I added a second call to update the stats from
~ClientSocketHandle to ensure that we updated the
related ClientSocket when we are torn down.
As noted in the original checkin:
Enable speculative preconnection by default
Added histogram to track preconnection utilization (vs waste).
BUG=42694
r=mbelshe
Review URL: http://codereview.chromium.org/3050040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r-- | chrome/browser/browser_main.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 1f95c1f5..7c35799 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -1205,10 +1205,15 @@ int BrowserMain(const MainFunctionParams& parameters) { // pre-resolution, as well as TCP/IP connection pre-warming. // This also registers an observer to discard data when closing incognito // mode. + bool preconnect_enabled = true; // Default status (easy to change!). + if (parsed_command_line.HasSwitch(switches::kDisablePreconnect)) + preconnect_enabled = false; + else if (parsed_command_line.HasSwitch(switches::kEnablePreconnect)) + preconnect_enabled = true; chrome_browser_net::PredictorInit dns_prefetch( user_prefs, local_state, - parsed_command_line.HasSwitch(switches::kEnablePreconnect), + preconnect_enabled, parsed_command_line.HasSwitch(switches::kPreconnectDespiteProxy)); #if defined(OS_WIN) |