diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-06 00:52:39 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-06 00:52:39 +0000 |
commit | 5557b198f9815a758cf5a27d463e077b8bbbbfd8 (patch) | |
tree | 72d192231b743092b69ba1cbb5bb4501aa324e41 /chrome/renderer | |
parent | dc86fccde35745d2b1501fcc08d9aa42ea1ee1cc (diff) | |
download | chromium_src-5557b198f9815a758cf5a27d463e077b8bbbbfd8.zip chromium_src-5557b198f9815a758cf5a27d463e077b8bbbbfd8.tar.gz chromium_src-5557b198f9815a758cf5a27d463e077b8bbbbfd8.tar.bz2 |
Revert 84197 - Add one-time randomization support for FieldTrial, and the ability to
disable field trials. I am going to have a need for both soon.
Cleaning up some comments about empty trial names, adding static
method TrialExists() and simplifying many call sites by using this
method.
While I'm in there and needing base/OWNERS approval, add an OWNERS
file for base/metrics that adds jar@chromium.org as an owner for that
directory.
BUG=none
TEST=base_unittests
TBR=jam@chromium.org
R=jar@chromium.org,phajdan.jr@chromium.org,mark@chromium.org,wtc@chromium.org
Reason for revert: See http://crbug.com/81750
BUG=81750
TBR=joi@chromium.org
Review URL: http://codereview.chromium.org/6931048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84373 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/page_load_histograms.cc | 49 | ||||
-rw-r--r-- | chrome/renderer/prerender/prerender_helper.cc | 3 |
2 files changed, 30 insertions, 22 deletions
diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc index 6bd2c85..3ae1498 100644 --- a/chrome/renderer/page_load_histograms.cc +++ b/chrome/renderer/page_load_histograms.cc @@ -270,8 +270,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine if DNS prefetching has an impact on PLT. - static const bool use_dns_histogram = - base::FieldTrialList::TrialExists("DnsImpact"); + static bool use_dns_histogram(base::FieldTrialList::Find("DnsImpact") && + !base::FieldTrialList::Find("DnsImpact")->group_name().empty()); if (use_dns_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "DnsImpact"), @@ -307,7 +307,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { // Histograms to determine if content prefetching has an impact on PLT. static const bool prefetching_fieldtrial = - base::FieldTrialList::TrialExists("Prefetch"); + base::FieldTrialList::Find("Prefetch") && + !base::FieldTrialList::Find("Prefetch")->group_name().empty(); if (prefetching_fieldtrial) { if (navigation_state->was_prefetcher()) { PLT_HISTOGRAM(base::FieldTrial::MakeName( @@ -337,8 +338,9 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine if backup connection jobs have an impact on PLT. - static const bool connect_backup_jobs_fieldtrial = - base::FieldTrialList::TrialExists("ConnnectBackupJobs"); + static const bool connect_backup_jobs_fieldtrial( + base::FieldTrialList::Find("ConnnectBackupJobs") && + !base::FieldTrialList::Find("ConnnectBackupJobs")->group_name().empty()); if (connect_backup_jobs_fieldtrial) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "ConnnectBackupJobs"), @@ -376,8 +378,9 @@ void PageLoadHistograms::Dump(WebFrame* frame) { // impact on PLT. // TODO(jar): Consider removing the per-link-type versions. We // really only need LINK_LOAD_NORMAL and NORMAL_LOAD. - static const bool use_connection_impact_histogram = - base::FieldTrialList::TrialExists("ConnCountImpact"); + static bool use_connection_impact_histogram( + base::FieldTrialList::Find("ConnCountImpact") && + !base::FieldTrialList::Find("ConnCountImpact")->group_name().empty()); if (use_connection_impact_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "ConnCountImpact"), @@ -409,8 +412,9 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine effect of idle socket timeout. - static const bool use_idle_socket_timeout_histogram = - base::FieldTrialList::TrialExists("IdleSktToImpact"); + static bool use_idle_socket_timeout_histogram( + base::FieldTrialList::Find("IdleSktToImpact") && + !base::FieldTrialList::Find("IdleSktToImpact")->group_name().empty()); if (use_idle_socket_timeout_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "IdleSktToImpact"), @@ -442,8 +446,10 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine effect of number of connections per proxy. - static const bool use_proxy_connection_impact_histogram = - base::FieldTrialList::TrialExists("ProxyConnectionImpact"); + static bool use_proxy_connection_impact_histogram( + base::FieldTrialList::Find("ProxyConnectionImpact") && + !base::FieldTrialList::Find( + "ProxyConnectionImpact")->group_name().empty()); if (use_proxy_connection_impact_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "ProxyConnectionImpact"), @@ -476,8 +482,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { // Histograms to determine if SDCH has an impact. // TODO(jar): Consider removing per-link load types and the enumeration. - static const bool use_sdch_histogram = - base::FieldTrialList::TrialExists("GlobalSdch"); + static bool use_sdch_histogram(base::FieldTrialList::Find("GlobalSdch") && + !base::FieldTrialList::Find("GlobalSdch")->group_name().empty()); if (use_sdch_histogram) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.LoadType", "GlobalSdch"), @@ -514,8 +520,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine if cache size has an impact on PLT. - static const bool use_cache_histogram1 = - base::FieldTrialList::TrialExists("CacheSize"); + static bool use_cache_histogram1(base::FieldTrialList::Find("CacheSize") && + !base::FieldTrialList::Find("CacheSize")->group_name().empty()); if (use_cache_histogram1 && NavigationState::LINK_LOAD_NORMAL <= load_type && NavigationState::LINK_LOAD_CACHE_ONLY >= load_type) { // TODO(mbelshe): Do we really want BeginToFinishDoc here? It seems like @@ -525,8 +531,9 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } // Histograms to determine if cache throttling has an impact on PLT. - static const bool use_cache_histogram2 = - base::FieldTrialList::TrialExists("CacheThrottle"); + static bool use_cache_histogram2( + base::FieldTrialList::Find("CacheThrottle") && + !base::FieldTrialList::Find("CacheThrottle")->group_name().empty()); if (use_cache_histogram2) { UMA_HISTOGRAM_ENUMERATION( base::FieldTrial::MakeName("PLT.Abandoned", "CacheThrottle"), @@ -584,8 +591,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { // if we asked for a HTTP request, we got a HTTP request // Due to spdy version mismatches, it is possible that we ask for SPDY // but didn't get SPDY. - static const bool use_spdy_histogram = - base::FieldTrialList::TrialExists("SpdyImpact"); + static bool use_spdy_histogram(base::FieldTrialList::Find("SpdyImpact") && + !base::FieldTrialList::Find("SpdyImpact")->group_name().empty()); if (use_spdy_histogram) { // We take extra effort to only compute these once. static bool in_spdy_trial = base::FieldTrialList::Find( @@ -742,8 +749,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) { } } - static const bool false_start_trial = - base::FieldTrialList::TrialExists("SSLFalseStart"); + static bool false_start_trial(base::FieldTrialList::Find("SSLFalseStart") && + !base::FieldTrialList::Find("SSLFalseStart")->group_name().empty()); if (false_start_trial) { if (scheme_type == URLPattern::SCHEME_HTTPS) { switch (load_type) { diff --git a/chrome/renderer/prerender/prerender_helper.cc b/chrome/renderer/prerender/prerender_helper.cc index 47b1d70..09efc71 100644 --- a/chrome/renderer/prerender/prerender_helper.cc +++ b/chrome/renderer/prerender/prerender_helper.cc @@ -45,7 +45,8 @@ void PrerenderHelper::RecordHistograms( const base::Time& finish_all_loads, const base::TimeDelta& begin_to_finish_all_loads) { static bool use_prerender_histogram = - base::FieldTrialList::TrialExists("Prefetch"); + base::FieldTrialList::Find("Prefetch") && + !base::FieldTrialList::Find("Prefetch")->group_name().empty(); if (!use_prerender_histogram) return; |