| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_main.h" | 5 #include "chrome/browser/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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 PostEarlyInitialization(); | 168 PostEarlyInitialization(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 // This is an A/B test for the maximum number of persistent connections per | 171 // This is an A/B test for the maximum number of persistent connections per |
| 172 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari | 172 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari |
| 173 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to | 173 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to |
| 174 // run faster) uses 8. We would like to see how much of an effect this value has | 174 // run faster) uses 8. We would like to see how much of an effect this value has |
| 175 // on browsing. Too large a value might cause us to run into SYN flood detection | 175 // on browsing. Too large a value might cause us to run into SYN flood detection |
| 176 // mechanisms. | 176 // mechanisms. |
| 177 void BrowserMainParts::ConnectionFieldTrial() { | 177 void BrowserMainParts::ConnectionFieldTrial() { |
| 178 const FieldTrial::Probability kConnectDivisor = 100; | 178 const FieldTrial::Probability kConnectDivisor = 1000; |
| 179 const FieldTrial::Probability kConnectProbability = 20; // 20% probability | 179 const FieldTrial::Probability kConnectProbability = 20; // 2% probability |
| 180 | 180 |
| 181 scoped_refptr<FieldTrial> connect_trial = | 181 scoped_refptr<FieldTrial> connect_trial = |
| 182 new FieldTrial("ConnCountImpact", kConnectDivisor); | 182 new FieldTrial("ConnCountImpact", kConnectDivisor); |
| 183 | 183 |
| 184 const int connect_5 = connect_trial->AppendGroup("_conn_count_5", | 184 const int connect_5 = connect_trial->AppendGroup("_conn_count_5", |
| 185 kConnectProbability); | 185 kConnectProbability); |
| 186 const int connect_7 = connect_trial->AppendGroup("_conn_count_7", | 186 const int connect_7 = connect_trial->AppendGroup("_conn_count_7", |
| 187 kConnectProbability); | 187 kConnectProbability); |
| 188 const int connect_8 = connect_trial->AppendGroup("_conn_count_8", | 188 const int connect_8 = connect_trial->AppendGroup("_conn_count_8", |
| 189 kConnectProbability); | 189 kConnectProbability); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 212 NOTREACHED(); | 212 NOTREACHED(); |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 | 215 |
| 216 // A/B test for determining a value for unused socket timeout. Currently the | 216 // A/B test for determining a value for unused socket timeout. Currently the |
| 217 // timeout defaults to 10 seconds. Having this value set too low won't allow us | 217 // timeout defaults to 10 seconds. Having this value set too low won't allow us |
| 218 // to take advantage of idle sockets. Setting it to too high could possibly | 218 // to take advantage of idle sockets. Setting it to too high could possibly |
| 219 // result in more ERR_CONNECT_RESETs, requiring one RTT to receive the RST | 219 // result in more ERR_CONNECT_RESETs, requiring one RTT to receive the RST |
| 220 // packet and possibly another RTT to re-establish the connection. | 220 // packet and possibly another RTT to re-establish the connection. |
| 221 void BrowserMainParts::SocketTimeoutFieldTrial() { | 221 void BrowserMainParts::SocketTimeoutFieldTrial() { |
| 222 const FieldTrial::Probability kIdleSocketTimeoutDivisor = 100; | 222 const FieldTrial::Probability kIdleSocketTimeoutDivisor = 1000; |
| 223 // 25% probability | 223 // 2.5% probability |
| 224 const FieldTrial::Probability kSocketTimeoutProbability = 25; | 224 const FieldTrial::Probability kSocketTimeoutProbability = 25; |
| 225 | 225 |
| 226 scoped_refptr<FieldTrial> socket_timeout_trial = | 226 scoped_refptr<FieldTrial> socket_timeout_trial = |
| 227 new FieldTrial("IdleSktToImpact", kIdleSocketTimeoutDivisor); | 227 new FieldTrial("IdleSktToImpact", kIdleSocketTimeoutDivisor); |
| 228 | 228 |
| 229 const int socket_timeout_5 = | 229 const int socket_timeout_5 = |
| 230 socket_timeout_trial->AppendGroup("_idle_timeout_5", | 230 socket_timeout_trial->AppendGroup("_idle_timeout_5", |
| 231 kSocketTimeoutProbability); | 231 kSocketTimeoutProbability); |
| 232 const int socket_timeout_20 = | 232 const int socket_timeout_20 = |
| 233 socket_timeout_trial->AppendGroup("_idle_timeout_20", | 233 socket_timeout_trial->AppendGroup("_idle_timeout_20", |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 | 1265 |
| 1266 metrics->Stop(); | 1266 metrics->Stop(); |
| 1267 | 1267 |
| 1268 // browser_shutdown takes care of deleting browser_process, so we need to | 1268 // browser_shutdown takes care of deleting browser_process, so we need to |
| 1269 // release it. | 1269 // release it. |
| 1270 ignore_result(browser_process.release()); | 1270 ignore_result(browser_process.release()); |
| 1271 browser_shutdown::Shutdown(); | 1271 browser_shutdown::Shutdown(); |
| 1272 | 1272 |
| 1273 return result_code; | 1273 return result_code; |
| 1274 } | 1274 } |
| OLD | NEW |