| Index: chrome/renderer/page_load_histograms.cc
|
| diff --git a/chrome/renderer/page_load_histograms.cc b/chrome/renderer/page_load_histograms.cc
|
| index 3ae149850dcfc74c835f9ec0ae0b247bd54c0f8a..6bd2c85db364d4d4cdf43893e257e43bb3a72518 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 bool use_dns_histogram(base::FieldTrialList::Find("DnsImpact") &&
|
| - !base::FieldTrialList::Find("DnsImpact")->group_name().empty());
|
| + static const bool use_dns_histogram =
|
| + base::FieldTrialList::TrialExists("DnsImpact");
|
| if (use_dns_histogram) {
|
| UMA_HISTOGRAM_ENUMERATION(
|
| base::FieldTrial::MakeName("PLT.Abandoned", "DnsImpact"),
|
| @@ -307,8 +307,7 @@ void PageLoadHistograms::Dump(WebFrame* frame) {
|
|
|
| // Histograms to determine if content prefetching has an impact on PLT.
|
| static const bool prefetching_fieldtrial =
|
| - base::FieldTrialList::Find("Prefetch") &&
|
| - !base::FieldTrialList::Find("Prefetch")->group_name().empty();
|
| + base::FieldTrialList::TrialExists("Prefetch");
|
| if (prefetching_fieldtrial) {
|
| if (navigation_state->was_prefetcher()) {
|
| PLT_HISTOGRAM(base::FieldTrial::MakeName(
|
| @@ -338,9 +337,8 @@ 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::Find("ConnnectBackupJobs") &&
|
| - !base::FieldTrialList::Find("ConnnectBackupJobs")->group_name().empty());
|
| + static const bool connect_backup_jobs_fieldtrial =
|
| + base::FieldTrialList::TrialExists("ConnnectBackupJobs");
|
| if (connect_backup_jobs_fieldtrial) {
|
| UMA_HISTOGRAM_ENUMERATION(
|
| base::FieldTrial::MakeName("PLT.Abandoned", "ConnnectBackupJobs"),
|
| @@ -378,9 +376,8 @@ 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 bool use_connection_impact_histogram(
|
| - base::FieldTrialList::Find("ConnCountImpact") &&
|
| - !base::FieldTrialList::Find("ConnCountImpact")->group_name().empty());
|
| + static const bool use_connection_impact_histogram =
|
| + base::FieldTrialList::TrialExists("ConnCountImpact");
|
| if (use_connection_impact_histogram) {
|
| UMA_HISTOGRAM_ENUMERATION(
|
| base::FieldTrial::MakeName("PLT.Abandoned", "ConnCountImpact"),
|
| @@ -412,9 +409,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) {
|
| }
|
|
|
| // Histograms to determine effect of idle socket timeout.
|
| - static bool use_idle_socket_timeout_histogram(
|
| - base::FieldTrialList::Find("IdleSktToImpact") &&
|
| - !base::FieldTrialList::Find("IdleSktToImpact")->group_name().empty());
|
| + static const bool use_idle_socket_timeout_histogram =
|
| + base::FieldTrialList::TrialExists("IdleSktToImpact");
|
| if (use_idle_socket_timeout_histogram) {
|
| UMA_HISTOGRAM_ENUMERATION(
|
| base::FieldTrial::MakeName("PLT.Abandoned", "IdleSktToImpact"),
|
| @@ -446,10 +442,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) {
|
| }
|
|
|
| // Histograms to determine effect of number of connections per proxy.
|
| - static bool use_proxy_connection_impact_histogram(
|
| - base::FieldTrialList::Find("ProxyConnectionImpact") &&
|
| - !base::FieldTrialList::Find(
|
| - "ProxyConnectionImpact")->group_name().empty());
|
| + static const bool use_proxy_connection_impact_histogram =
|
| + base::FieldTrialList::TrialExists("ProxyConnectionImpact");
|
| if (use_proxy_connection_impact_histogram) {
|
| UMA_HISTOGRAM_ENUMERATION(
|
| base::FieldTrial::MakeName("PLT.Abandoned", "ProxyConnectionImpact"),
|
| @@ -482,8 +476,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 bool use_sdch_histogram(base::FieldTrialList::Find("GlobalSdch") &&
|
| - !base::FieldTrialList::Find("GlobalSdch")->group_name().empty());
|
| + static const bool use_sdch_histogram =
|
| + base::FieldTrialList::TrialExists("GlobalSdch");
|
| if (use_sdch_histogram) {
|
| UMA_HISTOGRAM_ENUMERATION(
|
| base::FieldTrial::MakeName("PLT.LoadType", "GlobalSdch"),
|
| @@ -520,8 +514,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) {
|
| }
|
|
|
| // Histograms to determine if cache size has an impact on PLT.
|
| - static bool use_cache_histogram1(base::FieldTrialList::Find("CacheSize") &&
|
| - !base::FieldTrialList::Find("CacheSize")->group_name().empty());
|
| + static const bool use_cache_histogram1 =
|
| + base::FieldTrialList::TrialExists("CacheSize");
|
| 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
|
| @@ -531,9 +525,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) {
|
| }
|
|
|
| // Histograms to determine if cache throttling has an impact on PLT.
|
| - static bool use_cache_histogram2(
|
| - base::FieldTrialList::Find("CacheThrottle") &&
|
| - !base::FieldTrialList::Find("CacheThrottle")->group_name().empty());
|
| + static const bool use_cache_histogram2 =
|
| + base::FieldTrialList::TrialExists("CacheThrottle");
|
| if (use_cache_histogram2) {
|
| UMA_HISTOGRAM_ENUMERATION(
|
| base::FieldTrial::MakeName("PLT.Abandoned", "CacheThrottle"),
|
| @@ -591,8 +584,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 bool use_spdy_histogram(base::FieldTrialList::Find("SpdyImpact") &&
|
| - !base::FieldTrialList::Find("SpdyImpact")->group_name().empty());
|
| + static const bool use_spdy_histogram =
|
| + base::FieldTrialList::TrialExists("SpdyImpact");
|
| if (use_spdy_histogram) {
|
| // We take extra effort to only compute these once.
|
| static bool in_spdy_trial = base::FieldTrialList::Find(
|
| @@ -749,8 +742,8 @@ void PageLoadHistograms::Dump(WebFrame* frame) {
|
| }
|
| }
|
|
|
| - static bool false_start_trial(base::FieldTrialList::Find("SSLFalseStart") &&
|
| - !base::FieldTrialList::Find("SSLFalseStart")->group_name().empty());
|
| + static const bool false_start_trial =
|
| + base::FieldTrialList::TrialExists("SSLFalseStart");
|
| if (false_start_trial) {
|
| if (scheme_type == URLPattern::SCHEME_HTTPS) {
|
| switch (load_type) {
|
|
|