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

Side by Side Diff: chrome/browser/browser_main.cc

Issue 6317004: Feature to disable field trials in old versions of Chromium. Field trials... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // This is an A/B test for the maximum number of persistent connections per 224 // This is an A/B test for the maximum number of persistent connections per
225 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari 225 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari
226 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to 226 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to
227 // run faster) uses 8. We would like to see how much of an effect this value has 227 // run faster) uses 8. We would like to see how much of an effect this value has
228 // on browsing. Too large a value might cause us to run into SYN flood detection 228 // on browsing. Too large a value might cause us to run into SYN flood detection
229 // mechanisms. 229 // mechanisms.
230 void BrowserMainParts::ConnectionFieldTrial() { 230 void BrowserMainParts::ConnectionFieldTrial() {
231 const base::FieldTrial::Probability kConnectDivisor = 100; 231 const base::FieldTrial::Probability kConnectDivisor = 100;
232 const base::FieldTrial::Probability kConnectProbability = 1; // 1% prob. 232 const base::FieldTrial::Probability kConnectProbability = 1; // 1% prob.
233 233
234 // After June 30, 2011 builds, it will always be in default group.
234 scoped_refptr<base::FieldTrial> connect_trial( 235 scoped_refptr<base::FieldTrial> connect_trial(
235 new base::FieldTrial("ConnCountImpact", kConnectDivisor)); 236 new base::FieldTrial(
237 "ConnCountImpact", kConnectDivisor, "conn_count_6", 2011, 6, 30));
238
239 // This (6) is the current default value. Having this group declared here
240 // makes it straightforward to modify |kConnectProbability| such that the same
241 // probability value will be assigned to all the other groups, while
242 // preserving the remainder of the of probability space to the default value.
243 const int connect_6 = connect_trial->kDefaultGroupNumber;
236 244
237 const int connect_5 = connect_trial->AppendGroup("conn_count_5", 245 const int connect_5 = connect_trial->AppendGroup("conn_count_5",
238 kConnectProbability); 246 kConnectProbability);
239 const int connect_7 = connect_trial->AppendGroup("conn_count_7", 247 const int connect_7 = connect_trial->AppendGroup("conn_count_7",
240 kConnectProbability); 248 kConnectProbability);
241 const int connect_8 = connect_trial->AppendGroup("conn_count_8", 249 const int connect_8 = connect_trial->AppendGroup("conn_count_8",
242 kConnectProbability); 250 kConnectProbability);
243 const int connect_9 = connect_trial->AppendGroup("conn_count_9", 251 const int connect_9 = connect_trial->AppendGroup("conn_count_9",
244 kConnectProbability); 252 kConnectProbability);
245 // This (6) is the current default value. Having this group declared here
246 // makes it straightforward to modify |kConnectProbability| such that the same
247 // probability value will be assigned to all the other groups, while
248 // preserving the remainder of the of probability space to the default value.
249 const int connect_6 = connect_trial->AppendGroup("conn_count_6",
250 base::FieldTrial::kAllRemainingProbability);
251 253
252 const int connect_trial_group = connect_trial->group(); 254 const int connect_trial_group = connect_trial->group();
253 255
254 if (connect_trial_group == connect_5) { 256 if (connect_trial_group == connect_5) {
255 net::ClientSocketPoolManager::set_max_sockets_per_group(5); 257 net::ClientSocketPoolManager::set_max_sockets_per_group(5);
256 } else if (connect_trial_group == connect_6) { 258 } else if (connect_trial_group == connect_6) {
257 net::ClientSocketPoolManager::set_max_sockets_per_group(6); 259 net::ClientSocketPoolManager::set_max_sockets_per_group(6);
258 } else if (connect_trial_group == connect_7) { 260 } else if (connect_trial_group == connect_7) {
259 net::ClientSocketPoolManager::set_max_sockets_per_group(7); 261 net::ClientSocketPoolManager::set_max_sockets_per_group(7);
260 } else if (connect_trial_group == connect_8) { 262 } else if (connect_trial_group == connect_8) {
261 net::ClientSocketPoolManager::set_max_sockets_per_group(8); 263 net::ClientSocketPoolManager::set_max_sockets_per_group(8);
262 } else if (connect_trial_group == connect_9) { 264 } else if (connect_trial_group == connect_9) {
263 net::ClientSocketPoolManager::set_max_sockets_per_group(9); 265 net::ClientSocketPoolManager::set_max_sockets_per_group(9);
264 } else { 266 } else {
265 NOTREACHED(); 267 NOTREACHED();
266 } 268 }
267 } 269 }
268 270
269 // A/B test for determining a value for unused socket timeout. Currently the 271 // A/B test for determining a value for unused socket timeout. Currently the
270 // timeout defaults to 10 seconds. Having this value set too low won't allow us 272 // timeout defaults to 10 seconds. Having this value set too low won't allow us
271 // to take advantage of idle sockets. Setting it to too high could possibly 273 // to take advantage of idle sockets. Setting it to too high could possibly
272 // result in more ERR_CONNECT_RESETs, requiring one RTT to receive the RST 274 // result in more ERR_CONNECT_RESETs, requiring one RTT to receive the RST
273 // packet and possibly another RTT to re-establish the connection. 275 // packet and possibly another RTT to re-establish the connection.
274 void BrowserMainParts::SocketTimeoutFieldTrial() { 276 void BrowserMainParts::SocketTimeoutFieldTrial() {
275 const base::FieldTrial::Probability kIdleSocketTimeoutDivisor = 100; 277 const base::FieldTrial::Probability kIdleSocketTimeoutDivisor = 100;
276 // 1% probability for all experimental settings. 278 // 1% probability for all experimental settings.
277 const base::FieldTrial::Probability kSocketTimeoutProbability = 1; 279 const base::FieldTrial::Probability kSocketTimeoutProbability = 1;
278 280
281 // After June 30, 2011 builds, it will always be in default group.
279 scoped_refptr<base::FieldTrial> socket_timeout_trial( 282 scoped_refptr<base::FieldTrial> socket_timeout_trial(
280 new base::FieldTrial("IdleSktToImpact", kIdleSocketTimeoutDivisor)); 283 new base::FieldTrial("IdleSktToImpact", kIdleSocketTimeoutDivisor,
284 "idle_timeout_60", 2011, 6, 30));
285 const int socket_timeout_60 = socket_timeout_trial->kDefaultGroupNumber;
281 286
282 const int socket_timeout_5 = 287 const int socket_timeout_5 =
283 socket_timeout_trial->AppendGroup("idle_timeout_5", 288 socket_timeout_trial->AppendGroup("idle_timeout_5",
284 kSocketTimeoutProbability); 289 kSocketTimeoutProbability);
285 const int socket_timeout_10 = 290 const int socket_timeout_10 =
286 socket_timeout_trial->AppendGroup("idle_timeout_10", 291 socket_timeout_trial->AppendGroup("idle_timeout_10",
287 kSocketTimeoutProbability); 292 kSocketTimeoutProbability);
288 const int socket_timeout_20 = 293 const int socket_timeout_20 =
289 socket_timeout_trial->AppendGroup("idle_timeout_20", 294 socket_timeout_trial->AppendGroup("idle_timeout_20",
290 kSocketTimeoutProbability); 295 kSocketTimeoutProbability);
291 const int socket_timeout_60 =
292 socket_timeout_trial->AppendGroup("idle_timeout_60",
293 base::FieldTrial::kAllRemainingProbability);
294 296
295 const int idle_to_trial_group = socket_timeout_trial->group(); 297 const int idle_to_trial_group = socket_timeout_trial->group();
296 298
297 if (idle_to_trial_group == socket_timeout_5) { 299 if (idle_to_trial_group == socket_timeout_5) {
298 net::ClientSocketPool::set_unused_idle_socket_timeout(5); 300 net::ClientSocketPool::set_unused_idle_socket_timeout(5);
299 } else if (idle_to_trial_group == socket_timeout_10) { 301 } else if (idle_to_trial_group == socket_timeout_10) {
300 net::ClientSocketPool::set_unused_idle_socket_timeout(10); 302 net::ClientSocketPool::set_unused_idle_socket_timeout(10);
301 } else if (idle_to_trial_group == socket_timeout_20) { 303 } else if (idle_to_trial_group == socket_timeout_20) {
302 net::ClientSocketPool::set_unused_idle_socket_timeout(20); 304 net::ClientSocketPool::set_unused_idle_socket_timeout(20);
303 } else if (idle_to_trial_group == socket_timeout_60) { 305 } else if (idle_to_trial_group == socket_timeout_60) {
304 net::ClientSocketPool::set_unused_idle_socket_timeout(60); 306 net::ClientSocketPool::set_unused_idle_socket_timeout(60);
305 } else { 307 } else {
306 NOTREACHED(); 308 NOTREACHED();
307 } 309 }
308 } 310 }
309 311
310 void BrowserMainParts::ProxyConnectionsFieldTrial() { 312 void BrowserMainParts::ProxyConnectionsFieldTrial() {
311 const base::FieldTrial::Probability kProxyConnectionsDivisor = 100; 313 const base::FieldTrial::Probability kProxyConnectionsDivisor = 100;
312 // 25% probability 314 // 25% probability
313 const base::FieldTrial::Probability kProxyConnectionProbability = 1; 315 const base::FieldTrial::Probability kProxyConnectionProbability = 1;
314 316
317 // After June 30, 2011 builds, it will always be in default group.
315 scoped_refptr<base::FieldTrial> proxy_connection_trial( 318 scoped_refptr<base::FieldTrial> proxy_connection_trial(
316 new base::FieldTrial("ProxyConnectionImpact", kProxyConnectionsDivisor)); 319 new base::FieldTrial("ProxyConnectionImpact", kProxyConnectionsDivisor,
320 "proxy_connections_32", 2011, 6, 30));
321
322 // This (32 connections per proxy server) is the current default value.
323 // Declaring it here allows us to easily re-assign the probability space while
324 // maintaining that the default group always has the remainder of the "share",
325 // which allows for cleaner and quicker changes down the line if needed.
326 const int proxy_connections_32 = proxy_connection_trial->kDefaultGroupNumber;
317 327
318 // The number of max sockets per group cannot be greater than the max number 328 // The number of max sockets per group cannot be greater than the max number
319 // of sockets per proxy server. We tried using 8, and it can easily 329 // of sockets per proxy server. We tried using 8, and it can easily
320 // lead to total browser stalls. 330 // lead to total browser stalls.
321 const int proxy_connections_16 = 331 const int proxy_connections_16 =
322 proxy_connection_trial->AppendGroup("proxy_connections_16", 332 proxy_connection_trial->AppendGroup("proxy_connections_16",
323 kProxyConnectionProbability); 333 kProxyConnectionProbability);
324 const int proxy_connections_64 = 334 const int proxy_connections_64 =
325 proxy_connection_trial->AppendGroup("proxy_connections_64", 335 proxy_connection_trial->AppendGroup("proxy_connections_64",
326 kProxyConnectionProbability); 336 kProxyConnectionProbability);
327 337
328 // This (32 connections per proxy server) is the current default value.
329 // Declaring it here allows us to easily re-assign the probability space while
330 // maintaining that the default group always has the remainder of the "share",
331 // which allows for cleaner and quicker changes down the line if needed.
332 const int proxy_connections_32 =
333 proxy_connection_trial->AppendGroup("proxy_connections_32",
334 base::FieldTrial::kAllRemainingProbability);
335
336 const int proxy_connections_trial_group = proxy_connection_trial->group(); 338 const int proxy_connections_trial_group = proxy_connection_trial->group();
337 339
338 if (proxy_connections_trial_group == proxy_connections_16) { 340 if (proxy_connections_trial_group == proxy_connections_16) {
339 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(16); 341 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(16);
340 } else if (proxy_connections_trial_group == proxy_connections_32) { 342 } else if (proxy_connections_trial_group == proxy_connections_32) {
341 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(32); 343 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(32);
342 } else if (proxy_connections_trial_group == proxy_connections_64) { 344 } else if (proxy_connections_trial_group == proxy_connections_64) {
343 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(64); 345 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server(64);
344 } else { 346 } else {
345 NOTREACHED(); 347 NOTREACHED();
(...skipping 10 matching lines...) Expand all
356 void BrowserMainParts::SpdyFieldTrial() { 358 void BrowserMainParts::SpdyFieldTrial() {
357 bool is_spdy_trial = false; 359 bool is_spdy_trial = false;
358 if (parsed_command_line().HasSwitch(switches::kUseSpdy)) { 360 if (parsed_command_line().HasSwitch(switches::kUseSpdy)) {
359 std::string spdy_mode = 361 std::string spdy_mode =
360 parsed_command_line().GetSwitchValueASCII(switches::kUseSpdy); 362 parsed_command_line().GetSwitchValueASCII(switches::kUseSpdy);
361 net::HttpNetworkLayer::EnableSpdy(spdy_mode); 363 net::HttpNetworkLayer::EnableSpdy(spdy_mode);
362 } else { 364 } else {
363 const base::FieldTrial::Probability kSpdyDivisor = 100; 365 const base::FieldTrial::Probability kSpdyDivisor = 100;
364 // 10% to preclude SPDY. 366 // 10% to preclude SPDY.
365 base::FieldTrial::Probability npnhttp_probability = 10; 367 base::FieldTrial::Probability npnhttp_probability = 10;
368
369 // After June 30, 2011 builds, it will always be in default group.
366 scoped_refptr<base::FieldTrial> trial( 370 scoped_refptr<base::FieldTrial> trial(
367 new base::FieldTrial("SpdyImpact", kSpdyDivisor)); 371 new base::FieldTrial(
372 "SpdyImpact", kSpdyDivisor, "npn_with_spdy", 2011, 6, 30));
373
374 // npn with spdy support is the default.
375 int npn_spdy_grp = trial->kDefaultGroupNumber;
376
368 // npn with only http support, no spdy. 377 // npn with only http support, no spdy.
369 int npn_http_grp = trial->AppendGroup("npn_with_http", npnhttp_probability); 378 int npn_http_grp = trial->AppendGroup("npn_with_http", npnhttp_probability);
370 // npn with spdy support. 379
371 int npn_spdy_grp = trial->AppendGroup("npn_with_spdy",
372 base::FieldTrial::kAllRemainingProbability);
373 int trial_grp = trial->group(); 380 int trial_grp = trial->group();
374 if (trial_grp == npn_http_grp) { 381 if (trial_grp == npn_http_grp) {
375 is_spdy_trial = true; 382 is_spdy_trial = true;
376 net::HttpNetworkLayer::EnableSpdy("npn-http"); 383 net::HttpNetworkLayer::EnableSpdy("npn-http");
377 } else if (trial_grp == npn_spdy_grp) { 384 } else if (trial_grp == npn_spdy_grp) {
378 is_spdy_trial = true; 385 is_spdy_trial = true;
379 net::HttpNetworkLayer::EnableSpdy("npn"); 386 net::HttpNetworkLayer::EnableSpdy("npn");
380 } else { 387 } else {
381 CHECK(!is_spdy_trial); 388 CHECK(!is_spdy_trial);
382 } 389 }
383 } 390 }
384 391
385 // Setup SPDY CWND Field trial. 392 // Setup SPDY CWND Field trial.
386 const base::FieldTrial::Probability kSpdyCwndDivisor = 100; 393 const base::FieldTrial::Probability kSpdyCwndDivisor = 100;
387 const base::FieldTrial::Probability kSpdyCwnd32 = 20; // fixed at 32 394 const base::FieldTrial::Probability kSpdyCwnd32 = 20; // fixed at 32
388 const base::FieldTrial::Probability kSpdyCwnd16 = 20; // fixed at 16 395 const base::FieldTrial::Probability kSpdyCwnd16 = 20; // fixed at 16
389 const base::FieldTrial::Probability kSpdyCwndMin16 = 20; // no less than 16 396 const base::FieldTrial::Probability kSpdyCwndMin16 = 20; // no less than 16
390 const base::FieldTrial::Probability kSpdyCwndMin10 = 20; // no less than 10 397 const base::FieldTrial::Probability kSpdyCwndMin10 = 20; // no less than 10
398
399 // After June 30, 2011 builds, it will always be in default group
400 // (cwndDynamic).
391 scoped_refptr<base::FieldTrial> trial( 401 scoped_refptr<base::FieldTrial> trial(
392 new base::FieldTrial("SpdyCwnd", kSpdyCwndDivisor)); 402 new base::FieldTrial(
403 "SpdyCwnd", kSpdyCwndDivisor, "cwndDynamic", 2011, 6, 30));
404
393 trial->AppendGroup("cwnd32", kSpdyCwnd32); 405 trial->AppendGroup("cwnd32", kSpdyCwnd32);
394 trial->AppendGroup("cwnd16", kSpdyCwnd16); 406 trial->AppendGroup("cwnd16", kSpdyCwnd16);
395 trial->AppendGroup("cwndMin16", kSpdyCwndMin16); 407 trial->AppendGroup("cwndMin16", kSpdyCwndMin16);
396 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); 408 trial->AppendGroup("cwndMin10", kSpdyCwndMin10);
397 trial->AppendGroup("cwndDynamic",
398 base::FieldTrial::kAllRemainingProbability);
399 409
400 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { 410 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) {
401 int value = 0; 411 int value = 0;
402 base::StringToInt(parsed_command_line().GetSwitchValueASCII( 412 base::StringToInt(parsed_command_line().GetSwitchValueASCII(
403 switches::kMaxSpdyConcurrentStreams), 413 switches::kMaxSpdyConcurrentStreams),
404 &value); 414 &value);
405 if (value > 0) 415 if (value > 0)
406 net::SpdySession::set_max_concurrent_streams(value); 416 net::SpdySession::set_max_concurrent_streams(value);
407 } 417 }
408 } 418 }
409 419
410 // If any of --enable-prerender, --enable-content-prefetch or 420 // If any of --enable-prerender, --enable-content-prefetch or
411 // --disable-content-prefetch are set, use those to determine if 421 // --disable-content-prefetch are set, use those to determine if
412 // prefetch is enabled. Otherwise, randomly assign users to an A/B test for 422 // prefetch is enabled. Otherwise, randomly assign users to an A/B test for
413 // prefetching. 423 // prefetching.
414 void BrowserMainParts::PrefetchFieldTrial() { 424 void BrowserMainParts::PrefetchFieldTrial() {
415 if (parsed_command_line().HasSwitch(switches::kEnableContentPrefetch) || 425 if (parsed_command_line().HasSwitch(switches::kEnableContentPrefetch) ||
416 parsed_command_line().HasSwitch(switches::kEnablePagePrerender)) 426 parsed_command_line().HasSwitch(switches::kEnablePagePrerender))
417 ResourceDispatcherHost::set_is_prefetch_enabled(true); 427 ResourceDispatcherHost::set_is_prefetch_enabled(true);
418 else if (parsed_command_line().HasSwitch(switches::kDisableContentPrefetch)) { 428 else if (parsed_command_line().HasSwitch(switches::kDisableContentPrefetch)) {
419 ResourceDispatcherHost::set_is_prefetch_enabled(false); 429 ResourceDispatcherHost::set_is_prefetch_enabled(false);
420 } else { 430 } else {
421 const base::FieldTrial::Probability kPrefetchDivisor = 1000; 431 const base::FieldTrial::Probability kPrefetchDivisor = 1000;
422 const base::FieldTrial::Probability no_prefetch_probability = 500; 432 const base::FieldTrial::Probability no_prefetch_probability = 500;
433 // After June 30, 2011 builds, it will always be in default group.
423 scoped_refptr<base::FieldTrial> trial( 434 scoped_refptr<base::FieldTrial> trial(
424 new base::FieldTrial("Prefetch", kPrefetchDivisor)); 435 new base::FieldTrial("Prefetch", kPrefetchDivisor,
436 "ContentPrefetchEnabled", 2011, 6, 30));
437 const int yes_prefetch_grp = trial->kDefaultGroupNumber;
425 trial->AppendGroup("ContentPrefetchDisabled", no_prefetch_probability); 438 trial->AppendGroup("ContentPrefetchDisabled", no_prefetch_probability);
426 const int yes_prefetch_grp =
427 trial->AppendGroup("ContentPrefetchEnabled",
428 base::FieldTrial::kAllRemainingProbability);
429 const int trial_grp = trial->group(); 439 const int trial_grp = trial->group();
430 ResourceDispatcherHost::set_is_prefetch_enabled( 440 ResourceDispatcherHost::set_is_prefetch_enabled(
431 trial_grp == yes_prefetch_grp); 441 trial_grp == yes_prefetch_grp);
432 } 442 }
433 } 443 }
434 444
435 // If neither --enable-connect-backup-jobs or --disable-connect-backup-jobs is 445 // If neither --enable-connect-backup-jobs or --disable-connect-backup-jobs is
436 // specified, run an A/B test for automatically establishing backup TCP 446 // specified, run an A/B test for automatically establishing backup TCP
437 // connections when a certain timeout value is exceeded. 447 // connections when a certain timeout value is exceeded.
438 void BrowserMainParts::ConnectBackupJobsFieldTrial() { 448 void BrowserMainParts::ConnectBackupJobsFieldTrial() {
439 if (parsed_command_line().HasSwitch(switches::kEnableConnectBackupJobs)) { 449 if (parsed_command_line().HasSwitch(switches::kEnableConnectBackupJobs)) {
440 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( 450 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(
441 true); 451 true);
442 } else if (parsed_command_line().HasSwitch( 452 } else if (parsed_command_line().HasSwitch(
443 switches::kDisableConnectBackupJobs)) { 453 switches::kDisableConnectBackupJobs)) {
444 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( 454 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(
445 false); 455 false);
446 } else { 456 } else {
447 const base::FieldTrial::Probability kConnectBackupJobsDivisor = 100; 457 const base::FieldTrial::Probability kConnectBackupJobsDivisor = 100;
448 // 1% probability. 458 // 1% probability.
449 const base::FieldTrial::Probability kConnectBackupJobsProbability = 1; 459 const base::FieldTrial::Probability kConnectBackupJobsProbability = 1;
460 // After June 30, 2011 builds, it will always be in defaut group.
450 scoped_refptr<base::FieldTrial> trial( 461 scoped_refptr<base::FieldTrial> trial(
451 new base::FieldTrial("ConnnectBackupJobs", 462 new base::FieldTrial("ConnnectBackupJobs",
452 kConnectBackupJobsDivisor)); 463 kConnectBackupJobsDivisor, "ConnectBackupJobsEnabled", 2011, 6,
464 30));
465 const int connect_backup_jobs_enabled = trial->kDefaultGroupNumber;
453 trial->AppendGroup("ConnectBackupJobsDisabled", 466 trial->AppendGroup("ConnectBackupJobsDisabled",
454 kConnectBackupJobsProbability); 467 kConnectBackupJobsProbability);
455 const int connect_backup_jobs_enabled =
456 trial->AppendGroup("ConnectBackupJobsEnabled",
457 base::FieldTrial::kAllRemainingProbability);
458 const int trial_group = trial->group(); 468 const int trial_group = trial->group();
459 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( 469 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(
460 trial_group == connect_backup_jobs_enabled); 470 trial_group == connect_backup_jobs_enabled);
461 } 471 }
462 } 472 }
463 473
464 // BrowserMainParts: |MainMessageLoopStart()| and related ---------------------- 474 // BrowserMainParts: |MainMessageLoopStart()| and related ----------------------
465 475
466 void BrowserMainParts::MainMessageLoopStart() { 476 void BrowserMainParts::MainMessageLoopStart() {
467 PreMainMessageLoopStart(); 477 PreMainMessageLoopStart();
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 1534
1525 // Do initialize the plug-in service (and related preferences). 1535 // Do initialize the plug-in service (and related preferences).
1526 PluginService::InitGlobalInstance(profile); 1536 PluginService::InitGlobalInstance(profile);
1527 1537
1528 // Prepare for memory caching of SDCH dictionaries. 1538 // Prepare for memory caching of SDCH dictionaries.
1529 // Perform A/B test to measure global impact of SDCH support. 1539 // Perform A/B test to measure global impact of SDCH support.
1530 // Set up a field trial to see what disabling SDCH does to latency of page 1540 // Set up a field trial to see what disabling SDCH does to latency of page
1531 // layout globally. 1541 // layout globally.
1532 base::FieldTrial::Probability kSDCH_DIVISOR = 1000; 1542 base::FieldTrial::Probability kSDCH_DIVISOR = 1000;
1533 base::FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 1; // 0.1% prob. 1543 base::FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 1; // 0.1% prob.
1544 // After June 30, 2011 builds, it will always be in default group.
1534 scoped_refptr<base::FieldTrial> sdch_trial( 1545 scoped_refptr<base::FieldTrial> sdch_trial(
1535 new base::FieldTrial("GlobalSdch", kSDCH_DIVISOR)); 1546 new base::FieldTrial("GlobalSdch", kSDCH_DIVISOR, "global_enable_sdch",
1547 2011, 6, 30));
1548 int sdch_enabled = sdch_trial->kDefaultGroupNumber;
1536 1549
1537 // Use default of "" so that all domains are supported. 1550 // Use default of "" so that all domains are supported.
1538 std::string sdch_supported_domain(""); 1551 std::string sdch_supported_domain("");
1539 if (parsed_command_line.HasSwitch(switches::kSdchFilter)) { 1552 if (parsed_command_line.HasSwitch(switches::kSdchFilter)) {
1540 sdch_supported_domain = 1553 sdch_supported_domain =
1541 parsed_command_line.GetSwitchValueASCII(switches::kSdchFilter); 1554 parsed_command_line.GetSwitchValueASCII(switches::kSdchFilter);
1542 } else { 1555 } else {
1543 sdch_trial->AppendGroup("global_disable_sdch", 1556 sdch_trial->AppendGroup("global_disable_sdch",
1544 kSDCH_DISABLE_PROBABILITY); 1557 kSDCH_DISABLE_PROBABILITY);
1545 int sdch_enabled = sdch_trial->AppendGroup("global_enable_sdch",
1546 base::FieldTrial::kAllRemainingProbability);
1547 if (sdch_enabled != sdch_trial->group()) 1558 if (sdch_enabled != sdch_trial->group())
1548 sdch_supported_domain = "never_enabled_sdch_for_any_domain"; 1559 sdch_supported_domain = "never_enabled_sdch_for_any_domain";
1549 } 1560 }
1550 1561
1551 SdchManager sdch_manager; // Singleton database. 1562 SdchManager sdch_manager; // Singleton database.
1552 sdch_manager.set_sdch_fetcher(new SdchDictionaryFetcher); 1563 sdch_manager.set_sdch_fetcher(new SdchDictionaryFetcher);
1553 sdch_manager.EnableSdchSupport(sdch_supported_domain); 1564 sdch_manager.EnableSdchSupport(sdch_supported_domain);
1554 1565
1555 MetricsService* metrics = InitializeMetrics(parsed_command_line, local_state); 1566 MetricsService* metrics = InitializeMetrics(parsed_command_line, local_state);
1556 InstallJankometer(parsed_command_line); 1567 InstallJankometer(parsed_command_line);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 #if defined(OS_CHROMEOS) 1746 #if defined(OS_CHROMEOS)
1736 // To be precise, logout (browser shutdown) is not yet done, but the 1747 // To be precise, logout (browser shutdown) is not yet done, but the
1737 // remaining work is negligible, hence we say LogoutDone here. 1748 // remaining work is negligible, hence we say LogoutDone here.
1738 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", 1749 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone",
1739 false); 1750 false);
1740 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); 1751 chromeos::BootTimesLoader::Get()->WriteLogoutTimes();
1741 #endif 1752 #endif
1742 TRACE_EVENT_END("BrowserMain", 0, 0); 1753 TRACE_EVENT_END("BrowserMain", 0, 0);
1743 return result_code; 1754 return result_code;
1744 } 1755 }
OLDNEW
« no previous file with comments | « base/metrics/field_trial_unittest.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698