Index: chrome/browser/metrics/chrome_metrics_service_client.cc |
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc |
index ed4fe07e3de76fd0b621c1c19d21b31f16e43770..32800e321210df081f1259c6299275fa2908e53c 100644 |
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc |
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc |
@@ -42,6 +42,7 @@ |
#include "components/metrics/metrics_pref_names.h" |
#include "components/metrics/metrics_service.h" |
#include "components/metrics/metrics_service_client.h" |
+#include "components/metrics/net/cellular_logic_helper.h" |
#include "components/metrics/net/net_metrics_log_uploader.h" |
#include "components/metrics/net/network_metrics_provider.h" |
#include "components/metrics/net/version_utils.h" |
@@ -54,7 +55,6 @@ |
#include "components/prefs/pref_registry_simple.h" |
#include "components/prefs/pref_service.h" |
#include "components/sync_driver/device_count_metrics_provider.h" |
-#include "components/variations/variations_associated_data.h" |
#include "components/version_info/version_info.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/histogram_fetcher.h" |
@@ -100,28 +100,6 @@ namespace { |
// data. |
const int kMaxHistogramGatheringWaitDuration = 60000; // 60 seconds. |
-// Standard interval between log uploads, in seconds. |
-#if defined(OS_ANDROID) |
-const int kStandardUploadIntervalSeconds = 5 * 60; // Five minutes. |
-const int kStandardUploadIntervalCellularSeconds = 15 * 60; // Fifteen minutes. |
-#else |
-const int kStandardUploadIntervalSeconds = 30 * 60; // Thirty minutes. |
-#endif |
- |
-// Returns true if current connection type is cellular and user is assigned to |
-// experimental group for enabled cellular uploads. |
-bool IsCellularLogicEnabled() { |
- if (variations::GetVariationParamValue("UMA_EnableCellularLogUpload", |
- "Enabled") != "true" || |
- variations::GetVariationParamValue("UMA_EnableCellularLogUpload", |
- "Optimize") == "false") { |
- return false; |
- } |
- |
- return net::NetworkChangeNotifier::IsConnectionCellular( |
- net::NetworkChangeNotifier::GetConnectionType()); |
-} |
- |
// Checks whether it is the first time that cellular uploads logic should be |
// enabled based on whether the the preference for that logic is initialized. |
// This should happen only once as the used preference will be initialized |
@@ -130,8 +108,7 @@ bool ShouldClearSavedMetrics() { |
#if BUILDFLAG(ANDROID_JAVA_UI) |
PrefService* local_state = g_browser_process->local_state(); |
return !local_state->HasPrefPath(metrics::prefs::kMetricsReportingEnabled) && |
- variations::GetVariationParamValue("UMA_EnableCellularLogUpload", |
- "Enabled") == "true"; |
+ metrics::IsCellularLogicEnabled(); |
#else |
return false; |
#endif |
@@ -314,11 +291,7 @@ ChromeMetricsServiceClient::CreateUploader( |
} |
base::TimeDelta ChromeMetricsServiceClient::GetStandardUploadInterval() { |
-#if defined(OS_ANDROID) |
- if (IsCellularLogicEnabled()) |
- return base::TimeDelta::FromSeconds(kStandardUploadIntervalCellularSeconds); |
-#endif |
- return base::TimeDelta::FromSeconds(kStandardUploadIntervalSeconds); |
+ return metrics::GetUploadInterval(); |
} |
base::string16 ChromeMetricsServiceClient::GetRegistryBackupKey() { |
@@ -403,8 +376,8 @@ void ChromeMetricsServiceClient::Initialize() { |
metrics_service_->RegisterMetricsProvider( |
std::unique_ptr<metrics::MetricsProvider>(drive_metrics_provider_)); |
- profiler_metrics_provider_ = |
- new metrics::ProfilerMetricsProvider(base::Bind(&IsCellularLogicEnabled)); |
+ profiler_metrics_provider_ = new metrics::ProfilerMetricsProvider( |
+ base::Bind(&metrics::IsCellularLogicEnabled)); |
metrics_service_->RegisterMetricsProvider( |
std::unique_ptr<metrics::MetricsProvider>(profiler_metrics_provider_)); |
@@ -699,5 +672,5 @@ void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
} |
bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { |
- return IsCellularLogicEnabled(); |
+ return metrics::IsCellularLogicEnabled(); |
} |