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

Unified Diff: components/metrics/metrics_service.h

Issue 1818613002: Implement UMA log throttling for cellular connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: singleton pattern removed Created 4 years, 9 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 ce4102b8dfa36408fe037bd6772184d759a48a4e..68184503771608756d700ca482a76231af50b923 100644
--- a/components/metrics/metrics_service.h
+++ b/components/metrics/metrics_service.h
@@ -27,6 +27,7 @@
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/metrics/clean_exit_beacon.h"
+#include "components/metrics/data_use_tracker.h"
#include "components/metrics/metrics_log.h"
#include "components/metrics/metrics_log_manager.h"
#include "components/metrics/metrics_provider.h"
@@ -79,7 +80,8 @@ class MetricsService : public base::HistogramFlattener {
// for the lifetime of this class.
MetricsService(MetricsStateManager* state_manager,
MetricsServiceClient* client,
- PrefService* local_state);
+ PrefService* local_state,
+ base::Callback<void(bool*)> cellular_callback);
~MetricsService() override;
// Initializes metrics recording state. Updates various bookkeeping values in
@@ -214,6 +216,8 @@ class MetricsService : public base::HistogramFlattener {
// Pushes a log that has been generated by an external component.
void PushExternalLog(const std::string& log);
+ base::WeakPtr<DataUseTracker> GetDataUseTracker();
+
protected:
// Exposed for testing.
MetricsLogManager* log_manager() { return &log_manager_; }
@@ -468,10 +472,16 @@ class MetricsService : public base::HistogramFlattener {
// Execution phase the browser is in.
static ExecutionPhase execution_phase_;
- // Reduntant marker to check that we completed our shutdown, and set the
+ // Redundant marker to check that we completed our shutdown, and set the
// exited-cleanly bit in the prefs.
static ShutdownCleanliness clean_shutdown_status_;
+ // Returns true if current connection type is cellular and user is assigned to
+ // experimental group for enabled cellular uploads.
+ base::Callback<void(bool*)> cellular_callback_;
Alexei Svitkine (slow) 2016/03/29 16:29:10 Put these members below the friend declarations.
gayane -on leave until 09-2017 2016/03/31 01:38:24 Done.
+
+ scoped_ptr<DataUseTracker> data_use_tracker_;
+
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, IsPluginProcess);
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest,
PermutedEntropyCacheClearedWhenLowEntropyReset);

Powered by Google App Engine
This is Rietveld 408576698