OLD | NEW |
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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 kConnectProbability); | 653 kConnectProbability); |
654 const int connect_7 = connect_trial->AppendGroup("conn_count_7", | 654 const int connect_7 = connect_trial->AppendGroup("conn_count_7", |
655 kConnectProbability); | 655 kConnectProbability); |
656 const int connect_8 = connect_trial->AppendGroup("conn_count_8", | 656 const int connect_8 = connect_trial->AppendGroup("conn_count_8", |
657 kConnectProbability); | 657 kConnectProbability); |
658 const int connect_9 = connect_trial->AppendGroup("conn_count_9", | 658 const int connect_9 = connect_trial->AppendGroup("conn_count_9", |
659 kConnectProbability); | 659 kConnectProbability); |
660 | 660 |
661 const int connect_trial_group = connect_trial->group(); | 661 const int connect_trial_group = connect_trial->group(); |
662 | 662 |
| 663 int max_sockets = 0; |
663 if (connect_trial_group == connect_5) { | 664 if (connect_trial_group == connect_5) { |
664 net::ClientSocketPoolManager::set_max_sockets_per_group(5); | 665 max_sockets = 5; |
665 } else if (connect_trial_group == connect_6) { | 666 } else if (connect_trial_group == connect_6) { |
666 net::ClientSocketPoolManager::set_max_sockets_per_group(6); | 667 max_sockets = 6; |
667 } else if (connect_trial_group == connect_7) { | 668 } else if (connect_trial_group == connect_7) { |
668 net::ClientSocketPoolManager::set_max_sockets_per_group(7); | 669 max_sockets = 7; |
669 } else if (connect_trial_group == connect_8) { | 670 } else if (connect_trial_group == connect_8) { |
670 net::ClientSocketPoolManager::set_max_sockets_per_group(8); | 671 max_sockets = 8; |
671 } else if (connect_trial_group == connect_9) { | 672 } else if (connect_trial_group == connect_9) { |
672 net::ClientSocketPoolManager::set_max_sockets_per_group(9); | 673 max_sockets = 9; |
673 } else { | 674 } else { |
674 NOTREACHED(); | 675 NOTREACHED(); |
675 } | 676 } |
| 677 net::ClientSocketPoolManager::set_max_sockets_per_group( |
| 678 net::HttpNetworkSession::NORMAL_SOCKET_POOL, max_sockets); |
676 } | 679 } |
677 | 680 |
678 // A/B test for determining a value for unused socket timeout. Currently the | 681 // A/B test for determining a value for unused socket timeout. Currently the |
679 // timeout defaults to 10 seconds. Having this value set too low won't allow us | 682 // timeout defaults to 10 seconds. Having this value set too low won't allow us |
680 // to take advantage of idle sockets. Setting it to too high could possibly | 683 // to take advantage of idle sockets. Setting it to too high could possibly |
681 // result in more ERR_CONNECTION_RESETs, since some servers will kill a socket | 684 // result in more ERR_CONNECTION_RESETs, since some servers will kill a socket |
682 // before we time it out. Since these are "unused" sockets, we won't retry the | 685 // before we time it out. Since these are "unused" sockets, we won't retry the |
683 // connection and instead show an error to the user. So we need to be | 686 // connection and instead show an error to the user. So we need to be |
684 // conservative here. We've seen that some servers will close the socket after | 687 // conservative here. We've seen that some servers will close the socket after |
685 // as short as 10 seconds. See http://crbug.com/84313 for more details. | 688 // as short as 10 seconds. See http://crbug.com/84313 for more details. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 // lead to total browser stalls. | 741 // lead to total browser stalls. |
739 const int proxy_connections_16 = | 742 const int proxy_connections_16 = |
740 proxy_connection_trial->AppendGroup("proxy_connections_16", | 743 proxy_connection_trial->AppendGroup("proxy_connections_16", |
741 kProxyConnectionProbability); | 744 kProxyConnectionProbability); |
742 const int proxy_connections_64 = | 745 const int proxy_connections_64 = |
743 proxy_connection_trial->AppendGroup("proxy_connections_64", | 746 proxy_connection_trial->AppendGroup("proxy_connections_64", |
744 kProxyConnectionProbability); | 747 kProxyConnectionProbability); |
745 | 748 |
746 const int proxy_connections_trial_group = proxy_connection_trial->group(); | 749 const int proxy_connections_trial_group = proxy_connection_trial->group(); |
747 | 750 |
| 751 int max_sockets = 0; |
748 if (proxy_connections_trial_group == proxy_connections_16) { | 752 if (proxy_connections_trial_group == proxy_connections_16) { |
749 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(16); | 753 max_sockets = 16; |
750 } else if (proxy_connections_trial_group == proxy_connections_32) { | 754 } else if (proxy_connections_trial_group == proxy_connections_32) { |
751 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(32); | 755 max_sockets = 32; |
752 } else if (proxy_connections_trial_group == proxy_connections_64) { | 756 } else if (proxy_connections_trial_group == proxy_connections_64) { |
753 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(64); | 757 max_sockets = 64; |
754 } else { | 758 } else { |
755 NOTREACHED(); | 759 NOTREACHED(); |
756 } | 760 } |
| 761 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( |
| 762 net::HttpNetworkSession::NORMAL_SOCKET_POOL, max_sockets); |
757 } | 763 } |
758 | 764 |
759 // When --use-spdy not set, users will be in A/B test for spdy. | 765 // When --use-spdy not set, users will be in A/B test for spdy. |
760 // group A (npn_with_spdy): this means npn and spdy are enabled. In case server | 766 // group A (npn_with_spdy): this means npn and spdy are enabled. In case server |
761 // supports spdy, browser will use spdy. | 767 // supports spdy, browser will use spdy. |
762 // group B (npn_with_http): this means npn is enabled but spdy won't be used. | 768 // group B (npn_with_http): this means npn is enabled but spdy won't be used. |
763 // Http is still used for all requests. | 769 // Http is still used for all requests. |
764 // default group: no npn or spdy is involved. The "old" non-spdy | 770 // default group: no npn or spdy is involved. The "old" non-spdy |
765 // chrome behavior. | 771 // chrome behavior. |
766 void ChromeBrowserMainParts::SpdyFieldTrial() { | 772 void ChromeBrowserMainParts::SpdyFieldTrial() { |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1952 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1958 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1953 uma_name += "_XP"; | 1959 uma_name += "_XP"; |
1954 | 1960 |
1955 uma_name += "_PreRead_"; | 1961 uma_name += "_PreRead_"; |
1956 uma_name += pre_read_percentage; | 1962 uma_name += pre_read_percentage; |
1957 AddPreReadHistogramTime(uma_name.c_str(), time); | 1963 AddPreReadHistogramTime(uma_name.c_str(), time); |
1958 } | 1964 } |
1959 #endif | 1965 #endif |
1960 #endif | 1966 #endif |
1961 } | 1967 } |
OLD | NEW |