| Index: chrome/browser/metrics/metrics_service.h
|
| diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h
|
| index 858ec4fd44c12bc1f41742bc75a42ee891ba6437..908a8cf75625cda735a1688f90e709d48baeed0c 100644
|
| --- a/chrome/browser/metrics/metrics_service.h
|
| +++ b/chrome/browser/metrics/metrics_service.h
|
| @@ -18,6 +18,8 @@
|
| #include "base/memory/scoped_vector.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/metrics/field_trial.h"
|
| +#include "base/metrics/histogram_flattener.h"
|
| +#include "base/metrics/histogram_snapshot_manager.h"
|
| #include "base/metrics/user_metrics.h"
|
| #include "base/observer_list.h"
|
| #include "base/process/kill.h"
|
| @@ -25,8 +27,8 @@
|
| #include "base/time/time.h"
|
| #include "chrome/browser/metrics/metrics_log.h"
|
| #include "chrome/browser/metrics/tracking_synchronizer_observer.h"
|
| -#include "chrome/common/metrics/metrics_service_base.h"
|
| #include "chrome/installer/util/google_update_settings.h"
|
| +#include "components/metrics/metrics_log_manager.h"
|
| #include "components/metrics/metrics_provider.h"
|
| #include "components/metrics/metrics_service_observer.h"
|
| #include "components/variations/active_field_trials.h"
|
| @@ -54,6 +56,7 @@ class FlashDOMHandler;
|
|
|
| namespace base {
|
| class DictionaryValue;
|
| +class HistogramSamples;
|
| class MessageLoopProxy;
|
| }
|
|
|
| @@ -115,11 +118,11 @@ struct SyntheticTrialGroup {
|
| };
|
|
|
| class MetricsService
|
| - : public chrome_browser_metrics::TrackingSynchronizerObserver,
|
| + : public base::HistogramFlattener,
|
| + public chrome_browser_metrics::TrackingSynchronizerObserver,
|
| public content::BrowserChildProcessObserver,
|
| public content::NotificationObserver,
|
| - public net::URLFetcherDelegate,
|
| - public MetricsServiceBase {
|
| + public net::URLFetcherDelegate {
|
| public:
|
| // The execution phase of the browser.
|
| enum ExecutionPhase {
|
| @@ -198,6 +201,15 @@ class MetricsService
|
| static void SetUpNotifications(content::NotificationRegistrar* registrar,
|
| content::NotificationObserver* observer);
|
|
|
| + // HistogramFlattener:
|
| + virtual void RecordDelta(const base::HistogramBase& histogram,
|
| + const base::HistogramSamples& snapshot) OVERRIDE;
|
| + virtual void InconsistencyDetected(
|
| + base::HistogramBase::Inconsistency problem) OVERRIDE;
|
| + virtual void UniqueInconsistencyDetected(
|
| + base::HistogramBase::Inconsistency problem) OVERRIDE;
|
| + virtual void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE;
|
| +
|
| // Implementation of content::BrowserChildProcessObserver
|
| virtual void BrowserChildProcessHostConnected(
|
| const content::ChildProcessData& data) OVERRIDE;
|
| @@ -206,7 +218,7 @@ class MetricsService
|
| virtual void BrowserChildProcessInstanceCreated(
|
| const content::ChildProcessData& data) OVERRIDE;
|
|
|
| - // Implementation of content::NotificationObserver
|
| + // content::NotificationObserver:
|
| virtual void Observe(int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) OVERRIDE;
|
| @@ -292,6 +304,10 @@ class MetricsService
|
| void CheckForClonedInstall(
|
| scoped_refptr<base::SingleThreadTaskRunner> task_runner);
|
|
|
| + protected:
|
| + // Exposed for testing.
|
| + metrics::MetricsLogManager* log_manager() { return &log_manager_; }
|
| +
|
| private:
|
| // The MetricsService has a lifecycle that is stored as a state.
|
| // See metrics_service.cc for description of this lifecycle.
|
| @@ -488,6 +504,20 @@ class MetricsService
|
| void GetCurrentSyntheticFieldTrials(
|
| std::vector<variations::ActiveGroupId>* synthetic_trials);
|
|
|
| + // Record complete list of histograms into the current log.
|
| + // Called when we close a log.
|
| + void RecordCurrentHistograms();
|
| +
|
| + // Record complete list of stability histograms into the current log,
|
| + // i.e., histograms with the |kUmaStabilityHistogramFlag| flag set.
|
| + void RecordCurrentStabilityHistograms();
|
| +
|
| + // Manager for the various in-flight logs.
|
| + metrics::MetricsLogManager log_manager_;
|
| +
|
| + // |histogram_snapshot_manager_| prepares histogram deltas for transmission.
|
| + base::HistogramSnapshotManager histogram_snapshot_manager_;
|
| +
|
| // Used to manage various metrics reporting state prefs, such as client id,
|
| // low entropy source and whether metrics reporting is enabled. Weak pointer.
|
| metrics::MetricsStateManager* const state_manager_;
|
|
|