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

Unified Diff: components/metrics/data_use_tracker.h

Issue 2517363002: Decouple Metrics Initialization from IO Thread Initialization (Closed)
Patch Set: CR Feedback Created 4 years 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 | « chrome/browser/io_thread.cc ('k') | components/metrics/data_use_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/data_use_tracker.h
diff --git a/components/metrics/data_use_tracker.h b/components/metrics/data_use_tracker.h
index b6441ec79806cb7e612c7d8a648c10313e25db5a..e5eb2ba25fd66240d9a60a149158260bf7a2e3e3 100644
--- a/components/metrics/data_use_tracker.h
+++ b/components/metrics/data_use_tracker.h
@@ -10,9 +10,6 @@
#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "base/sequenced_task_runner.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "components/prefs/pref_registry_simple.h"
@@ -38,10 +35,10 @@ class DataUseTracker {
// Registers data use prefs using provided |registry|.
static void RegisterPrefs(PrefRegistrySimple* registry);
- // Returns a callback to data use pref updating function. Should be called on
- // UI thread.
- UpdateUsagePrefCallbackType GetDataUseForwardingCallback(
- scoped_refptr<base::SequencedTaskRunner> ui_task_runner);
+ // Updates data usage tracking prefs with the specified values.
+ void UpdateMetricsUsagePrefs(const std::string& service_name,
+ int message_size,
+ bool is_cellular);
// Returns whether a log with provided |log_bytes| can be uploaded according
// to data use ratio and UMA quota provided by variations.
@@ -53,12 +50,6 @@ class DataUseTracker {
FRIEND_TEST_ALL_PREFIXES(DataUseTrackerTest, CheckComputeTotalDataUse);
FRIEND_TEST_ALL_PREFIXES(DataUseTrackerTest, CheckCanUploadUMALog);
- // Updates data usage prefs on UI thread according to what Prefservice
- // expects.
- void UpdateMetricsUsagePrefsOnUIThread(const std::string& service_name,
- int message_size,
- bool is_cellular);
-
// Updates provided |pref_name| for a current date with the given message
// size.
void UpdateUsagePref(const std::string& pref_name, int message_size);
@@ -90,8 +81,6 @@ class DataUseTracker {
base::ThreadChecker thread_checker_;
- base::WeakPtrFactory<DataUseTracker> weak_ptr_factory_;
-
DISALLOW_COPY_AND_ASSIGN(DataUseTracker);
};
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | components/metrics/data_use_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698