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

Unified Diff: chrome/browser/metrics/metrics_service.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/metrics/metrics_log_unittest.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_service.h
diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
index 3272264f9ce4d6281ac8990703c970cead4a8e0f..9af1b4bb817a68c5508cd2b3ebe10bce82fe02fe 100644
--- a/chrome/browser/metrics/metrics_service.h
+++ b/chrome/browser/metrics/metrics_service.h
@@ -44,6 +44,7 @@ namespace base {
class DictionaryValue;
class HistogramSamples;
class MessageLoopProxy;
+class PrefService;
}
namespace variations {
@@ -103,12 +104,13 @@ class MetricsService
SHUTDOWN_COMPLETE = 700,
};
- // Creates the MetricsService with the given |state_manager| and |client|.
- // Does not take ownership of |state_manager| or |client|; instead stores a
- // weak pointer to each. Caller should ensure that |state_manager| and
- // |client| are valid for the lifetime of this class.
+ // Creates the MetricsService with the given |state_manager|, |client|, and
+ // |local_state|. Does not take ownership of the paramaters; instead stores
+ // a weak pointer to each. Caller should ensure that the parameters are valid
+ // for the lifetime of this class.
MetricsService(metrics::MetricsStateManager* state_manager,
- metrics::MetricsServiceClient* client);
+ metrics::MetricsServiceClient* client,
+ PrefService* local_state);
virtual ~MetricsService();
// Initializes metrics recording state. Updates various bookkeeping values in
@@ -188,10 +190,11 @@ class MetricsService
void OnAppEnterForeground();
#else
// Set the dirty flag, which will require a later call to LogCleanShutdown().
- static void LogNeedForCleanShutdown();
+ static void LogNeedForCleanShutdown(PrefService* local_state);
#endif // defined(OS_ANDROID) || defined(OS_IOS)
- static void SetExecutionPhase(ExecutionPhase execution_phase);
+ static void SetExecutionPhase(ExecutionPhase execution_phase,
+ PrefService* local_state);
// Saves in the preferences if the crash report registration was successful.
// This count is eventually send via UMA logs.
@@ -419,6 +422,8 @@ class MetricsService
// Registered metrics providers.
ScopedVector<metrics::MetricsProvider> metrics_providers_;
+ PrefService* local_state_;
+
base::ActionCallback action_callback_;
// Indicate whether recording and reporting are currently happening.
« no previous file with comments | « chrome/browser/metrics/metrics_log_unittest.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698