diff options
author | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-26 15:59:34 +0000 |
---|---|---|
committer | blundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-26 15:59:34 +0000 |
commit | 24f81cad13af6e0ba08ac2335cb27ad280f1143e (patch) | |
tree | 35ce59ff9bd99ef630450c0efe1a53eafe2bea60 /chrome/browser/metrics/metrics_log.h | |
parent | cbbdeef85b213545ddc022610f3fb308a738123b (diff) | |
download | chromium_src-24f81cad13af6e0ba08ac2335cb27ad280f1143e.zip chromium_src-24f81cad13af6e0ba08ac2335cb27ad280f1143e.tar.gz chromium_src-24f81cad13af6e0ba08ac2335cb27ad280f1143e.tar.bz2 |
Remove dependencies of Metrics{Service,Log} on g_browser_process->local_state()
This CL changes MetricsService and MetricsLog to take in a |local_state| param
in their constructors. It additionally changes several static MetricsService
functions to take in a |local_state| param.
BUG=374299,374300
TBR=jochen
Review URL: https://codereview.chromium.org/282093012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics/metrics_log.h')
-rw-r--r-- | chrome/browser/metrics/metrics_log.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/metrics/metrics_log.h b/chrome/browser/metrics/metrics_log.h index 25102d8..0e7c8f9 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); }; |