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

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: Created 4 years, 8 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
« no previous file with comments | « components/metrics/metrics_pref_names.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_service.h
diff --git a/components/metrics/metrics_service.h b/components/metrics/metrics_service.h
index ce4102b8dfa36408fe037bd6772184d759a48a4e..f02df4bcabf1e4f285fb029ec3f41eea92f14d44 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"
@@ -214,6 +215,10 @@ class MetricsService : public base::HistogramFlattener {
// Pushes a log that has been generated by an external component.
void PushExternalLog(const std::string& log);
+ // Returns a callback to data use pref updating function which can be called
+ // from any thread, but this function should be called on UI thread.
+ UpdateUsagePrefCallbackType GetDataUseForwardingCallback();
+
protected:
// Exposed for testing.
MetricsLogManager* log_manager() { return &log_manager_; }
@@ -468,7 +473,7 @@ 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_;
@@ -477,6 +482,9 @@ class MetricsService : public base::HistogramFlattener {
PermutedEntropyCacheClearedWhenLowEntropyReset);
FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial);
+ // Pointer used for obtaining data use pref updater callback on above layers.
+ scoped_ptr<DataUseTracker> data_use_tracker_;
+
// Weak pointers factory used to post task on different threads. All weak
// pointers managed by this factory have the same lifetime as MetricsService.
base::WeakPtrFactory<MetricsService> self_ptr_factory_;
« no previous file with comments | « components/metrics/metrics_pref_names.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698