Chromium Code Reviews| Index: chrome/browser/metrics/metrics_service.h |
| diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h |
| index 9a52d030de221a0be1d42ef921d280c8967ef13e..dd30b7c5c0a0a5436e866d09b64151fed66031d1 100644 |
| --- a/chrome/browser/metrics/metrics_service.h |
| +++ b/chrome/browser/metrics/metrics_service.h |
| @@ -54,6 +54,7 @@ class FlashDOMHandler; |
| namespace base { |
| class DictionaryValue; |
| class MessageLoopProxy; |
| +class PrefService; |
| } |
| namespace chrome_variations { |
| @@ -131,10 +132,12 @@ class MetricsService |
| SHUTDOWN_COMPLETE = 700, |
| }; |
| - // Creates the MetricsService with the given |state_manager|. Does not take |
| - // ownership of |state_manager|, instead stores a weak pointer to it. Caller |
| - // should ensure that |state_manager| is valid for the lifetime of this class. |
| - explicit MetricsService(metrics::MetricsStateManager* state_manager); |
| + // Creates the MetricsService with the given |state_manager| and |
| + // |local_state|. Does not take ownership of the parameters, instead stores |
| + // weak pointers. Caller should ensure that the passed-in objects are valid |
| + // for the lifetime of this class. |
| + MetricsService(metrics::MetricsStateManager* state_manager, |
| + PrefService* local_state); |
| virtual ~MetricsService(); |
| // Initializes metrics recording state. Updates various bookkeeping values in |
| @@ -235,10 +238,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. |
| @@ -487,6 +491,8 @@ class MetricsService |
| // low entropy source and whether metrics reporting is enabled. Weak pointer. |
| metrics::MetricsStateManager* state_manager_; |
| + PrefService* local_state_; |
| + |
| base::ActionCallback action_callback_; |
| content::NotificationRegistrar registrar_; |
| @@ -631,12 +637,12 @@ class MetricsServiceHelper { |
| // TODO(asvitkine): Consolidate the method in MetricsStateManager. |
| // TODO(asvitkine): This function does not report the correct value on |
| // Android and ChromeOS, see http://crbug.com/362192. |
| - static bool IsMetricsReportingEnabled(); |
| + static bool IsMetricsReportingEnabled(const PrefService* local_state); |
|
Alexei Svitkine (slow)
2014/05/19 13:13:54
Hmm, so we have a separate bug to move MetricsServ
blundell
2014/05/19 13:49:28
Are we not going to need to access this API from t
Alexei Svitkine (slow)
2014/05/19 13:53:44
Not quite. The idea is that the implementation sho
|
| // Returns true if crash reporting is enabled. This is set at the platform |
| // level for Android and ChromeOS, and otherwise is the same as |
| // IsMetricsReportingEnabled for desktop Chrome. |
| - static bool IsCrashReportingEnabled(); |
| + static bool IsCrashReportingEnabled(const PrefService* local_state); |
| // Registers/unregisters |observer| to receive MetricsLog notifications |
| // from metrics service. |