| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 #endif // defined(OS_WIN) | 610 #endif // defined(OS_WIN) |
| 611 | 611 |
| 612 // Initialize FieldTrialList to support FieldTrials that use one-time | 612 // Initialize FieldTrialList to support FieldTrials that use one-time |
| 613 // randomization. The client ID will be empty if the user has not opted | 613 // randomization. The client ID will be empty if the user has not opted |
| 614 // to send metrics. | 614 // to send metrics. |
| 615 MetricsService* metrics = browser_process_->metrics_service(); | 615 MetricsService* metrics = browser_process_->metrics_service(); |
| 616 if (IsMetricsReportingEnabled()) | 616 if (IsMetricsReportingEnabled()) |
| 617 metrics->ForceClientIdCreation(); // Needed below. | 617 metrics->ForceClientIdCreation(); // Needed below. |
| 618 field_trial_list_.reset(new base::FieldTrialList(metrics->GetClientId())); | 618 field_trial_list_.reset(new base::FieldTrialList(metrics->GetClientId())); |
| 619 | 619 |
| 620 // Ensure any field trials specified on the command line are initialized |
| 621 // and stop the metrics service so that we don't pollute UMA. |
| 622 #ifndef NDEBUG |
| 623 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 624 if (command_line->HasSwitch(switches::kForceFieldTestNameAndValue)) { |
| 625 std::string persistent = command_line->GetSwitchValueASCII( |
| 626 switches::kForceFieldTestNameAndValue); |
| 627 bool ret = base::FieldTrialList::CreateTrialsFromString(persistent); |
| 628 CHECK(ret) << "Invalid --" << switches::kForceFieldTestNameAndValue << |
| 629 " list specified."; |
| 630 metrics->Stop(); |
| 631 } |
| 632 #endif // NDEBUG |
| 633 |
| 620 SetupFieldTrials(metrics->recording_active(), | 634 SetupFieldTrials(metrics->recording_active(), |
| 621 local_state_->IsManagedPreference( | 635 local_state_->IsManagedPreference( |
| 622 prefs::kMaxConnectionsPerProxy)); | 636 prefs::kMaxConnectionsPerProxy)); |
| 623 | 637 |
| 624 // Initialize FieldTrialSynchronizer system. This is a singleton and is used | 638 // Initialize FieldTrialSynchronizer system. This is a singleton and is used |
| 625 // for posting tasks via base::Bind. Its deleted when it goes out of scope. | 639 // for posting tasks via base::Bind. Its deleted when it goes out of scope. |
| 626 // Even though base::Bind does AddRef and Release, the object will not be | 640 // Even though base::Bind does AddRef and Release, the object will not be |
| 627 // deleted after the Task is executed. | 641 // deleted after the Task is executed. |
| 628 field_trial_synchronizer_ = new FieldTrialSynchronizer(); | 642 field_trial_synchronizer_ = new FieldTrialSynchronizer(); |
| 629 } | 643 } |
| 630 | 644 |
| 631 // This is an A/B test for the maximum number of persistent connections per | 645 // This is an A/B test for the maximum number of persistent connections per |
| 632 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari | 646 // host. Currently Chrome, Firefox, and IE8 have this value set at 6. Safari |
| 633 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to | 647 // uses 4, and Fasterfox (a plugin for Firefox that supposedly configures it to |
| 634 // run faster) uses 8. We would like to see how much of an effect this value has | 648 // run faster) uses 8. We would like to see how much of an effect this value has |
| 635 // on browsing. Too large a value might cause us to run into SYN flood detection | 649 // on browsing. Too large a value might cause us to run into SYN flood detection |
| 636 // mechanisms. | 650 // mechanisms. |
| 637 void ChromeBrowserMainParts::ConnectionFieldTrial() { | 651 void ChromeBrowserMainParts::ConnectionFieldTrial() { |
| 638 const base::FieldTrial::Probability kConnectDivisor = 100; | 652 const base::FieldTrial::Probability kConnectDivisor = 100; |
| 639 const base::FieldTrial::Probability kConnectProbability = 1; // 1% prob. | 653 const base::FieldTrial::Probability kConnectProbability = 1; // 1% prob. |
| 640 | 654 |
| 641 // After June 30, 2011 builds, it will always be in default group. | 655 // After June 30, 2011 builds, it will always be in default group. |
| 642 scoped_refptr<base::FieldTrial> connect_trial( | 656 scoped_refptr<base::FieldTrial> connect_trial( |
| 643 new base::FieldTrial( | 657 base::FieldTrial::CreateInstance( |
| 644 "ConnCountImpact", kConnectDivisor, "conn_count_6", 2011, 6, 30)); | 658 "ConnCountImpact", kConnectDivisor, "conn_count_6", 2011, 6, 30)); |
| 645 | 659 |
| 646 // This (6) is the current default value. Having this group declared here | 660 // This (6) is the current default value. Having this group declared here |
| 647 // makes it straightforward to modify |kConnectProbability| such that the same | 661 // makes it straightforward to modify |kConnectProbability| such that the same |
| 648 // probability value will be assigned to all the other groups, while | 662 // probability value will be assigned to all the other groups, while |
| 649 // preserving the remainder of the of probability space to the default value. | 663 // preserving the remainder of the of probability space to the default value. |
| 650 const int connect_6 = connect_trial->kDefaultGroupNumber; | 664 const int connect_6 = connect_trial->kDefaultGroupNumber; |
| 651 | 665 |
| 652 const int connect_5 = connect_trial->AppendGroup("conn_count_5", | 666 const int connect_5 = connect_trial->AppendGroup("conn_count_5", |
| 653 kConnectProbability); | 667 kConnectProbability); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 // connection and instead show an error to the user. So we need to be | 700 // connection and instead show an error to the user. So we need to be |
| 687 // conservative here. We've seen that some servers will close the socket after | 701 // conservative here. We've seen that some servers will close the socket after |
| 688 // as short as 10 seconds. See http://crbug.com/84313 for more details. | 702 // as short as 10 seconds. See http://crbug.com/84313 for more details. |
| 689 void ChromeBrowserMainParts::SocketTimeoutFieldTrial() { | 703 void ChromeBrowserMainParts::SocketTimeoutFieldTrial() { |
| 690 const base::FieldTrial::Probability kIdleSocketTimeoutDivisor = 100; | 704 const base::FieldTrial::Probability kIdleSocketTimeoutDivisor = 100; |
| 691 // 1% probability for all experimental settings. | 705 // 1% probability for all experimental settings. |
| 692 const base::FieldTrial::Probability kSocketTimeoutProbability = 1; | 706 const base::FieldTrial::Probability kSocketTimeoutProbability = 1; |
| 693 | 707 |
| 694 // After June 30, 2011 builds, it will always be in default group. | 708 // After June 30, 2011 builds, it will always be in default group. |
| 695 scoped_refptr<base::FieldTrial> socket_timeout_trial( | 709 scoped_refptr<base::FieldTrial> socket_timeout_trial( |
| 696 new base::FieldTrial("IdleSktToImpact", kIdleSocketTimeoutDivisor, | 710 base::FieldTrial::CreateInstance( |
| 697 "idle_timeout_10", 2011, 6, 30)); | 711 "IdleSktToImpact", kIdleSocketTimeoutDivisor, "idle_timeout_10", |
| 712 2011, 6, 30)); |
| 698 const int socket_timeout_10 = socket_timeout_trial->kDefaultGroupNumber; | 713 const int socket_timeout_10 = socket_timeout_trial->kDefaultGroupNumber; |
| 699 | 714 |
| 700 const int socket_timeout_5 = | 715 const int socket_timeout_5 = |
| 701 socket_timeout_trial->AppendGroup("idle_timeout_5", | 716 socket_timeout_trial->AppendGroup("idle_timeout_5", |
| 702 kSocketTimeoutProbability); | 717 kSocketTimeoutProbability); |
| 703 const int socket_timeout_20 = | 718 const int socket_timeout_20 = |
| 704 socket_timeout_trial->AppendGroup("idle_timeout_20", | 719 socket_timeout_trial->AppendGroup("idle_timeout_20", |
| 705 kSocketTimeoutProbability); | 720 kSocketTimeoutProbability); |
| 706 | 721 |
| 707 const int idle_to_trial_group = socket_timeout_trial->group(); | 722 const int idle_to_trial_group = socket_timeout_trial->group(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 720 } | 735 } |
| 721 } | 736 } |
| 722 | 737 |
| 723 void ChromeBrowserMainParts::ProxyConnectionsFieldTrial() { | 738 void ChromeBrowserMainParts::ProxyConnectionsFieldTrial() { |
| 724 const base::FieldTrial::Probability kProxyConnectionsDivisor = 100; | 739 const base::FieldTrial::Probability kProxyConnectionsDivisor = 100; |
| 725 // 25% probability | 740 // 25% probability |
| 726 const base::FieldTrial::Probability kProxyConnectionProbability = 1; | 741 const base::FieldTrial::Probability kProxyConnectionProbability = 1; |
| 727 | 742 |
| 728 // After June 30, 2011 builds, it will always be in default group. | 743 // After June 30, 2011 builds, it will always be in default group. |
| 729 scoped_refptr<base::FieldTrial> proxy_connection_trial( | 744 scoped_refptr<base::FieldTrial> proxy_connection_trial( |
| 730 new base::FieldTrial("ProxyConnectionImpact", kProxyConnectionsDivisor, | 745 base::FieldTrial::CreateInstance( |
| 746 "ProxyConnectionImpact", kProxyConnectionsDivisor, |
| 731 "proxy_connections_32", 2011, 6, 30)); | 747 "proxy_connections_32", 2011, 6, 30)); |
| 732 | 748 |
| 733 // This (32 connections per proxy server) is the current default value. | 749 // This (32 connections per proxy server) is the current default value. |
| 734 // Declaring it here allows us to easily re-assign the probability space while | 750 // Declaring it here allows us to easily re-assign the probability space while |
| 735 // maintaining that the default group always has the remainder of the "share", | 751 // maintaining that the default group always has the remainder of the "share", |
| 736 // which allows for cleaner and quicker changes down the line if needed. | 752 // which allows for cleaner and quicker changes down the line if needed. |
| 737 const int proxy_connections_32 = proxy_connection_trial->kDefaultGroupNumber; | 753 const int proxy_connections_32 = proxy_connection_trial->kDefaultGroupNumber; |
| 738 | 754 |
| 739 // The number of max sockets per group cannot be greater than the max number | 755 // The number of max sockets per group cannot be greater than the max number |
| 740 // of sockets per proxy server. We tried using 8, and it can easily | 756 // of sockets per proxy server. We tried using 8, and it can easily |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 std::string spdy_mode = | 790 std::string spdy_mode = |
| 775 parsed_command_line().GetSwitchValueASCII(switches::kUseSpdy); | 791 parsed_command_line().GetSwitchValueASCII(switches::kUseSpdy); |
| 776 net::HttpNetworkLayer::EnableSpdy(spdy_mode); | 792 net::HttpNetworkLayer::EnableSpdy(spdy_mode); |
| 777 } else { | 793 } else { |
| 778 #if !defined(OS_CHROMEOS) | 794 #if !defined(OS_CHROMEOS) |
| 779 bool is_spdy_trial = false; | 795 bool is_spdy_trial = false; |
| 780 const base::FieldTrial::Probability kSpdyDivisor = 100; | 796 const base::FieldTrial::Probability kSpdyDivisor = 100; |
| 781 base::FieldTrial::Probability npnhttp_probability = 5; | 797 base::FieldTrial::Probability npnhttp_probability = 5; |
| 782 | 798 |
| 783 // After June 30, 2013 builds, it will always be in default group. | 799 // After June 30, 2013 builds, it will always be in default group. |
| 784 scoped_refptr<base::FieldTrial> trial( | 800 scoped_refptr<base::FieldTrial> trial(base::FieldTrial::CreateInstance( |
| 785 new base::FieldTrial( | 801 "SpdyImpact", kSpdyDivisor, "npn_with_spdy", 2013, 6, 30)); |
| 786 "SpdyImpact", kSpdyDivisor, "npn_with_spdy", 2013, 6, 30)); | |
| 787 | 802 |
| 788 // npn with spdy support is the default. | 803 // npn with spdy support is the default. |
| 789 int npn_spdy_grp = trial->kDefaultGroupNumber; | 804 int npn_spdy_grp = trial->kDefaultGroupNumber; |
| 790 | 805 |
| 791 // npn with only http support, no spdy. | 806 // npn with only http support, no spdy. |
| 792 int npn_http_grp = trial->AppendGroup("npn_with_http", npnhttp_probability); | 807 int npn_http_grp = trial->AppendGroup("npn_with_http", npnhttp_probability); |
| 793 | 808 |
| 794 int trial_grp = trial->group(); | 809 int trial_grp = trial->group(); |
| 795 if (trial_grp == npn_http_grp) { | 810 if (trial_grp == npn_http_grp) { |
| 796 is_spdy_trial = true; | 811 is_spdy_trial = true; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 809 | 824 |
| 810 // Setup SPDY CWND Field trial. | 825 // Setup SPDY CWND Field trial. |
| 811 const base::FieldTrial::Probability kSpdyCwndDivisor = 100; | 826 const base::FieldTrial::Probability kSpdyCwndDivisor = 100; |
| 812 const base::FieldTrial::Probability kSpdyCwnd16 = 20; // fixed at 16 | 827 const base::FieldTrial::Probability kSpdyCwnd16 = 20; // fixed at 16 |
| 813 const base::FieldTrial::Probability kSpdyCwnd10 = 20; // fixed at 10 | 828 const base::FieldTrial::Probability kSpdyCwnd10 = 20; // fixed at 10 |
| 814 const base::FieldTrial::Probability kSpdyCwndMin16 = 20; // no less than 16 | 829 const base::FieldTrial::Probability kSpdyCwndMin16 = 20; // no less than 16 |
| 815 const base::FieldTrial::Probability kSpdyCwndMin10 = 20; // no less than 10 | 830 const base::FieldTrial::Probability kSpdyCwndMin10 = 20; // no less than 10 |
| 816 | 831 |
| 817 // After June 30, 2013 builds, it will always be in default group | 832 // After June 30, 2013 builds, it will always be in default group |
| 818 // (cwndDynamic). | 833 // (cwndDynamic). |
| 819 scoped_refptr<base::FieldTrial> trial( | 834 scoped_refptr<base::FieldTrial> trial(base::FieldTrial::CreateInstance( |
| 820 new base::FieldTrial( | 835 "SpdyCwnd", kSpdyCwndDivisor, "cwndDynamic", 2013, 6, 30)); |
| 821 "SpdyCwnd", kSpdyCwndDivisor, "cwndDynamic", 2013, 6, 30)); | |
| 822 | 836 |
| 823 trial->AppendGroup("cwnd10", kSpdyCwnd10); | 837 trial->AppendGroup("cwnd10", kSpdyCwnd10); |
| 824 trial->AppendGroup("cwnd16", kSpdyCwnd16); | 838 trial->AppendGroup("cwnd16", kSpdyCwnd16); |
| 825 trial->AppendGroup("cwndMin16", kSpdyCwndMin16); | 839 trial->AppendGroup("cwndMin16", kSpdyCwndMin16); |
| 826 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); | 840 trial->AppendGroup("cwndMin10", kSpdyCwndMin10); |
| 827 | 841 |
| 828 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { | 842 if (parsed_command_line().HasSwitch(switches::kMaxSpdyConcurrentStreams)) { |
| 829 int value = 0; | 843 int value = 0; |
| 830 base::StringToInt(parsed_command_line().GetSwitchValueASCII( | 844 base::StringToInt(parsed_command_line().GetSwitchValueASCII( |
| 831 switches::kMaxSpdyConcurrentStreams), | 845 switches::kMaxSpdyConcurrentStreams), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 849 VLOG(1) << "Setting socket_reuse_policy = " << policy; | 863 VLOG(1) << "Setting socket_reuse_policy = " << policy; |
| 850 SetSocketReusePolicy(policy, policy_list, arraysize(policy_list)); | 864 SetSocketReusePolicy(policy, policy_list, arraysize(policy_list)); |
| 851 return; | 865 return; |
| 852 } | 866 } |
| 853 | 867 |
| 854 const base::FieldTrial::Probability kWarmSocketDivisor = 100; | 868 const base::FieldTrial::Probability kWarmSocketDivisor = 100; |
| 855 const base::FieldTrial::Probability kWarmSocketProbability = 33; | 869 const base::FieldTrial::Probability kWarmSocketProbability = 33; |
| 856 | 870 |
| 857 // After January 30, 2013 builds, it will always be in default group. | 871 // After January 30, 2013 builds, it will always be in default group. |
| 858 scoped_refptr<base::FieldTrial> warmest_socket_trial( | 872 scoped_refptr<base::FieldTrial> warmest_socket_trial( |
| 859 new base::FieldTrial( | 873 base::FieldTrial::CreateInstance( |
| 860 "WarmSocketImpact", kWarmSocketDivisor, "last_accessed_socket", | 874 "WarmSocketImpact", kWarmSocketDivisor, "last_accessed_socket", |
| 861 2013, 1, 30)); | 875 2013, 1, 30)); |
| 862 | 876 |
| 863 // Default value is USE_LAST_ACCESSED_SOCKET. | 877 // Default value is USE_LAST_ACCESSED_SOCKET. |
| 864 const int last_accessed_socket = warmest_socket_trial->kDefaultGroupNumber; | 878 const int last_accessed_socket = warmest_socket_trial->kDefaultGroupNumber; |
| 865 const int warmest_socket = warmest_socket_trial->AppendGroup( | 879 const int warmest_socket = warmest_socket_trial->AppendGroup( |
| 866 "warmest_socket", kWarmSocketProbability); | 880 "warmest_socket", kWarmSocketProbability); |
| 867 const int warm_socket = warmest_socket_trial->AppendGroup( | 881 const int warm_socket = warmest_socket_trial->AppendGroup( |
| 868 "warm_socket", kWarmSocketProbability); | 882 "warm_socket", kWarmSocketProbability); |
| 869 | 883 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 885 } else if (parsed_command_line().HasSwitch( | 899 } else if (parsed_command_line().HasSwitch( |
| 886 switches::kDisableConnectBackupJobs)) { | 900 switches::kDisableConnectBackupJobs)) { |
| 887 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( | 901 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( |
| 888 false); | 902 false); |
| 889 } else { | 903 } else { |
| 890 const base::FieldTrial::Probability kConnectBackupJobsDivisor = 100; | 904 const base::FieldTrial::Probability kConnectBackupJobsDivisor = 100; |
| 891 // 1% probability. | 905 // 1% probability. |
| 892 const base::FieldTrial::Probability kConnectBackupJobsProbability = 1; | 906 const base::FieldTrial::Probability kConnectBackupJobsProbability = 1; |
| 893 // After June 30, 2011 builds, it will always be in default group. | 907 // After June 30, 2011 builds, it will always be in default group. |
| 894 scoped_refptr<base::FieldTrial> trial( | 908 scoped_refptr<base::FieldTrial> trial( |
| 895 new base::FieldTrial("ConnnectBackupJobs", | 909 base::FieldTrial::CreateInstance("ConnnectBackupJobs", |
| 896 kConnectBackupJobsDivisor, "ConnectBackupJobsEnabled", 2011, 6, | 910 kConnectBackupJobsDivisor, "ConnectBackupJobsEnabled", 2011, 6, |
| 897 30)); | 911 30)); |
| 898 const int connect_backup_jobs_enabled = trial->kDefaultGroupNumber; | 912 const int connect_backup_jobs_enabled = trial->kDefaultGroupNumber; |
| 899 trial->AppendGroup("ConnectBackupJobsDisabled", | 913 trial->AppendGroup("ConnectBackupJobsDisabled", |
| 900 kConnectBackupJobsProbability); | 914 kConnectBackupJobsProbability); |
| 901 const int trial_group = trial->group(); | 915 const int trial_group = trial->group(); |
| 902 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( | 916 net::internal::ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled( |
| 903 trial_group == connect_backup_jobs_enabled); | 917 trial_group == connect_backup_jobs_enabled); |
| 904 } | 918 } |
| 905 } | 919 } |
| 906 | 920 |
| 907 void ChromeBrowserMainParts::PredictorFieldTrial() { | 921 void ChromeBrowserMainParts::PredictorFieldTrial() { |
| 908 const base::FieldTrial::Probability kDivisor = 1000; | 922 const base::FieldTrial::Probability kDivisor = 1000; |
| 909 // For each option (i.e., non-default), we have a fixed probability. | 923 // For each option (i.e., non-default), we have a fixed probability. |
| 910 // 0.1% probability. | 924 // 0.1% probability. |
| 911 const base::FieldTrial::Probability kProbabilityPerGroup = 1; | 925 const base::FieldTrial::Probability kProbabilityPerGroup = 1; |
| 912 | 926 |
| 913 // After June 30, 2011 builds, it will always be in default group | 927 // After June 30, 2011 builds, it will always be in default group |
| 914 // (default_enabled_prefetch). | 928 // (default_enabled_prefetch). |
| 915 scoped_refptr<base::FieldTrial> trial( | 929 scoped_refptr<base::FieldTrial> trial(base::FieldTrial::CreateInstance( |
| 916 new base::FieldTrial("DnsImpact", kDivisor, | 930 "DnsImpact", kDivisor, "default_enabled_prefetch", 2011, 10, 30)); |
| 917 "default_enabled_prefetch", 2011, 10, 30)); | |
| 918 | 931 |
| 919 // First option is to disable prefetching completely. | 932 // First option is to disable prefetching completely. |
| 920 int disabled_prefetch = trial->AppendGroup("disabled_prefetch", | 933 int disabled_prefetch = trial->AppendGroup("disabled_prefetch", |
| 921 kProbabilityPerGroup); | 934 kProbabilityPerGroup); |
| 922 | 935 |
| 923 // We're running two experiments at the same time. The first set of trials | 936 // We're running two experiments at the same time. The first set of trials |
| 924 // modulates the delay-time until we declare a congestion event (and purge | 937 // modulates the delay-time until we declare a congestion event (and purge |
| 925 // our queue). The second modulates the number of concurrent resolutions | 938 // our queue). The second modulates the number of concurrent resolutions |
| 926 // we do at any time. Users are in exactly one trial (or the default) during | 939 // we do at any time. Users are in exactly one trial (or the default) during |
| 927 // any one run, and hence only one experiment at a time. | 940 // any one run, and hence only one experiment at a time. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 } | 1027 } |
| 1015 } | 1028 } |
| 1016 | 1029 |
| 1017 void ChromeBrowserMainParts::ComodoDNSExperimentFieldTrial() { | 1030 void ChromeBrowserMainParts::ComodoDNSExperimentFieldTrial() { |
| 1018 // 100% probability of being in the experiment group until the timeout. | 1031 // 100% probability of being in the experiment group until the timeout. |
| 1019 const base::FieldTrial::Probability kDivisor = 1; | 1032 const base::FieldTrial::Probability kDivisor = 1; |
| 1020 const base::FieldTrial::Probability kProbability = 1; | 1033 const base::FieldTrial::Probability kProbability = 1; |
| 1021 | 1034 |
| 1022 // After April 15, 2012 builds, it will always be in default group. | 1035 // After April 15, 2012 builds, it will always be in default group. |
| 1023 scoped_refptr<base::FieldTrial> trial( | 1036 scoped_refptr<base::FieldTrial> trial( |
| 1024 new base::FieldTrial("ComodoDNSExperiment", kDivisor, | 1037 base::FieldTrial::CreateInstance("ComodoDNSExperiment", kDivisor, |
| 1025 "inactive", 2012, 4, 15)); | 1038 "inactive", 2012, 4, 15)); |
| 1026 | 1039 |
| 1027 const int active = trial->AppendGroup("active", kProbability); | 1040 const int active = trial->AppendGroup("active", kProbability); |
| 1028 | 1041 |
| 1029 if (trial->group() == active) | 1042 if (trial->group() == active) |
| 1030 ChromeNetworkDelegate::EnableComodoDNSExperiment(); | 1043 ChromeNetworkDelegate::EnableComodoDNSExperiment(); |
| 1031 } | 1044 } |
| 1032 | 1045 |
| 1033 // ChromeBrowserMainParts: |SetupMetricsAndFieldTrials()| related -------------- | 1046 // ChromeBrowserMainParts: |SetupMetricsAndFieldTrials()| related -------------- |
| 1034 | 1047 |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1675 if (!sdch_enabled) | 1688 if (!sdch_enabled) |
| 1676 net::SdchManager::EnableSdchSupport(false); | 1689 net::SdchManager::EnableSdchSupport(false); |
| 1677 } | 1690 } |
| 1678 if (sdch_enabled) { | 1691 if (sdch_enabled) { |
| 1679 // Perform A/B test to measure global impact of SDCH support. | 1692 // Perform A/B test to measure global impact of SDCH support. |
| 1680 // Set up a field trial to see what disabling SDCH does to latency of page | 1693 // Set up a field trial to see what disabling SDCH does to latency of page |
| 1681 // layout globally. | 1694 // layout globally. |
| 1682 base::FieldTrial::Probability kSDCH_DIVISOR = 1000; | 1695 base::FieldTrial::Probability kSDCH_DIVISOR = 1000; |
| 1683 base::FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 1; // 0.1% prob. | 1696 base::FieldTrial::Probability kSDCH_DISABLE_PROBABILITY = 1; // 0.1% prob. |
| 1684 // After March 31, 2012 builds, it will always be in default group. | 1697 // After March 31, 2012 builds, it will always be in default group. |
| 1685 scoped_refptr<base::FieldTrial> sdch_trial( | 1698 scoped_refptr<base::FieldTrial> sdch_trial(base::FieldTrial::CreateInstance( |
| 1686 new base::FieldTrial("GlobalSdch", kSDCH_DIVISOR, "global_enable_sdch", | 1699 "GlobalSdch", kSDCH_DIVISOR, "global_enable_sdch", 2012, 3, 31)); |
| 1687 2012, 3, 31)); | |
| 1688 int sdch_enabled_group = sdch_trial->kDefaultGroupNumber; | 1700 int sdch_enabled_group = sdch_trial->kDefaultGroupNumber; |
| 1689 | 1701 |
| 1690 sdch_trial->AppendGroup("global_disable_sdch", | 1702 sdch_trial->AppendGroup("global_disable_sdch", |
| 1691 kSDCH_DISABLE_PROBABILITY); | 1703 kSDCH_DISABLE_PROBABILITY); |
| 1692 if (sdch_enabled_group != sdch_trial->group()) | 1704 if (sdch_enabled_group != sdch_trial->group()) |
| 1693 net::SdchManager::EnableSdchSupport(false); | 1705 net::SdchManager::EnableSdchSupport(false); |
| 1694 } | 1706 } |
| 1695 | 1707 |
| 1696 if (parsed_command_line().HasSwitch(switches::kEnableWatchdog)) | 1708 if (parsed_command_line().HasSwitch(switches::kEnableWatchdog)) |
| 1697 InstallJankometer(parsed_command_line()); | 1709 InstallJankometer(parsed_command_line()); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1981 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1970 uma_name += "_XP"; | 1982 uma_name += "_XP"; |
| 1971 | 1983 |
| 1972 uma_name += "_PreRead_"; | 1984 uma_name += "_PreRead_"; |
| 1973 uma_name += pre_read_percentage; | 1985 uma_name += pre_read_percentage; |
| 1974 AddPreReadHistogramTime(uma_name.c_str(), time); | 1986 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1975 } | 1987 } |
| 1976 #endif | 1988 #endif |
| 1977 #endif | 1989 #endif |
| 1978 } | 1990 } |
| OLD | NEW |