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

Unified Diff: components/metrics/metrics_service.h

Issue 922383003: Enable UMA log uploads for cellular networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed old solution, fixed comments Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/metrics/metrics_service.h
diff --git a/components/metrics/metrics_service.h b/components/metrics/metrics_service.h
index 904147454ed490eafc424edf046475a15db67d24..5257a48cc719d7a8e22bda80e960039a66b563b1 100644
--- a/components/metrics/metrics_service.h
+++ b/components/metrics/metrics_service.h
@@ -27,6 +27,7 @@
#include "components/metrics/metrics_log.h"
#include "components/metrics/metrics_log_manager.h"
#include "components/metrics/metrics_provider.h"
+#include "components/metrics/net/network_metrics_provider.h"
#include "components/variations/active_field_trials.h"
class MetricsServiceAccessor;
@@ -242,6 +243,17 @@ class MetricsService : public base::HistogramFlattener {
// Clears the stability metrics that are saved in local state.
void ClearSavedStabilityMetrics();
+ // Sets the network metrics provider and registers as a provider.
Alexei Svitkine (slow) 2015/02/19 16:29:12 Nit: "registers it as a provider."
gayane -on leave until 09-2017 2015/02/19 22:40:13 Done.
+ void SetNetworkMetricsProvider(
+ scoped_ptr<NetworkMetricsProvider> network_metrics_provider);
+
+ // Returns true if the connection type is 2G, 3G, or 4G.
+ bool IsCellularConnection();
Alexei Svitkine (slow) 2015/02/19 16:29:12 This function and the one below should be private.
gayane -on leave until 09-2017 2015/02/19 22:40:13 Done.
+
+ // Assigns the passed |is_cellular_out| parameter based on whether current
+ // network connection is cellular.
+ void GetIsCellularConnection(bool* is_cellular_out);
+
protected:
// Exposed for testing.
MetricsLogManager* log_manager() { return &log_manager_; }
@@ -481,6 +493,9 @@ class MetricsService : public base::HistogramFlattener {
// exited-cleanly bit in the prefs.
static ShutdownCleanliness clean_shutdown_status_;
+ // Network metrics provider used for getting current connection type.
+ const NetworkMetricsProvider* network_metrics_provider_;
+
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, IsPluginProcess);
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest,
PermutedEntropyCacheClearedWhenLowEntropyReset);

Powered by Google App Engine
This is Rietveld 408576698