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

Unified Diff: chrome/browser/metrics/metrics_log.h

Issue 282093012: Remove dependencies of Metrics{Service,Log} on g_browser_process->local_state() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android compile fix Created 6 years, 7 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 | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_log.h
diff --git a/chrome/browser/metrics/metrics_log.h b/chrome/browser/metrics/metrics_log.h
index 25102d84e23857f8a7cd2aca608dcd7324195d88..0e7c8f9a036f136546325388713ce059a3d6100f 100644
--- a/chrome/browser/metrics/metrics_log.h
+++ b/chrome/browser/metrics/metrics_log.h
@@ -45,13 +45,15 @@ class MetricsLog : public metrics::MetricsLogBase {
// |client_id| is the identifier for this profile on this installation
// |session_id| is an integer that's incremented on each application launch
// |client| is used to interact with the embedder.
+ // |local_state| is the PrefService that this instance should use.
// Note: |this| instance does not take ownership of the |client|, but rather
// stores a weak pointer to it. The caller should ensure that the |client| is
// valid for the lifetime of this class.
MetricsLog(const std::string& client_id,
int session_id,
LogType log_type,
- metrics::MetricsServiceClient* client);
+ metrics::MetricsServiceClient* client,
+ PrefService* local_state);
virtual ~MetricsLog();
// Records the current operating environment, including metrics provided by
@@ -101,9 +103,6 @@ class MetricsLog : public metrics::MetricsLogBase {
protected:
// Exposed for the sake of mocking in test code.
- // Returns the PrefService from which to log metrics data.
- virtual PrefService* GetPrefService();
-
// Fills |field_trial_ids| with the list of initialized field trials name and
// group ids.
virtual void GetFieldTrialIds(
@@ -138,6 +137,8 @@ class MetricsLog : public metrics::MetricsLogBase {
// The time when the current log was created.
const base::TimeTicks creation_time_;
+ PrefService* local_state_;
+
DISALLOW_COPY_AND_ASSIGN(MetricsLog);
};
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/metrics/metrics_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698